作者 景琛

扫码处理

... ... @@ -240,7 +240,10 @@ class Bind extends Api
$this->error('参数错误', ['status' => 2]);
}
$model = new StudyScoreLog();
$model->addScore($id,$unique);
$find = $model->addScore($id,$unique);
if (empty($find)){
$this->error('扫码无效');
}else{
$data = db('study')->where('unique', $unique)->field('name,gender')->find();
if ($data['gender'] == 1){
$data['gender'] = '男';
... ... @@ -250,6 +253,8 @@ class Bind extends Api
$this->success('扫码成功', $data);
}
}
/**
* @ApiTitle (绑定后获取头像昵称)
*/
... ...
... ... @@ -40,9 +40,10 @@ class StudyScoreLog extends Model
$sum_score = 0;
$list = [];
//判断当前项目是否在学生所属场次内
$find = \db('ronda')->where('item_ids',['in',$id])->find();
$find = \db('ronda')->whereIn('item_ids',$id)->find();
//halt($find);
if (empty($find)){
return '扫码错误';
return $find;
}
foreach ($score as $k) {
$sum_score += $k;
... ...