|
|
@@ -504,14 +504,14 @@ class ShopController extends BaseController {
|
|
|
*/
|
|
|
public function actionLogisticsAuto()
|
|
|
{
|
|
|
- $createdAtStart = strtotime('yesterday');
|
|
|
+// $createdAtStart = strtotime('yesterday');
|
|
|
$createdAtEnd = strtotime(date('Y-m-d')) - 1;
|
|
|
// 早0点推送,前一天0-24点的订单
|
|
|
$orderList = Order::find()
|
|
|
->where(
|
|
|
- '(CREATED_AT BETWEEN :CREATED_AT_START AND :CREATED_AT_END) AND STATUS=:STATUS AND SEND_AT=:SEND_AT AND PAY_TYPE=:PAY_TYPE',
|
|
|
+ '(CREATED_AT <= :CREATED_AT_END) AND STATUS=:STATUS AND SEND_AT=:SEND_AT AND PAY_TYPE=:PAY_TYPE',
|
|
|
[
|
|
|
- ':CREATED_AT_START' => $createdAtStart,
|
|
|
+// ':CREATED_AT_START' => $createdAtStart,
|
|
|
':CREATED_AT_END' => $createdAtEnd,
|
|
|
':STATUS' => \Yii::$app->params['orderStatus']['paid']['value'],
|
|
|
':SEND_AT' => 0,
|
|
|
@@ -522,7 +522,7 @@ class ShopController extends BaseController {
|
|
|
->all();
|
|
|
|
|
|
if (!$orderList) {
|
|
|
- LoggerTool::info(['推送wst系统终止,原因:无订单', $createdAtStart, $createdAtEnd]);
|
|
|
+ LoggerTool::info(['推送wst系统终止,原因:无订单', $createdAtEnd]);
|
|
|
return static::notice('推送wst系统终止,原因:无订单');
|
|
|
}
|
|
|
|
|
|
@@ -544,7 +544,8 @@ class ShopController extends BaseController {
|
|
|
|
|
|
// 更新db中订单推送成功状态
|
|
|
if (count($orderSnSuccess) > 0) {
|
|
|
- Order::updateAll(['SEND_AT' => time()], 'SN IN (:SN)', [':SN' => implode("', '", $orderSnSuccess)]);
|
|
|
+ $orderSnSuccessIds = implode("','", $orderSnSuccess);
|
|
|
+ Order::updateAll(['SEND_AT' => time()], "SN IN ('" . $orderSnSuccessIds . "')");
|
|
|
}
|
|
|
|
|
|
if (count($orderSnFailed) > 0) {
|