Parcourir la source

不是预订单,并且采购人没有开批发店,则订单直接完成掉

shish il y a 2 ans
Parent
commit
7501908463
1 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. 13 0
      app-hd/controllers/NoticeController.php

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

@@ -103,6 +103,19 @@ class NoticeController extends PublicController
             if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
 
+                //不是预订单,并且采购人没有开批发店,则订单直接完成掉
+                if (!empty($cg)) {
+                    if (isset($cg->book) && $cg->book == 0) {
+                        $cgShopId = $cg->shopId ?? 0;
+                        $cgShop = ShopClass::getById($cgShopId, true);
+                        if (!empty($cgShop)) {
+                            if (isset($cgShop->pfShopId) && $cgShop->pfShopId == 0) {
+                                PurchaseClass::confirmTake($cg);
+                            }
+                        }
+                    }
+                }
+
                 if (isset($cg->localOrder) && $cg->localOrder == 1) {
                     if ($cg->transType != 5 && $cg->transType != 4) {
                         //昆明发货,客户算了一次打包费和运费,第二次就不再算了