作者 邓超

Merge remote-tracking branch 'origin/master'

@@ -113,6 +113,7 @@ class Job extends Base { @@ -113,6 +113,7 @@ class Job extends Base {
113 $limit = app()->request('limit', 20, 'intval'); 113 $limit = app()->request('limit', 20, 'intval');
114 $jobId = app()->request('id', 0, 'intval'); 114 $jobId = app()->request('id', 0, 'intval');
115 $status = app()->request('status'); 115 $status = app()->request('status');
  116 + $isExport = false;
116 117
117 if (!$jobId) { 118 if (!$jobId) {
118 app()->e('send_job_id_null_error'); 119 app()->e('send_job_id_null_error');
@@ -120,12 +121,15 @@ class Job extends Base { @@ -120,12 +121,15 @@ class Job extends Base {
120 $whereArray = [ 121 $whereArray = [
121 'job_id' => $jobId 122 'job_id' => $jobId
122 ]; 123 ];
123 - if ($status || $status === 0) { 124 + if ($status || $status === '0') {
124 $whereArray['status'] = $status; 125 $whereArray['status'] = $status;
125 } 126 }
  127 + if (app()->request('is_export', 0)) {
  128 + $isExport = true;
  129 + }
126 $where = dbWhere($whereArray); 130 $where = dbWhere($whereArray);
127 131
128 - $lists = db()->all(sendJobStatusSql::detail($where, $page, $limit)); 132 + $lists = db()->all(sendJobStatusSql::detail($where, $page, $limit, $isExport));
129 133
130 return listsPage($lists, 134 return listsPage($lists,
131 db()->count(sendJobStatusSql::detailCount($where)) 135 db()->count(sendJobStatusSql::detailCount($where))
@@ -48,10 +48,14 @@ class sendJobStatusSql { @@ -48,10 +48,14 @@ class sendJobStatusSql {
48 * @param $where 48 * @param $where
49 * @param int $page 49 * @param int $page
50 * @param int $limit 50 * @param int $limit
  51 + * @param bool $isExport
51 * @return string 52 * @return string
52 */ 53 */
53 - public static function detail($where, int $page = 1, int $limit = 20) 54 + public static function detail($where, int $page = 1, int $limit = 20, bool $isExport = false)
54 { 55 {
  56 + if ($isExport) {
  57 + return "select * from `" . static::$table . "` where " . $where . " order by id desc";
  58 + }
55 return "select * from `" . static::$table . "` where " . $where . " order by id desc limit {$limit} offset " . (($page - 1) * $limit); 59 return "select * from `" . static::$table . "` where " . $where . " order by id desc limit {$limit} offset " . (($page - 1) * $limit);
56 } 60 }
57 61