Преглед изворни кода

[智价云] 数据清洗采集周期配置

tangyuanwang пре 2 месеци
родитељ
комит
d33a660c6c

+ 14 - 0
app/Http/Controllers/Manager/WashConfig/ControlGoods.php

@@ -138,6 +138,13 @@ class ControlGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ControlGoodsModel->where($map)->first();
@@ -172,6 +179,13 @@ class ControlGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ControlGoodsModel->where($map)->where('id', '!=', $id)->first();

+ 14 - 0
app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php

@@ -139,6 +139,13 @@ class LowPriceGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->first();
@@ -173,6 +180,13 @@ class LowPriceGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->where('id', '!=', $id)->first();

+ 14 - 0
app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

@@ -138,6 +138,13 @@ class ViolationProduct extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'],'platform'=> $all_data['platform']];
         $data = $ViolationProductModel->where($map)->first();
@@ -172,6 +179,13 @@ class ViolationProduct extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
+        //采集信息配置
+        $sampling_cycle = request('sampling_cycle', '0');
+        $sampling_start_time = request('sampling_start_time', '');
+        $sampling_end_time = request('sampling_end_time', '');
+        $all_data['sampling_cycle'] = $sampling_cycle;
+        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
+        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'],'platform'=> $all_data['platform']];
         $data = $ViolationProductModel->where($map)->where('id', '!=', $id)->first();

+ 17 - 5
app/Models/Manager/WashConfig/ControlGoods.php

@@ -38,7 +38,13 @@ class ControlGoods extends Model
             'platform' => $data['platform'],
             'product_name' => $data['product_name'],
             'product_specs' => $data['product_specs'],
-            'store_scope'    => $data['store_scope'],
+            'store_scope'    => $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+            'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+            'category_id' => $data['category_id'],
+            'specify_responsible_person' => $data['specify_responsible_person'],
+            'sampling_cycle' => $data['sampling_cycle'],
+            'sampling_start_time' => $data['sampling_start_time'],
+            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $ControlGoods_id = $this->insertGetId($insert_data);
@@ -63,10 +69,13 @@ class ControlGoods extends Model
                 'platform' => $data['platform'],
                 'product_name' => $data['product_name'],
                 'product_specs' => $data['product_specs'],
-                'store_scope'    => $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
-                'company_scope'    => $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'store_scope'    => $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
+                'sampling_cycle' => $data['sampling_cycle'],
+                'sampling_start_time' => $data['sampling_start_time'],
+                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $ControlGoods_id = $this->insertGetId($insert_data);
@@ -109,8 +118,8 @@ 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=指定公司
+            $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'];
@@ -118,6 +127,9 @@ class ControlGoods extends Model
             $ControlGoods->company_scope = $company_scope;
             $ControlGoods->category_id = $data['category_id'];
             $ControlGoods->specify_responsible_person = $data['specify_responsible_person'];
+            $ControlGoods->sampling_cycle = $data['sampling_cycle'];
+            $ControlGoods->sampling_start_time = $data['sampling_start_time'];
+            $ControlGoods->sampling_end_time = $data['sampling_end_time'];
             $ControlGoods->update_time = time();
             $ControlGoods->save();
 

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

@@ -39,7 +39,13 @@ class LowPriceGoods extends Model
             'product_name' => $data['product_name'],
             'product_specs' => $data['product_specs'],
             'suggested_price' => $data['suggested_price'],
-            'store_scope'    => $data['store_scope'],
+            'store_scope'    =>  $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+            'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+            'category_id' => $data['category_id'],
+            'specify_responsible_person' => $data['specify_responsible_person'],
+            'sampling_cycle' => $data['sampling_cycle'],
+            'sampling_start_time' => $data['sampling_start_time'],
+            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $LowProduct_id = $this->insertGetId($insert_data);
@@ -65,10 +71,13 @@ class LowPriceGoods extends Model
                 'product_name' => $data['product_name'],
                 'product_specs' => $data['product_specs'],
                 'suggested_price' => $data['suggested_price'],
-                'store_scope'    =>  $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
-                'company_scope'    => $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'store_scope'    =>  $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
+                'sampling_cycle' => $data['sampling_cycle'],
+                'sampling_start_time' => $data['sampling_start_time'],
+                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $LowProduct_id = $this->insertGetId($insert_data);
@@ -111,8 +120,8 @@ 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=指定公司
+            $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'];
@@ -121,6 +130,9 @@ class LowPriceGoods extends Model
             $LowProduct->company_scope = $company_scope;
             $LowProduct->category_id = $data['category_id'];
             $LowProduct->specify_responsible_person = $data['specify_responsible_person'];
+            $LowProduct->sampling_cycle = $data['sampling_cycle'];
+            $LowProduct->sampling_start_time = $data['sampling_start_time'];
+            $LowProduct->sampling_end_time = $data['sampling_end_time'];
             $LowProduct->update_time = time();
             $LowProduct->save();
 

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

@@ -38,7 +38,13 @@ class ViolationProduct extends Model
             'platform' => $data['platform'],
             'product_name' => $data['product_name'],
             'product_specs' => $data['product_specs'],
-            'store_scope'    => $data['store_scope'],
+            'store_scope'    => $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+            'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+            'category_id' => $data['category_id'],
+            'specify_responsible_person' => $data['specify_responsible_person'],
+            'sampling_cycle' => $data['sampling_cycle'],
+            'sampling_start_time' => $data['sampling_start_time'],
+            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $ViolationProduct_id = $this->insertGetId($insert_data);
@@ -63,10 +69,13 @@ class ViolationProduct extends Model
                 'platform' => $data['platform'],
                 'product_name' => $data['product_name'],
                 'product_specs' => $data['product_specs'],
-                'store_scope'    => $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
-                'company_scope'    => $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'store_scope'    => $data['store_scope'] != '' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
+                'sampling_cycle' => $data['sampling_cycle'],
+                'sampling_start_time' => $data['sampling_start_time'],
+                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $ViolationProduct_id = $this->insertGetId($insert_data);
@@ -109,8 +118,8 @@ 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=指定公司
+            $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'];
@@ -118,6 +127,9 @@ class ViolationProduct extends Model
             $ViolationProduct->company_scope = $company_scope;
             $ViolationProduct->category_id = $data['category_id'];
             $ViolationProduct->specify_responsible_person = $data['specify_responsible_person'];
+            $ViolationProduct->sampling_cycle = $data['sampling_cycle'];
+            $ViolationProduct->sampling_start_time = $data['sampling_start_time'];
+            $ViolationProduct->sampling_end_time = $data['sampling_end_time'];
             $ViolationProduct->update_time = time();
             $ViolationProduct->save();