|
@@ -80,23 +80,19 @@ class Trainactive extends Api
|
|
|
|
|
|
//检测权限
|
|
|
public function check(){
|
|
|
- $qrcode_json = input('qrcode_json','','htmlspecialchars_decode');
|
|
|
- $data = json_decode($qrcode_json,true);
|
|
|
+ $type = input('type','pingjia');
|
|
|
+ $id = input('id',0);
|
|
|
|
|
|
- if(!isset($data['type']) || !isset($data['id'])){
|
|
|
- $this->error('验证失败');
|
|
|
- }
|
|
|
-
|
|
|
- if($data['type'] == 'pingjia'){
|
|
|
+ if($type == 'pingjia'){
|
|
|
|
|
|
- $info = Db::name('train_active')->where('id',$data['id'])->find();
|
|
|
+ $info = Db::name('train_active')->where('id',$id)->find();
|
|
|
if($info['pingjia_uid'] != $this->auth->id){
|
|
|
$this->error('您不能评价当前培训');
|
|
|
}
|
|
|
$this->success('验证成功');
|
|
|
}
|
|
|
|
|
|
- if($data['type'] == 'sign'){
|
|
|
+ if($type == 'sign'){
|
|
|
$this->success('验证成功');
|
|
|
}
|
|
|
|