作者 邓超

Merge remote-tracking branch 'origin/master'

... ... @@ -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');
... ... @@ -120,12 +121,15 @@ class Job extends Base {
$whereArray = [
'job_id' => $jobId
];
if ($status || $status === 0) {
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);
}
... ...