作者 景琛

首页战队显示处理

... ... @@ -168,14 +168,10 @@ class Index extends Api
$find = \db('study')->where('user_id',$user['id'])->find();
$res = \db('study_score_log')->where('study_id',$find['id'])->value('campus_id');
$data[] = \db('campus')->where('id',$res)->find();
// $data = db('campus c')
// ->join('activity a','a.id = c.activity_id')
// ->join('school s','s.id = c.school_id')
// ->field('c.*,a.title as activity_name,s.title as school_name')
// ->select();
// if (empty($data)) {
// $this->error('当前还没有校区', ['status' => 2]);
// }
foreach ($data as $k => $v){
$data[$k]['school_id'] = $v['id'];
$data[$k]['schools_id'] = $v['school_id'];
}
$this->success('项目校区', $data);
}
... ...