作者 邓超

Merge remote-tracking branch 'origin/master'

@@ -112,20 +112,24 @@ class Job extends Base { @@ -112,20 +112,24 @@ class Job extends Base {
112 $page = app()->request('page', 1, 'intval'); 112 $page = app()->request('page', 1, 'intval');
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 116
116 if (!$jobId) { 117 if (!$jobId) {
117 app()->e('send_job_id_null_error'); 118 app()->e('send_job_id_null_error');
118 } 119 }
119 -  
120 - $where = dbWhere([ 120 + $whereArray = [
121 'job_id' => $jobId 121 'job_id' => $jobId
122 - ]); 122 + ];
  123 + if ($status || $status === 0) {
  124 + $whereArray['status'] = $status;
  125 + }
  126 + $where = dbWhere($whereArray);
123 127
124 $lists = db()->all(sendJobStatusSql::detail($where, $page, $limit)); 128 $lists = db()->all(sendJobStatusSql::detail($where, $page, $limit));
125 129
126 return listsPage($lists, 130 return listsPage($lists,
127 - db()->count(sendJobStatusSql::count($jobId))  
128 - , 1, 20); 131 + db()->count(sendJobStatusSql::detailCount($where))
  132 + , $page, $limit);
129 } 133 }
130 134
131 135
@@ -56,4 +56,15 @@ class sendJobStatusSql { @@ -56,4 +56,15 @@ class sendJobStatusSql {
56 } 56 }
57 57
58 58
  59 + /**
  60 + * 详情页统计
  61 + * @param string $where
  62 + * @return string
  63 + * @author:dc
  64 + * @time 2023/4/11 16:13
  65 + */
  66 + public static function detailCount(string $where):string {
  67 + return "select count(`id`) from `".static::$table."` where ".$where;
  68 + }
  69 +
59 } 70 }