shish 1 year ago
parent
commit
b8e6979a8d
1 changed files with 2 additions and 5 deletions
  1. 2 5
      app-ghs/controllers/PartController.php

+ 2 - 5
app-ghs/controllers/PartController.php

@@ -86,10 +86,7 @@ class PartController extends BaseController
         foreach ($productList as $v) {
             $bigNum = $v['bigNum'] ?? 0;
             $smallNum = $v['smallNum'] ?? 0;
-            if ($smallNum > 0) {
-                util::fail('只能拆散整扎');
-            }
-            if ($bigNum <= 0) {
+            if ($bigNum <= 0 && $smallNum <= 0) {
                 util::fail('数量不能为0');
             }
             $property = $v['property'] ?? 1;
@@ -105,7 +102,7 @@ class PartController extends BaseController
             $post['ptStyle'] = dict::getDict('ptStyle', 'ghs');
             $return = PartClass::addOrder($post);
             $transaction->commit();
-            util::success($return,'拆散成功');
+            util::success($return, '拆散成功');
         } catch (\Exception $e) {
             $transaction->rollBack();
             Yii::info("拆散失败原因:" . $e->getMessage());