Kaynağa Gözat

取消订单情况

shish 3 yıl önce
ebeveyn
işleme
c313c83176
1 değiştirilmiş dosya ile 2 ekleme ve 14 silme
  1. 2 14
      app-hd/controllers/MtController.php

+ 2 - 14
app-hd/controllers/MtController.php

@@ -527,28 +527,16 @@ class MtController extends PublicController
         //只要制作单没有完成,则走取消订单流程。如果有制作单完成,则订单状态和制作单暂时先不管,后面要兼容。
         $orderId = $order->id ?? 0;
         $workList = WorkClass::getAllByCondition(['orderId' => $orderId], null, '*', null, true);
-        $hasCompleteWork = false;
         if (!empty($workList)) {
             foreach ($workList as $work) {
-                if ($work->status == 1) {
-                    $hasCompleteWork = true;
-                }
-            }
-        }
-
-        //取消订单和制作单
-        if ($hasCompleteWork == false) {
-            $order->status = 5;
-            $order->save();
-            if (!empty($workList)) {
-                foreach ($workList as $work) {
+                if ($work->status == 0) {
                     $work->status = 2;
                     $work->save();
                 }
             }
         }
+        //订单取消,金额全部退还
 
-        //如果制作单完成了还会出现取消订单情况,这个等于全部退款,这个后面再考虑兼容!!!!!
 
         //制作单取消通知
         $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);