|
@@ -22,6 +22,7 @@ class Index extends Api
|
|
|
$now = time();
|
|
|
$papers = Db::name('exam_paper')->field('id,image,title,start_time,end_time,total_score,limit_time')
|
|
|
->where('status', 'NORMAL')
|
|
|
+ ->where('deletetime', NULL)
|
|
|
->whereRaw("((start_time = 0 and end_time = 0) or (start_time < {$now} and end_time > {$now}))")
|
|
|
// ->where('find_in_set(:user_ids,user_ids)', ['user_ids' => $this->auth->id])
|
|
|
->limit(3)
|
|
@@ -46,6 +47,7 @@ class Index extends Api
|
|
|
->where('status', 'NORMAL')
|
|
|
->whereRaw("((start_time = 0 and end_time = 0) or (start_time < {$now} and end_time > {$now}))")
|
|
|
->where('find_in_set(:user_ids,user_ids)', ['user_ids' => $this->auth->id])
|
|
|
+ ->where('deletetime', NULL)
|
|
|
->autopage()
|
|
|
->select();
|
|
|
|