shish 2 năm trước cách đây
mục cha
commit
bbe27d1f07
1 tập tin đã thay đổi với 14 bổ sung12 xóa
  1. 14 12
      app-hd/controllers/ProductController.php

+ 14 - 12
app-hd/controllers/ProductController.php

@@ -229,18 +229,20 @@ class ProductController extends BaseController
         $transaction = $connection->beginTransaction();
         try {
 
-            $cg = PurchaseClass::getLockById($targetId);
-            if (!empty($cg)) {
-                if (isset($cg->mainId) == false || $cg->mainId != $this->mainId) {
-                    util::fail('不是您的采购单');
-                }
-                //没有发货则先发货
-                if ($cg->status == PurchaseClass::STATUS_UN_SEND) {
-                    $cg = PurchaseClass::orderSend($cg, [], true);
-                }
-                //确认收货并入库
-                if ($cg->status == PurchaseClass::STATUS_SENDING) {
-                    PurchaseClass::takeToPutIn($cg);
+            if (!empty($targetId)) {
+                $cg = PurchaseClass::getLockById($targetId);
+                if (!empty($cg)) {
+                    if (isset($cg->mainId) == false || $cg->mainId != $this->mainId) {
+                        util::fail('不是您的采购单');
+                    }
+                    //没有发货则先发货
+                    if ($cg->status == PurchaseClass::STATUS_UN_SEND) {
+                        $cg = PurchaseClass::orderSend($cg, [], true);
+                    }
+                    //确认收货并入库
+                    if ($cg->status == PurchaseClass::STATUS_SENDING) {
+                        PurchaseClass::takeToPutIn($cg);
+                    }
                 }
             }