From 2e834047967137f24552beae2cc7660b115f94cd Mon Sep 17 00:00:00 2001
From: zcstatham <578322713@qq.com>
Date: Mon, 12 Sep 2022 23:36:23 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=BD=A6=E6=9E=B6=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E8=B0=83=E8=AF=9516?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controller/Task.php | 1 +
app/view/task/index.html | 1 +
extend/service/CarInfoHandle.php | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+)
diff --git a/app/controller/Task.php b/app/controller/Task.php
index a3d4d48..ca2b132 100644
--- a/app/controller/Task.php
+++ b/app/controller/Task.php
@@ -293,6 +293,7 @@ class Task extends BaseController
'5'=>'carInfoUpdate',
'6'=>'deletePeerPhones',
'7'=>'deleteCarFrameNo',
+ '8'=>'exportRepeatData',
];
$id = Queue::push(
'app\jobs\DelayQueue',
diff --git a/app/view/task/index.html b/app/view/task/index.html
index f790b64..4e8fcf9 100644
--- a/app/view/task/index.html
+++ b/app/view/task/index.html
@@ -242,6 +242,7 @@
查看
{{# }else if(d.type == 7){ }}
查看
+
{{# }else if(d.type == 1){ }}
查看
{{# } }}
diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php
index d73686c..ed81253 100644
--- a/extend/service/CarInfoHandle.php
+++ b/extend/service/CarInfoHandle.php
@@ -447,6 +447,27 @@ class CarInfoHandle
return '处理总数:' . $count . ', 删除总数:' . $delete_num . ', 失败总数:' . $faild_num;
}
+ public function exportRepeatData($data, $id)
+ {
+ $query = RepeatDataT::alias('car_info_t')->where('repeat_id', $data['source_id']);
+ $count = $query->count();
+ $count = $count <= $data['export_limit'] || $data['export_limit'] == 0 ? $count : $data['export_limit'];
+ echo '总计:' . $count . PHP_EOL;
+ cache('shell_process_' . $id, 0, 300);
+ $data['export_field'] = $data['export_field'] ?? [];
+ list($titles, $fields) = $this->getTitleAndField($data['export_type'], $data['export_field']);
+ if (isset($data['is_excel']) && $data['is_excel'] == 'yes') {
+ $basename = '/export/' . date('YmdHis') . '.xlsx';
+ $this->exportExcel($data['export_type'], $data['export_limit'], $titles, $fields, root_path() . 'public' . $basename, $query, $count, $id);
+ } else {
+ $basename = '/export/' . date('YmdHis') . '.csv';
+ $this->exportCsv($data['export_type'], $data['export_limit'], $titles, $fields, root_path() . 'public' . $basename, $query, $count, $id);
+ }
+ $this->setProcess($count, $count, $id);
+ $this->addExportLog($count, $data['export_type'],$id);
+ return $basename;
+ }
+
public function carInfoUpdate($data, $id)
{
$filename = public_path('public/storage') . $data['filename'];