作者 开飞机的舒克

筛选学生的雷达维度积分

... ... @@ -319,11 +319,13 @@ class Bind extends Api
//获取雷达维度
//halt($sid);
$model = new RadarScore();
$list = collection($model->whereIn('campus_ids',$cid)->where('study_id',$sid)->field('radar_id,score')->select())->toArray();
foreach ($list as $k => $v){
$data[$k]['radar'] = \db('radar')->where('id',$v['radar_id'])->value('title');
$data[$k]['radar_score'] = $v['score'];
}
$data['item'] = $model->whereIn('campus_ids',$cid)->where('study_id',$sid)->field('radar_id,score')
->paginate(9,false)
->each(function ($item,$key){
$item['radar'] = \db('radar')->where('id',$item['radar_id'])->value('title');
$item['score'] = $item['score'];
return $item;
});
$this->success('获取成功', $data);
}
... ...
... ... @@ -19,4 +19,17 @@ class RadarScore extends Model
];
public function getRadar($cid,$sid){
$list = collection($this->whereIn('campus_ids',$cid)->where('study_id',$sid)->field('radar_id,score')->select())->toArray();
$value = [];
$res = [];
foreach ($list as $v){
$value[] = \db('radar')->where('id',$v['radar_id'])->value('title');
$res[] = $v['score'];
}
dump($res);
halt($value);
return $value;
}
}
\ No newline at end of file
... ...
... ... @@ -6330,7 +6330,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-04-12 19:07:36 <a href="./" target="_blank">校园活动</a>
Generated on 2023-04-12 19:20:53 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...