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'];