shish 2 лет назад
Родитель
Сommit
05814b905e

+ 17 - 9
app-hd/controllers/NoticeController.php

@@ -102,15 +102,25 @@ class NoticeController extends PublicController
             //零售采购结账通知
             if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
+                $saleId = $cg->saleId ?? 0;
+                $order = OrderClass::getById($saleId, true);
 
-                //不是预订单,并且采购人没有开批发店,则订单直接完成掉
-                if (!empty($cg)) {
+                //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
+                if (!empty($cg) && !empty($order)) {
                     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);
+                        $ghsShopId = $order->shopId ?? 0;
+                        if (getenv('YII_ENV') == 'production') {
+                            $specialList = [3, 10649, 8042];
+                        } 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) {
+                                    PurchaseClass::confirmTake($cg);
+                                }
                             }
                         }
                     }
@@ -136,8 +146,6 @@ class NoticeController extends PublicController
 
                 if (!empty($cg) && $cg->payStatus == 1) {
                     //微信通知
-                    $saleId = $cg->saleId ?? 0;
-                    $order = OrderClass::getById($saleId, true);
                     if (!empty($order)) {
                         //订单生成时唤起在线打印
                         if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'need')) {

+ 14 - 6
app-hd/controllers/PurchaseController.php

@@ -503,15 +503,23 @@ class PurchaseController extends BaseController
                 }
             }
 
-            //不是预订单,并且采购人没有开批发店,则订单直接完成掉
+            //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
             $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);
+                    $ghsShopId = $ghs['shopId'] ?? 0;
+                    if (getenv('YII_ENV') == 'production') {
+                        $specialList = [3, 10649, 8042];
+                    } 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) {
+                                PurchaseClass::confirmTake($cg);
+                            }
                         }
                     }
                 }

+ 15 - 7
biz-ghs/order/services/OrderService.php

@@ -257,14 +257,22 @@ class OrderService extends BaseService
             PurchaseService::payAfter($purchase, $payWay);
             self::payAfter($returnOrder, $payWay);
 
-            //如果不是预订单,并且客户没有开通批发店,则订单直接完成掉
+            //不是预订单,并且采购人没有开批发店,供货商不是源花汇和小明鲜花,则订单直接完成掉,有三个地方要修改,请搜索关键词zjFinish
             if (isset($returnOrder->book) && $returnOrder->book == 0) {
-                $customShop = ShopClass::getById($customShopId, true);
-                if (isset($customShop->pfShopId) && $customShop->pfShopId == 0) {
-                    $returnId = $returnOrder->id;
-                    $order = OrderClass::getById($returnId, true);
-                    if (!empty($order)) {
-                        OrderClass::confirmReach($order);
+                $ghsShopId = $ghs['shopId'] ?? 0;
+                if (getenv('YII_ENV') == 'production') {
+                    $specialList = [3, 10649, 8042];
+                } else {
+                    $specialList = [36523];
+                }
+                if (!in_array($ghsShopId, $specialList)) {
+                    $customShop = ShopClass::getById($customShopId, true);
+                    if (isset($customShop->pfShopId) && $customShop->pfShopId == 0) {
+                        $returnId = $returnOrder->id;
+                        $order = OrderClass::getById($returnId, true);
+                        if (!empty($order)) {
+                            OrderClass::confirmReach($order);
+                        }
                     }
                 }
             }