|
@@ -16,14 +16,7 @@ class Trainactive extends Api
|
|
|
protected $noNeedRight = ['test2'];
|
|
|
|
|
|
|
|
|
- //获取培训详情
|
|
|
- public function info()
|
|
|
- {
|
|
|
- $id = input('id');
|
|
|
- $info = Db::name('train_active')->field('id,name,sign_endtime')->where('id',$id)->find();
|
|
|
|
|
|
- $this->success('', $info);
|
|
|
- }
|
|
|
|
|
|
//签到成功
|
|
|
public function signin(){
|
|
@@ -44,14 +37,13 @@ class Trainactive extends Api
|
|
|
$this->error('该培训已下架');
|
|
|
}
|
|
|
if($info['userauth_status'] == 0){
|
|
|
- /*if($this->auth->idcard_status != 1){
|
|
|
- $this->error('您未实名,不能签到该培训活动');
|
|
|
- }*/
|
|
|
+
|
|
|
if(!in_array($this->auth->id,explode(',',$info['user_ids']))){
|
|
|
$this->error('您不在该培训活动名单');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //判断
|
|
|
$map = [
|
|
|
'train_id' => $id,
|
|
|
'user_id' => $this->auth->id,
|
|
@@ -61,6 +53,14 @@ class Trainactive extends Api
|
|
|
$this->error('您已经签过到了');
|
|
|
}
|
|
|
|
|
|
+ //判断
|
|
|
+ if(time() < $info['starttime']){
|
|
|
+ $this->error('还没到签到开始时间');
|
|
|
+ }
|
|
|
+ if(time() > $info['endtime']){
|
|
|
+ $this->error('已错过签到截止时间');
|
|
|
+ }
|
|
|
+
|
|
|
//签到
|
|
|
$status = 1;
|
|
|
if(time() > $info['sign_endtime']){
|
|
@@ -78,7 +78,7 @@ class Trainactive extends Api
|
|
|
$this->success('签到成功');
|
|
|
}
|
|
|
|
|
|
- //检测权限
|
|
|
+ //评价检测权限
|
|
|
public function check(){
|
|
|
$type = input('type','pingjia');
|
|
|
$id = input('id',0);
|
|
@@ -121,7 +121,7 @@ class Trainactive extends Api
|
|
|
}
|
|
|
|
|
|
if($this->auth->id != $info['pingjia_uid']){
|
|
|
- $this->error('您不能签到该培训活动');
|
|
|
+ $this->error('您不能评价该培训活动');
|
|
|
}
|
|
|
|
|
|
//评价
|