|
@@ -240,7 +240,10 @@ class Bind extends Api |
|
@@ -240,7 +240,10 @@ class Bind extends Api |
240
|
$this->error('参数错误', ['status' => 2]);
|
240
|
$this->error('参数错误', ['status' => 2]);
|
241
|
}
|
241
|
}
|
242
|
$model = new StudyScoreLog();
|
242
|
$model = new StudyScoreLog();
|
243
|
- $model->addScore($id,$unique);
|
243
|
+ $find = $model->addScore($id,$unique);
|
|
|
244
|
+ if (empty($find)){
|
|
|
245
|
+ $this->error('扫码无效');
|
|
|
246
|
+ }else{
|
244
|
$data = db('study')->where('unique', $unique)->field('name,gender')->find();
|
247
|
$data = db('study')->where('unique', $unique)->field('name,gender')->find();
|
245
|
if ($data['gender'] == 1){
|
248
|
if ($data['gender'] == 1){
|
246
|
$data['gender'] = '男';
|
249
|
$data['gender'] = '男';
|
|
@@ -250,6 +253,8 @@ class Bind extends Api |
|
@@ -250,6 +253,8 @@ class Bind extends Api |
250
|
$this->success('扫码成功', $data);
|
253
|
$this->success('扫码成功', $data);
|
251
|
}
|
254
|
}
|
252
|
|
255
|
|
|
|
256
|
+ }
|
|
|
257
|
+
|
253
|
/**
|
258
|
/**
|
254
|
* @ApiTitle (绑定后获取头像昵称)
|
259
|
* @ApiTitle (绑定后获取头像昵称)
|
255
|
*/
|
260
|
*/
|