作者 何书鹏
1 个管道 的构建 通过 耗费 2 秒

首页考试

... ... @@ -65,10 +65,11 @@ class Index extends Api
{
$user = $this->auth->getUser();
if($user && !empty($user['mobile_exam_ids'])){
// 别名的组合CONCAT(b.nickname,a.nickname) name
$exam_list = Exam::alias('a')
->join('mobile_exam b','b.id = a.pid')
->where('a.id','in',$user['mobile_exam_ids'])
->field('a.id,a.name,a.exam_time,CONCAT(b.nickname,a.nickname) nickname')
->field('a.id,CONCAT(b.nickname,a.nickname) name,a.nickname,a.exam_time')
->order('a.exam_time asc')
->select();
foreach ($exam_list as &$v) {
... ...