作者 开飞机的舒克

首页项目校区展示问题

... ... @@ -164,15 +164,20 @@ class Index extends Api
*/
public function getSchoolItem()
{
$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]);
$user = $this->auth->getUserinfo();
$find = \db('study')->where('user_id',$user['id'])->find();
$res = \db('study_score_log')->where('study_id',$find['id'])->column('campus_id');
foreach ($res as $k){
$data = \db('campus')->where('id',$k)->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]);
// }
$this->success('项目校区', $data);
}
... ...
... ... @@ -59,7 +59,7 @@ class StudyScoreLog extends Model
//得分写入学生分数记录
$data = [
'item_id' => $id,
'campus_ids' => $ronda['campus_id'],
'campus_id' => $ronda['campus_id'],
'study_id' => $stu['id'],
'team' => $stu['team'],
'score' => $sum_score,
... ...