public пре 15 часа
родитељ
комит
ba69ba1a44

+ 6 - 3
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -259,6 +259,10 @@ class LowPriceGoods extends Controller
             $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' => '']);
+
         // 查询条件
         $map  = [];
         $job_page = isset($message_data['job_page']) ? $message_data['job_page'] : 1;
@@ -407,9 +411,8 @@ class LowPriceGoods extends Controller
         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, [], 60 * 60 * 24);
         // 生成唯一文件ID
         $fileId                     = make_snow_flake();
         $message_data['file_id']    = $fileId;

+ 4 - 0
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -406,6 +406,10 @@ class ViolationProduct extends Controller
         if ($result_count == 0) return json_send(['code' => 'fail', 'msg' => '没有查询到数据', 'data' => '']);
         if ($result_count > 150000) return json_send(['code' => 'fail', 'msg' => '导出数据超过15万条,请缩小导出范围后再试', 'data' => '']);
 
+        $key_name = 'ExportViolationProductJobs_' . $violation_product_where['company_id'];
+        //创建缓存
+        Cache::put($key_name, [], 60 * 60 * 24);
+
         // 生成唯一文件ID
         $fileId                     = make_snow_flake();
         $message_data['file_id']    = $fileId;