作者 邓超

Merge remote-tracking branch 'origin/master'

... ... @@ -5,6 +5,7 @@ namespace Controller;
use Lib\Mail\Mail;
use Model\emailSql;
use Model\sendJobsSql;
use Model\sendJobStatusSql;
/**
... ... @@ -101,6 +102,31 @@ class Job extends Base {
}
/**
* 黑格发件任务详情
* @author:dc
* @time 2023/4/17 15:57
*/
public function jobDetail()
{
$page = app()->request('page', 1, 'intval');
$limit = app()->request('limit', 20, 'intval');
$jobId = app()->request('id', 0, 'intval');
if (!$jobId) {
app()->e('send_job_id_null_error');
}
$where = dbWhere([
'job_id' => $jobId
]);
$lists = db()->all(sendJobStatusSql::detail($where, $page, $limit));
return listsPage($lists,
db()->count(sendJobStatusSql::count($jobId))
, 1, 20);
}
... ...
... ... @@ -97,7 +97,8 @@ return [
'send_job_start_error' => '开始执行任务失败',
'send_job_stop_error' => '暂停任务失败'
'send_job_stop_error' => '暂停任务失败',
'send_job_id_null_error' => '任务id不能为空',
... ...
... ... @@ -43,5 +43,17 @@ class sendJobStatusSql {
return "select count(*) as t,{$sucees},{$error} from `".self::$table."` where `job_id` = {$job_id} ";
}
/**
* job任务详情页
* @param $where
* @param int $page
* @param int $limit
* @return string
*/
public static function detail($where, int $page = 1, int $limit = 20)
{
return "select * from `" . static::$table . "` where " . $where . " order by id desc limit {$limit} offset " . (($page - 1) * $limit);
}
}
... ...
... ... @@ -51,6 +51,8 @@ return [
'job/stop' => [\Controller\Job::class, 'stop'],
// 开始任务
'job/start' => [\Controller\Job::class, 'start'],
// 任务详情
'job/detail' => [\Controller\Job::class, 'jobDetail'],
// 上传图片
'upload/image' => [\Controller\Upload::class, 'image']
... ...