|
|
@@ -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();
|
|
|
|