作者 景琛

学生功能板块处理

@@ -207,7 +207,7 @@ class Bind extends Api @@ -207,7 +207,7 @@ class Bind extends Api
207 $this->error('参数错误', ['status' => 2]); 207 $this->error('参数错误', ['status' => 2]);
208 } 208 }
209 $model = new StudyScoreLog(); 209 $model = new StudyScoreLog();
210 - $res = $model->addScore($id,$unique); 210 + $model->addScore($id,$unique);
211 //halt($res); 211 //halt($res);
212 $data = db('study')->where('unique', $unique)->field('name,gender')->find(); 212 $data = db('study')->where('unique', $unique)->field('name,gender')->find();
213 if ($data['gender'] == 1){ 213 if ($data['gender'] == 1){
@@ -39,6 +39,11 @@ class StudyScoreLog extends Model @@ -39,6 +39,11 @@ class StudyScoreLog extends Model
39 $score = explode(',', $xm['score']); 39 $score = explode(',', $xm['score']);
40 $sum_score = 0; 40 $sum_score = 0;
41 $list = []; 41 $list = [];
  42 + //判断当前项目是否在学生所属场次内
  43 + $find = \db('ronda')->where('item_ids',['in',$id])->find();
  44 + if (empty($find)){
  45 + return '扫码错误';
  46 + }
42 foreach ($score as $k) { 47 foreach ($score as $k) {
43 $sum_score += $k; 48 $sum_score += $k;
44 } 49 }