Răsfoiți Sursa

【智价云】 编辑数据清洗配置更新2

public 1 zi în urmă
părinte
comite
1c01d31445

+ 4 - 2
app/Models/Manager/WashConfig/ControlGoods.php

@@ -107,11 +107,13 @@ class ControlGoods extends Model
         DB::beginTransaction();
         try {
             $ControlGoodsCompanyModel = new ControlGoodsCompanyModel();
+            $store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
+            $company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
             $ControlGoods->platform = $data['platform'];
             $ControlGoods->product_name = $data['product_name'];
             $ControlGoods->product_specs = $data['product_specs'];
-            $ControlGoods->store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
-            $ControlGoods->company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
+            $ControlGoods->store_scope = $store_scope;
+            $ControlGoods->company_scope = $company_scope;
             $ControlGoods->update_time = time();
             $ControlGoods->save();
 

+ 5 - 3
app/Models/Manager/WashConfig/LowPriceGoods.php

@@ -109,17 +109,19 @@ class LowPriceGoods extends Model
         DB::beginTransaction();
         try {
             $LowPriceGoodsCompanyModel = new LowPriceGoodsCompanyModel();
+            $store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
+            $company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
             $LowProduct->platform = $data['platform'];
             $LowProduct->product_name = $data['product_name'];
             $LowProduct->product_specs = $data['product_specs'];
             $LowProduct->suggested_price = $data['suggested_price'];
-            $LowProduct->store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
-            $LowProduct->company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
+            $LowProduct->store_scope = $store_scope;
+            $LowProduct->company_scope = $company_scope;
             $LowProduct->update_time = time();
             $LowProduct->save();
 
             $LowPriceGoodsCompanyModel->where('lowprice_product_logid', $LowProduct->id)->delete();
-            if ($LowProduct->company_scop == 2) {
+            if ($company_scope == 2) {
                 $insert_company_data = [];
                 $company_scope = explode(',', $data['company_scope']);
                 foreach ($company_scope as $company_id) {

+ 5 - 3
app/Models/Manager/WashConfig/ViolationProduct.php

@@ -107,16 +107,18 @@ class ViolationProduct extends Model
         DB::beginTransaction();
         try {
             $ViolationProductCompanyModel = new ViolationProductCompanyModel();
+            $store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
+            $company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
             $ViolationProduct->platform = $data['platform'];
             $ViolationProduct->product_name = $data['product_name'];
             $ViolationProduct->product_specs = $data['product_specs'];
-            $ViolationProduct->store_scope = $data['store_scope'] !='' ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
-            $ViolationProduct->company_scope = $data['company_scope'] !='' ? 2 : 1; //公司范围1=全部公司 2=指定公司
+            $ViolationProduct->store_scope = $store_scope;
+            $ViolationProduct->company_scope = $company_scope;
             $ViolationProduct->update_time = time();
             $ViolationProduct->save();
 
             $ViolationProductCompanyModel->where('violation_product_logid', $ViolationProduct->id)->delete();
-            if ($ViolationProduct->company_scope == 2) {
+            if ($company_scope == 2) {
                 $insert_company_data = [];
                 $company_scope = explode(',', $data['company_scope']);
                 foreach ($company_scope as $company_id) {