|
@@ -99,6 +99,10 @@ class LowPriceGoods extends Model
|
|
|
'shipment_province_name' => isset($data['shipment_province_name']) ? $data['shipment_province_name'] : '', // 发货省份
|
|
'shipment_province_name' => isset($data['shipment_province_name']) ? $data['shipment_province_name'] : '', // 发货省份
|
|
|
'shipment_city_id' => isset($data['shipment_city_id']) ? $data['shipment_city_id'] : '0', // 发货城市id
|
|
'shipment_city_id' => isset($data['shipment_city_id']) ? $data['shipment_city_id'] : '0', // 发货城市id
|
|
|
'shipment_city_name' => isset($data['shipment_city_name']) ? $data['shipment_city_name'] : '', // 发货城市
|
|
'shipment_city_name' => isset($data['shipment_city_name']) ? $data['shipment_city_name'] : '', // 发货城市
|
|
|
|
|
+ 'merge_city_id' => $data['merge_city_id'],
|
|
|
|
|
+ 'merge_province_id' => $data['merge_province_id'],
|
|
|
|
|
+ 'merge_city_name' => $data['merge_city_name'],
|
|
|
|
|
+ 'merge_province_name' => $data['merge_province_name'],
|
|
|
];
|
|
];
|
|
|
$LowPriceGoods_id = $this->insertGetId($insert_data);
|
|
$LowPriceGoods_id = $this->insertGetId($insert_data);
|
|
|
return $LowPriceGoods_id;
|
|
return $LowPriceGoods_id;
|
|
@@ -137,7 +141,7 @@ class LowPriceGoods extends Model
|
|
|
try {
|
|
try {
|
|
|
//执行挂网数据统计
|
|
//执行挂网数据统计
|
|
|
$data = $this->handleCountData($data);
|
|
$data = $this->handleCountData($data);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$LowPriceGoodsMemberModel = new LowPriceGoodsMemberModel();
|
|
$LowPriceGoodsMemberModel = new LowPriceGoodsMemberModel();
|
|
|
$insert_data = [
|
|
$insert_data = [
|
|
|
'company_id' => $data['company_id'],
|
|
'company_id' => $data['company_id'],
|
|
@@ -175,6 +179,10 @@ class LowPriceGoods extends Model
|
|
|
'shipment_province_name' => isset($data['shipment_province_name']) ? $data['shipment_province_name'] : '', // 发货省份
|
|
'shipment_province_name' => isset($data['shipment_province_name']) ? $data['shipment_province_name'] : '', // 发货省份
|
|
|
'shipment_city_id' => isset($data['shipment_city_id']) ? $data['shipment_city_id'] : '0', // 发货城市id
|
|
'shipment_city_id' => isset($data['shipment_city_id']) ? $data['shipment_city_id'] : '0', // 发货城市id
|
|
|
'shipment_city_name' => isset($data['shipment_city_name']) ? $data['shipment_city_name'] : '', // 发货城市
|
|
'shipment_city_name' => isset($data['shipment_city_name']) ? $data['shipment_city_name'] : '', // 发货城市
|
|
|
|
|
+ 'merge_city_id' => $data['merge_city_id'],
|
|
|
|
|
+ 'merge_province_id' => $data['merge_province_id'],
|
|
|
|
|
+ 'merge_city_name' => $data['merge_city_name'],
|
|
|
|
|
+ 'merge_province_name' => $data['merge_province_name'],
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
$LowPriceGoods_id = $this->insertGetId($insert_data);
|
|
$LowPriceGoods_id = $this->insertGetId($insert_data);
|
|
@@ -247,7 +255,7 @@ class LowPriceGoods extends Model
|
|
|
if (trim($collect_config_info) == '') return $product_data_info;
|
|
if (trim($collect_config_info) == '') return $product_data_info;
|
|
|
$collect_config_info = json_decode($collect_config_info, true); //{"sampling_cycle": "", "sampling_start_time": "", "sampling_end_time": ""}
|
|
$collect_config_info = json_decode($collect_config_info, true); //{"sampling_cycle": "", "sampling_start_time": "", "sampling_end_time": ""}
|
|
|
//采集周期
|
|
//采集周期
|
|
|
- $sampling_cycle = isset($collect_config_info['sampling_cycle']) ? explode(',',$collect_config_info['sampling_cycle']) : '';
|
|
|
|
|
|
|
+ $sampling_cycle = isset($collect_config_info['sampling_cycle']) ? explode(',', $collect_config_info['sampling_cycle']) : '';
|
|
|
//采集开始时间
|
|
//采集开始时间
|
|
|
$sampling_start_time = isset($collect_config_info['sampling_start_time']) ? $collect_config_info['sampling_start_time'] : '';
|
|
$sampling_start_time = isset($collect_config_info['sampling_start_time']) ? $collect_config_info['sampling_start_time'] : '';
|
|
|
//采集结束时间
|
|
//采集结束时间
|
|
@@ -262,11 +270,11 @@ class LowPriceGoods extends Model
|
|
|
if ($now_week == 0) {
|
|
if ($now_week == 0) {
|
|
|
$now_week = 7;
|
|
$now_week = 7;
|
|
|
}
|
|
}
|
|
|
- if(!in_array($now_week, $sampling_cycle)){
|
|
|
|
|
|
|
+ if (!in_array($now_week, $sampling_cycle)) {
|
|
|
return $product_data_info;
|
|
return $product_data_info;
|
|
|
}
|
|
}
|
|
|
//查询当前商品是否在上一个周期采集中过
|
|
//查询当前商品是否在上一个周期采集中过
|
|
|
- $up_scrape_date_time = $collection_time - 7 * 24 * 3600;//查询上周这个时间点
|
|
|
|
|
|
|
+ $up_scrape_date_time = $collection_time - 7 * 24 * 3600; //查询上周这个时间点
|
|
|
$up_scrape_date = date('Y-m-d', $up_scrape_date_time);
|
|
$up_scrape_date = date('Y-m-d', $up_scrape_date_time);
|
|
|
$source_last_week_where[] = ['company_id', '=', $product_data_info['company_id']]; //品牌方公司ID
|
|
$source_last_week_where[] = ['company_id', '=', $product_data_info['company_id']]; //品牌方公司ID
|
|
|
$source_last_week_where[] = ['platform', '=', $product_data_info['platform']]; //挂网平台ID
|
|
$source_last_week_where[] = ['platform', '=', $product_data_info['platform']]; //挂网平台ID
|
|
@@ -300,11 +308,11 @@ class LowPriceGoods extends Model
|
|
|
if ($now_week == 0) {
|
|
if ($now_week == 0) {
|
|
|
$now_week = 7;
|
|
$now_week = 7;
|
|
|
}
|
|
}
|
|
|
- if(!in_array($now_week, $sampling_cycle)){
|
|
|
|
|
|
|
+ if (!in_array($now_week, $sampling_cycle)) {
|
|
|
return $product_data_info;
|
|
return $product_data_info;
|
|
|
}
|
|
}
|
|
|
//查询当前商品是否在上一个周期采集中过
|
|
//查询当前商品是否在上一个周期采集中过
|
|
|
- $up_scrape_date_time = $collection_time - 7 * 24 * 3600;//查询上周这个时间点
|
|
|
|
|
|
|
+ $up_scrape_date_time = $collection_time - 7 * 24 * 3600; //查询上周这个时间点
|
|
|
//查询当前商品上次采集记录
|
|
//查询当前商品上次采集记录
|
|
|
$up_scrape_date = date('Y-m-d', $up_scrape_date_time);
|
|
$up_scrape_date = date('Y-m-d', $up_scrape_date_time);
|
|
|
$source_last_week_where[] = ['company_id', '=', $product_data_info['company_id']]; //品牌方公司ID
|
|
$source_last_week_where[] = ['company_id', '=', $product_data_info['company_id']]; //品牌方公司ID
|