cqpCow 1 年之前
父節點
當前提交
9034946c74
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      app/Service/ProductInventoryService.php

+ 8 - 0
app/Service/ProductInventoryService.php

@@ -383,6 +383,14 @@ class ProductInventoryService extends Service
                 ->update(['param_two' => $data['param_two']]);
         }
 
+        if(isset($data['param_three'])){
+            $res = $this->checkNumber($data['param_three']);
+            if(! $res) return [false, '比例请输入不超过两位小数并且大于0的数值'];
+            if($data['param_three'] < 3) return [false,'比例不能小于3%'];
+            ProductInventorySet::where('id',$data['id'])
+                ->update(['param_three' => $data['param_three']]);
+        }
+
         return [true, ''];
     }
 }