电话导出调试6

master
zcstatham 2 years ago
parent 101c6df595
commit 8c30bd5125
  1. 16
      extend/service/CarInfoHandle.php

@ -149,16 +149,16 @@ class CarInfoHandle
if ($data['export_type'] == 'repeat') {
if ($data['export_table'] == 'repeat_frame_t') {
$query = RepeatFrameT::leftjoin('car_info_t', 'repeat_frame_t.car_frame_no = car_info_t.car_frame_no')
->field('car_info_t.*')->order('car_info_t.register_date asc')
->field('car_info_t.*')->order('car_info_t.id asc')
->where('repeat_frame_t.source', $data['source_id']);
} else if ($data['export_table'] == 'peer_phone_t') {
$query = $query->rightJoin('peer_phone_t', 'peer_phone_t.phone = car_info_t.car_phone')
->where('peer_phone_t.source', $data['source_id'])
->where('car_info_t.car_number', 'REGEXP', '^[1-9][[:digit:]]{7}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}$|^[1-9][[:digit:]]{5}[1-9][[:digit:]]{3}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}([0-9]|X)$')
->field('car_info_t.*')->order('car_info_t.car_phone asc');
->field('car_info_t.*')->order('car_info_t.id asc');
}
}else {
$query = $query->order('register_date asc');
$query = $query->order('car_info_t.id asc');
}
$count = $query->count();
$count = $count <= $data['export_limit'] || $data['export_limit'] == 0 ? $count : $data['export_limit'];
@ -653,8 +653,9 @@ class CarInfoHandle
}
$limit -= 3000;
$end = $info->pop();
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date');
$limit > 0 && ($info = $query->where('register_date', '>=', $lastRegisterDate)->limit($limit >= 3000 ? 3000 : $limit)->select());
$lastRegisterDate = is_array($end) ? $end['id'] : $end->getData('id');
$query_1 = clone $query;
$limit > 0 && ($info = $query_1->where('car_info_t.id', '>=', $lastRegisterDate)->limit($limit >= 3000 ? 3000 : $limit)->select());
}
}
}
@ -708,8 +709,9 @@ class CarInfoHandle
}
$limit -= 3000;
$end = $info->pop();
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date');
$limit > 0 && ($info = $query->where('register_date', '>=', $lastRegisterDate)->limit($limit >= 3000 ? 3000 : $limit)->select());
$lastRegisterDate = is_array($end) ? $end['id'] : $end->getData('id');
$query_1 = clone $query;
$limit > 0 && ($info = $query_1->where('car_info_t.id', '>=', $lastRegisterDate)->limit($limit >= 3000 ? 3000 : $limit)->select());
}
}
$writer = new Xlsx($spreadsheet);

Loading…
Cancel
Save