|
@@ -59,16 +59,23 @@ class Product extends Model
|
|
|
*/
|
|
*/
|
|
|
public function addProduct_content($data)
|
|
public function addProduct_content($data)
|
|
|
{
|
|
{
|
|
|
|
|
+ // 计算品规数量
|
|
|
|
|
+ $product_specs_data = isset($data['product_specs']) && $data['product_specs'] != '' ? explode(',', $data['product_specs']) : '';
|
|
|
|
|
+ //移除数组内空值
|
|
|
|
|
+ $product_specs_data = !empty($product_specs_data) ? array_filter($product_specs_data) : '';
|
|
|
$insert_data = [
|
|
$insert_data = [
|
|
|
'enable_full_quantity' => isset($data['enable_full_quantity']) ? $data['enable_full_quantity'] : 0,
|
|
'enable_full_quantity' => isset($data['enable_full_quantity']) ? $data['enable_full_quantity'] : 0,
|
|
|
'platform' => $data['platform'],
|
|
'platform' => $data['platform'],
|
|
|
|
|
+ 'product_brand' => $data['product_brand'],
|
|
|
'product_name' => $data['product_name'],
|
|
'product_name' => $data['product_name'],
|
|
|
'product_specs' => $data['product_specs'],
|
|
'product_specs' => $data['product_specs'],
|
|
|
|
|
+ 'product_specs_number' => $data['product_specs'] ? count($product_specs_data) : 1,
|
|
|
'minimum_order_quantity' => $data['minimum_order_quantity'],
|
|
'minimum_order_quantity' => $data['minimum_order_quantity'],
|
|
|
'sampling_cycle' => $data['sampling_cycle'],
|
|
'sampling_cycle' => $data['sampling_cycle'],
|
|
|
|
|
+ 'round_number' => $data['round_number'],
|
|
|
'sampling_start_time' => $data['sampling_start_time'],
|
|
'sampling_start_time' => $data['sampling_start_time'],
|
|
|
'sampling_end_time' => $data['sampling_end_time'],
|
|
'sampling_end_time' => $data['sampling_end_time'],
|
|
|
- 'product_brand' => $data['product_brand'],
|
|
|
|
|
|
|
+ 'company_id' => $data['company_id'],
|
|
|
'insert_time' => time(),
|
|
'insert_time' => time(),
|
|
|
];
|
|
];
|
|
|
$Product_id = $this->insertGetId($insert_data);
|
|
$Product_id = $this->insertGetId($insert_data);
|
|
@@ -111,6 +118,7 @@ class Product extends Model
|
|
|
'product_specs_number' => $data['product_specs'] ? count($product_specs_data) : 1,
|
|
'product_specs_number' => $data['product_specs'] ? count($product_specs_data) : 1,
|
|
|
'minimum_order_quantity' => $data['minimum_order_quantity'],
|
|
'minimum_order_quantity' => $data['minimum_order_quantity'],
|
|
|
'sampling_cycle' => $data['sampling_cycle'],
|
|
'sampling_cycle' => $data['sampling_cycle'],
|
|
|
|
|
+ 'round_number' => $data['round_number'],
|
|
|
'sampling_start_time' => $data['sampling_start_time'],
|
|
'sampling_start_time' => $data['sampling_start_time'],
|
|
|
'sampling_end_time' => $data['sampling_end_time'],
|
|
'sampling_end_time' => $data['sampling_end_time'],
|
|
|
'company_id' => $data['company_id'],
|
|
'company_id' => $data['company_id'],
|
|
@@ -168,6 +176,7 @@ class Product extends Model
|
|
|
$Product->product_specs_number = $product_specs_data ? count($product_specs_data) : 1;
|
|
$Product->product_specs_number = $product_specs_data ? count($product_specs_data) : 1;
|
|
|
$Product->minimum_order_quantity = $data['minimum_order_quantity'];
|
|
$Product->minimum_order_quantity = $data['minimum_order_quantity'];
|
|
|
$Product->sampling_cycle = $data['sampling_cycle'];
|
|
$Product->sampling_cycle = $data['sampling_cycle'];
|
|
|
|
|
+ $Product->round_number = $data['round_number'];
|
|
|
$Product->sampling_start_time = $data['sampling_start_time'];
|
|
$Product->sampling_start_time = $data['sampling_start_time'];
|
|
|
$Product->sampling_end_time = $data['sampling_end_time'];
|
|
$Product->sampling_end_time = $data['sampling_end_time'];
|
|
|
$Product->update_time = time();
|
|
$Product->update_time = time();
|