Kaynağa Gözat

更新最后下单时间

shish 2 yıl önce
ebeveyn
işleme
c37cd52b50

+ 14 - 0
app-ghs/controllers/OrderController.php

@@ -4,6 +4,7 @@ namespace ghs\controllers;
 
 use biz\shop\classes\ShopExtClass;
 use bizGhs\express\services\DadaExpressServices;
+use bizGhs\ghs\classes\GhsClass;
 use bizHd\purchase\classes\PurchaseClass;
 use bizHd\purchase\services\PurchaseService;
 use bizHd\wx\classes\WxOpenClass;
@@ -1053,6 +1054,19 @@ class OrderController extends BaseController
             $order = OrderClass::getById($saleId, true);
             if (!empty($order)) {
                 $shopId = $order->shopId ?? 0;
+                $customId = $order->customId ?? 0;
+                $ghsId = $order->ghsId ?? 0;
+                $custom = CustomClass::getById($customId, true);
+                $date = date("Y-m-d H:i:s");
+                if (!empty($custom)) {
+                    $custom->recentExpend = $date;
+                    $custom->save();
+                }
+                $ghs = GhsClass::getById($ghsId, true);
+                if (!empty($ghs)) {
+                    $ghs->recentExpend = $date;
+                    $ghs->save();
+                }
                 $shop = ShopClass::getById($shopId, true);
                 if (isset($order->payStatus) && $order->payStatus == 1) {
                     if (!empty($shop)) {

+ 15 - 0
app-hd/controllers/NoticeController.php

@@ -371,6 +371,21 @@ class NoticeController extends PublicController
                     }
                 }
 
+                //更新最后下单时间
+                $customId = $order->customId ?? 0;
+                $custom = CustomClass::getById($customId, true);
+                $date = date("Y-m-d H:i:s");
+                if (!empty($custom)) {
+                    $custom->recentExpend = $date;
+                    $custom->save();
+                }
+                $ghsId = $order->ghsId ?? 0;
+                $ghs = GhsClass::getById($ghsId, true);
+                if (!empty($ghs)) {
+                    $ghs->recentExpend = $date;
+                    $ghs->save();
+                }
+
                 if (isset($cg->localOrder) && $cg->localOrder == 1) {
                     if ($cg->transType != 5 && $cg->transType != 4) {
                         //昆明发货,客户算了一次打包费和运费,第二次就不再算了