重复车架处理调试16

master
zcstatham 2 years ago
parent 5b6c5663f8
commit 2e83404796
  1. 1
      app/controller/Task.php
  2. 1
      app/view/task/index.html
  3. 21
      extend/service/CarInfoHandle.php

@ -293,6 +293,7 @@ class Task extends BaseController
'5'=>'carInfoUpdate',
'6'=>'deletePeerPhones',
'7'=>'deleteCarFrameNo',
'8'=>'exportRepeatData',
];
$id = Queue::push(
'app\jobs\DelayQueue',

@ -242,6 +242,7 @@
<a class="layui-btn layui-btn-xs" href="/index/index.html?is_update_bhx={{d.id}}">查看</a>
{{# }else if(d.type == 7){ }}
<a class="layui-btn layui-btn-xs" href="/repeat/index.html?is_delete_frame={{d.id}}">查看</a>
<button type="button" class="layui-btn layui-btn-xs" onclick="task_create(8,{{d.id}})">导出</button>
{{# }else if(d.type == 1){ }}
<a class="layui-btn layui-btn-xs" href="/index/index.html?source={{d.id}}">查看</a>
{{# } }}

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

Loading…
Cancel
Save