作者 邓超

x

@@ -24,11 +24,20 @@ class Job extends Base { @@ -24,11 +24,20 @@ class Job extends Base {
24 */ 24 */
25 public function index(){ 25 public function index(){
26 26
27 - $lists = db()->all(sendJobsSql::all(dbWhere([ 27 + $page = app()->request('page',1,'intval');
  28 + $limit = app()->request('limit',20,'intval');
  29 +
  30 + $where = dbWhere([
28 'email_id' => $this->getEmails('id') 31 'email_id' => $this->getEmails('id')
29 - ]))); 32 + ]);
  33 +
  34 + $lists = db()->all(sendJobsSql::all($where,$page,$limit));
  35 +
  36 +
30 37
31 - return $lists; 38 + return listsPage($lists,
  39 + db()->count(sendJobsSql::count($where))
  40 + ,1,20);
32 } 41 }
33 42
34 43
@@ -45,6 +45,17 @@ class sendJobsSql { @@ -45,6 +45,17 @@ class sendJobsSql {
45 } 45 }
46 46
47 /** 47 /**
  48 + * 统计
  49 + * @param string $where
  50 + * @return string
  51 + * @author:dc
  52 + * @time 2023/4/17 16:44
  53 + */
  54 + public static function count(string $where):string {
  55 + return "select count(`id`) from `".static::$table."` where ".$where;
  56 + }
  57 +
  58 + /**
48 * 某个任务是否暂停了 59 * 某个任务是否暂停了
49 * @param int $id 60 * @param int $id
50 * @return bool 61 * @return bool