|
|
@@ -218,7 +218,7 @@ class ViolationProduct extends Controller
|
|
|
* @version 1.0
|
|
|
* @date 2025-06-17
|
|
|
*/
|
|
|
- public function export_excel(Request $request, DownloadTaskModel $DownloadTaskModel,ViolationProductModel $ViolationProductModel, EmployeeModel $EmployeeModel, ViolationProductMemberModel $ViolationProductMemberModel)
|
|
|
+ public function export_excel(Request $request,ViolationProductModel $ViolationProductModel)
|
|
|
{
|
|
|
$request->scene('export_excel')->validate();
|
|
|
$message_data['admin_company_id'] = request('admin_company_id', '0');
|
|
|
@@ -263,11 +263,10 @@ class ViolationProduct extends Controller
|
|
|
if ($export_data_info) return json_send(['code' => 'fail', 'msg' => '导出任务正在执行中,请稍后再试', 'data' => '']);
|
|
|
|
|
|
|
|
|
- $admin_company_id = $message_data['admin_company_id'] ?? '0';
|
|
|
+ $admin_company_id = $message_data['admin_company_id'] ?? '0';
|
|
|
$company_id = $message_data['access_token']['company_id'] ?? '0';
|
|
|
$is_admin = $message_data['access_token']['is_admin'] ?? '0'; //是否管理员操作 0=是1=否
|
|
|
$user_id = $message_data['access_token']['uid'] ?? 0;
|
|
|
- $file_id = $message_data['file_id'];
|
|
|
// 查询条件
|
|
|
$map = [];
|
|
|
$status = $message_data['status'] ?? '';
|
|
|
@@ -411,17 +410,8 @@ class ViolationProduct extends Controller
|
|
|
$fileId = make_snow_flake();
|
|
|
$message_data['file_id'] = $fileId;
|
|
|
$fileName = '禁止挂网商品数据' . $fileId . '.xlsx';
|
|
|
- $downloadLog = [
|
|
|
- 'insert_time' => time(),
|
|
|
- 'company_id' => $violation_product_where['company_id'],
|
|
|
- 'operator_userid' => $message_data['user_id'],
|
|
|
- 'file_name' => $fileName,
|
|
|
- 'file_id' => $fileId,
|
|
|
- 'url' => '',
|
|
|
- ];
|
|
|
- // 写入数据表
|
|
|
- $result = $DownloadTaskModel->insertGetId($downloadLog);
|
|
|
- if(!$result) return json_send(['code' => 'fail', 'msg' => '导出任务添加失败', 'data' => '']);
|
|
|
+ $message_data['company_id'] = $violation_product_where['company_id'];
|
|
|
+ $message_data['user_id'] = $message_data['user_id'];
|
|
|
ExportViolationProductJobs::dispatch($message_data);
|
|
|
// ExportViolationProductJobs::dispatchSync($message_data);
|
|
|
return json_send(['code' => 'success', 'msg' => '导出任务添加成功', 'data' => ['file_id' => $fileId, 'file_name' => $fileName]]);
|