cqpCow 1 gadu atpakaļ
vecāks
revīzija
9034946c74
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  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, ''];
     }
 }