|
@@ -269,7 +269,7 @@ class LowPriceGoods extends Controller
|
|
|
$message_data['shipment_city_ids'] = request('shipment_city_ids', '');
|
|
$message_data['shipment_city_ids'] = request('shipment_city_ids', '');
|
|
|
$message_data['product_brand'] = request('product_brand', '');
|
|
$message_data['product_brand'] = request('product_brand', '');
|
|
|
$message_data['collection_time_start_time'] = request('collection_time_start_time', '');
|
|
$message_data['collection_time_start_time'] = request('collection_time_start_time', '');
|
|
|
- $message_data['collection_time_end_time'] = request('product_brand', '');
|
|
|
|
|
|
|
+ $message_data['collection_time_end_time'] = request('collection_time_end_time', '');
|
|
|
|
|
|
|
|
$low_price_goods_where = [];
|
|
$low_price_goods_where = [];
|
|
|
// 权限判断
|
|
// 权限判断
|
|
@@ -278,12 +278,6 @@ class LowPriceGoods extends Controller
|
|
|
} else {
|
|
} else {
|
|
|
$low_price_goods_where['company_id'] = $message_data['admin_company_id'];
|
|
$low_price_goods_where['company_id'] = $message_data['admin_company_id'];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $key_name = 'ExportLowPriceGoodsJobs_' . $low_price_goods_where['company_id'];
|
|
|
|
|
- $export_data_info = Cache::get($key_name);
|
|
|
|
|
- if ($export_data_info) return json_send(['code' => 'fail', 'msg' => '导出任务正在执行中,请稍后再试', 'data' => '']);
|
|
|
|
|
- //创建缓存
|
|
|
|
|
- Cache::put($key_name,'1', 60 * 60 * 3);
|
|
|
|
|
// 查询条件
|
|
// 查询条件
|
|
|
$map = [];
|
|
$map = [];
|
|
|
$job_page = isset($message_data['job_page']) ? $message_data['job_page'] : 1;
|
|
$job_page = isset($message_data['job_page']) ? $message_data['job_page'] : 1;
|
|
@@ -447,14 +441,20 @@ class LowPriceGoods extends Controller
|
|
|
if ($result_count == 0) return json_send(['code' => 'fail', 'msg' => '没有查询到数据', 'data' => '']);
|
|
if ($result_count == 0) return json_send(['code' => 'fail', 'msg' => '没有查询到数据', 'data' => '']);
|
|
|
if ($result_count > 150000) return json_send(['code' => 'fail', 'msg' => '导出数据超过15万条,请缩小导出范围后再试', 'data' => '']);
|
|
if ($result_count > 150000) return json_send(['code' => 'fail', 'msg' => '导出数据超过15万条,请缩小导出范围后再试', 'data' => '']);
|
|
|
|
|
|
|
|
|
|
+ $key_name = 'ExportLowPriceGoodsJobs_' . $low_price_goods_where['company_id'];
|
|
|
|
|
+ $export_data_info = Cache::get($key_name);
|
|
|
|
|
+ if ($export_data_info) return json_send(['code' => 'fail', 'msg' => '导出任务正在执行中,请稍后再试', 'data' => '']);
|
|
|
|
|
+ //创建缓存
|
|
|
|
|
+ Cache::put($key_name,'1', 60 * 60 * 3);
|
|
|
|
|
+
|
|
|
// 生成唯一文件ID
|
|
// 生成唯一文件ID
|
|
|
$fileId = make_snow_flake();
|
|
$fileId = make_snow_flake();
|
|
|
$message_data['file_id'] = $fileId;
|
|
$message_data['file_id'] = $fileId;
|
|
|
$fileName = '低价挂网商品数据' . $fileId . '.xlsx';
|
|
$fileName = '低价挂网商品数据' . $fileId . '.xlsx';
|
|
|
$message_data['company_id'] = $low_price_goods_where['company_id'];
|
|
$message_data['company_id'] = $low_price_goods_where['company_id'];
|
|
|
$message_data['user_id'] = $message_data['user_id'];
|
|
$message_data['user_id'] = $message_data['user_id'];
|
|
|
- ExportLowPriceGoodsJobs::dispatch($message_data);
|
|
|
|
|
- // ExportLowPriceGoodsJobs::dispatchSync($message_data);
|
|
|
|
|
|
|
+ // ExportLowPriceGoodsJobs::dispatch($message_data);
|
|
|
|
|
+ ExportLowPriceGoodsJobs::dispatchSync($message_data);
|
|
|
return json_send(['code' => 'success', 'msg' => '导出任务添加成功', 'data' => ['file_id' => $fileId, 'file_name' => $fileName]]);
|
|
return json_send(['code' => 'success', 'msg' => '导出任务添加成功', 'data' => ['file_id' => $fileId, 'file_name' => $fileName]]);
|
|
|
}
|
|
}
|
|
|
|
|
|