Parcourir la source

确认发货时完成掉

shish il y a 2 ans
Parent
commit
e06f4e6623

+ 2 - 2
app-hd/controllers/NoticeController.php

@@ -122,7 +122,7 @@ class NoticeController extends PublicController
                 $saleId = $cg->saleId ?? 0;
                 $order = OrderClass::getById($saleId, true);
 
-                //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
+                //不是预订单,并且采购人没有开批发店,供货商不是源花汇、小明鲜花、淄博花超、石头花艺,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;
@@ -304,7 +304,7 @@ class NoticeController extends PublicController
                 $saleId = $cg->saleId ?? 0;
                 $order = OrderClass::getById($saleId, true);
 
-                //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
+                //不是预订单,并且采购人没有开批发店,供货商不是源花汇、小明鲜花、淄博花超、石头花艺,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;

+ 1 - 1
app-hd/controllers/PurchaseController.php

@@ -513,7 +513,7 @@ class PurchaseController extends BaseController
                 }
             }
 
-            //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
+            //不是预订单,并且采购人没有开批发店,供货商不是源花汇、小明鲜花、淄博花超、石头花艺,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
             $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
             if (!empty($cg)) {
                 if (isset($cg->book) && $cg->book == 0) {

+ 23 - 2
biz-ghs/order/services/OrderService.php

@@ -125,6 +125,27 @@ class OrderService extends BaseService
                 $saleRefund->save();
             }
         }
+
+        //不是预订单,并且采购人没有开批发店,供货商不是源花汇、小明鲜花、淄博花超、石头花艺,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
+        if (!empty($cg) && !empty($order)) {
+            $ghsShopId = $order->shopId ?? 0;
+            if (getenv('YII_ENV') == 'production') {
+                $specialList = [3, 10649, 8042, 16454];
+            } else {
+                $specialList = [36523];
+            }
+            if (!in_array($ghsShopId, $specialList)) {
+                $cgShopId = $cg->shopId ?? 0;
+                $cgShop = ShopClass::getById($cgShopId, true);
+                if (!empty($cgShop)) {
+                    if (isset($cgShop->pfShopId) && $cgShop->pfShopId == 0) {
+                        $newCg = PurchaseClass::getById($cgId, true);
+                        PurchaseClass::confirmTake($newCg);
+                    }
+                }
+            }
+        }
+
     }
 
     //添加订单
@@ -257,11 +278,11 @@ class OrderService extends BaseService
             PurchaseService::payAfter($purchase, $payWay);
             self::payAfter($returnOrder, $payWay);
 
-            //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
+            //不是预订单,并且采购人没有开批发店,供货商不是源花汇、小明鲜花、淄博花超、石头花艺,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
             if (isset($returnOrder->book) && $returnOrder->book == 0) {
                 $ghsShopId = $ghs['shopId'] ?? 0;
                 if (getenv('YII_ENV') == 'production') {
-                    $specialList = [3, 10649, 8042,16454];
+                    $specialList = [3, 10649, 8042, 16454];
                 } else {
                     $specialList = [36523];
                 }