作者 朱世亮

发件任务详情添加导出

... ... @@ -113,6 +113,7 @@ class Job extends Base {
$limit = app()->request('limit', 20, 'intval');
$jobId = app()->request('id', 0, 'intval');
$status = app()->request('status');
$isExport = false;
if (!$jobId) {
app()->e('send_job_id_null_error');
... ... @@ -123,9 +124,12 @@ class Job extends Base {
if ($status || $status === '0') {
$whereArray['status'] = $status;
}
if (app()->request('is_export', 0)) {
$isExport = true;
}
$where = dbWhere($whereArray);
$lists = db()->all(sendJobStatusSql::detail($where, $page, $limit));
$lists = db()->all(sendJobStatusSql::detail($where, $page, $limit, $isExport));
return listsPage($lists,
db()->count(sendJobStatusSql::detailCount($where))
... ...
... ... @@ -48,10 +48,14 @@ class sendJobStatusSql {
* @param $where
* @param int $page
* @param int $limit
* @param bool $isExport
* @return string
*/
public static function detail($where, int $page = 1, int $limit = 20)
public static function detail($where, int $page = 1, int $limit = 20, bool $isExport = false)
{
if ($isExport) {
return "select * from `" . static::$table . "` where " . $where . " order by id desc";
}
return "select * from `" . static::$table . "` where " . $where . " order by id desc limit {$limit} offset " . (($page - 1) * $limit);
}
... ...