Ver Fonte

发货问题

shish há 2 anos atrás
pai
commit
5a0ea5f38e

+ 3 - 0
app-ghs/controllers/OrderController.php

@@ -58,6 +58,9 @@ class OrderController extends BaseController
         try {
             $all = OrderClass::getAllByCondition(['id' => ['in', $arr]], null, '*', null, true);
             foreach ($all as $order) {
+                if ($order->book == 1) {
+                    util::fail('有预订单,不能一起发货');
+                }
                 if ($order->mainId != $this->mainId) {
                     util::fail('不是你的订单哦');
                 }

+ 0 - 1
biz-ghs/order/classes/OrderClass.php

@@ -291,7 +291,6 @@ class OrderClass extends BaseClass
         $order->actPrice = $currentPrice;
         $order->realPrice = $currentPrice;
         $order->stockChange = 1;
-        $order->status = self::ORDER_STATUS_COMPLETE;
         $order->save();
         $bookPrice = $order->bookPrice ?? 0;
 

+ 3 - 0
biz-ghs/order/services/OrderService.php

@@ -41,6 +41,9 @@ class OrderService extends BaseService
 
     public static function arrival($order, $data)
     {
+        $params = ['fhType' => 0,'fhWl' => '','fhWlNo' => '',];
+        OrderClass::orderSend($order, $params);
+
         //product [{"productId":"3674","num":0,"price":1}]
         $product = $data['product'] ?? '';
         if (empty($product)) {

+ 0 - 1
biz-hd/purchase/classes/PurchaseClass.php

@@ -337,7 +337,6 @@ class PurchaseClass extends BaseClass
         $cg->actPrice = $currentPrice;
         $cg->realPrice = $currentPrice;
         $cg->stockChange = 1;
-        $cg->status = self::STATUS_COMPLETE;
         $cg->save();
 
         $mainId = $cg->mainId ?? 0;

+ 4 - 0
console/controllers/OrderController.php

@@ -67,6 +67,10 @@ class OrderController extends Controller
                 $transaction = $connection->beginTransaction();
                 $orderSn = $cg['orderSn'] ?? '';
                 $id = $cg['id'] ?? 0;
+                //预订单不需要自动确认收货
+                if (isset($cg['book']) && $cg['book'] == 1) {
+                    continue;
+                }
                 try {
                     $info = PurchaseClass::getById($id, true);
                     if (!empty($info)) {