重复车架处理调试11

master
zcstatham 2 years ago
parent 732c8358ee
commit f43932290e
  1. 19
      app/controller/Task.php

@ -426,6 +426,8 @@ class Task extends BaseController
$name = '导出未处理至上传'; $name = '导出未处理至上传';
} else if ($type == 'success_bmc') { } else if ($type == 'success_bmc') {
$name = '导出清洗成功再次清洗'; $name = '导出清洗成功再次清洗';
} else if ($type == 'repeat_delete') {
$name = '导出重复删除车架';
} }
$count = ExportLogT::where('name','like', $name . $export_date1 . '—' . $export_date2 . '%')->count(); $count = ExportLogT::where('name','like', $name . $export_date1 . '—' . $export_date2 . '%')->count();
$name .= $export_date1 . '—' . $export_date2 . '第' . ($count + 1) . '批' . $export_limit . '条'; $name .= $export_date1 . '—' . $export_date2 . '第' . ($count + 1) . '批' . $export_limit . '条';
@ -569,11 +571,18 @@ class Task extends BaseController
if(count($map_or2) > 0){ if(count($map_or2) > 0){
$map_or2 = array_merge([['car_info_t.insurer1_date', '=', ''],['car_info_t.insurer2_date', '<>', '']],$map_or2); $map_or2 = array_merge([['car_info_t.insurer1_date', '=', ''],['car_info_t.insurer2_date', '<>', '']],$map_or2);
} }
$query = CarInfoT::where($where)->where(function ($query) use ($map_or1, $map_or2) { if($params['export_type'] == 'repeat_delete')
if (count($map_or1) > 0 && count($map_or2) > 0){ $query = Db::table('repeat_data_t')->alias('car_info_t')->where($where)->where(function ($query) use ($map_or1, $map_or2) {
$query->whereOr([$map_or1, $map_or2]); if (count($map_or1) > 0 && count($map_or2) > 0){
} $query->whereOr([$map_or1, $map_or2]);
}); }
});
else
$query = CarInfoT::where($where)->where(function ($query) use ($map_or1, $map_or2) {
if (count($map_or1) > 0 && count($map_or2) > 0){
$query->whereOr([$map_or1, $map_or2]);
}
});
$this->json_data['data'] = $query->count(); $this->json_data['data'] = $query->count();
$this->json_data['sql'] = CarInfoT::getLastSql(); $this->json_data['sql'] = CarInfoT::getLastSql();
return json($this->json_data); return json($this->json_data);

Loading…
Cancel
Save