Browse Source

取消通知美团拣货完成

shish 4 years ago
parent
commit
dceb8afc6f
1 changed files with 0 additions and 31 deletions
  1. 0 31
      biz-hd/work/classes/WorkClass.php

+ 0 - 31
biz-hd/work/classes/WorkClass.php

@@ -314,37 +314,6 @@ class WorkClass extends BaseClass
         $staffName = $work->staffName ?? '';
         OrderGoodsClass::addGoodsStockByMakeGoods($workSn, $sjId, $shopId, $mainId, $goodsId, $num, $staffName);
 
-        $orderId = $work->orderId ?? 0;
-        if (!empty($orderId)) {
-            $allWork = WorkClass::getAllByCondition(['orderId' => $orderId], null, '*', null, true);
-            //订单下如果还有制作单未完成,则不通知美图已经完成拣货
-            if (!empty($allWork)) {
-                $allComplete = true;
-                foreach ($allWork as $current) {
-                    if ($current->status != 1) {
-                        $allComplete = false;
-                    }
-                }
-                if ($allComplete == false) {
-                    return false;
-                }
-            }
-            $order = OrderClass::getById($orderId, true);
-            $thirdOrderId = $order->thirdOrderId ?? '';
-            $fromType = $order->fromType ?? 0;
-            //如果已经授权给开通美团
-            if ($fromType == dict::getDict('fromType', 'mt')) {
-                $config = dict::getDict('mtConfig');
-                $app = new Application($config);
-                $params = ['order_id' => $thirdOrderId, 'access_token' => 'token_pOgHs0-h06JUsIrMJ3ZKyQ'];
-                $mtRes = $app->order->preparationMealComplete($params);
-
-                $mtRes = json_decode($mtRes, true);
-                if (isset($mtRes['data']) && $mtRes['data'] == 'ng') {
-                    util::fail($mtRes['msg']);
-                }
-            }
-        }
     }
 
     //验证制作单 ssh 20220319