...
|
...
|
@@ -16,6 +16,7 @@ class SignController extends RestBaseController |
|
|
* @url /portal/Sign/index
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @return is_week:是否应该周打卡(优先判断),0:不需要周打卡,1:需要周打卡
|
|
|
* @return sign:1是早打卡,2是午打卡,3是晚打卡,4是睡前打卡,0不能打卡
|
|
|
* @return slogan:口号
|
|
|
* @return start_time:显示时间(开始)
|
...
|
...
|
@@ -87,11 +88,20 @@ class SignController extends RestBaseController |
|
|
}
|
|
|
$data['sign']=0;
|
|
|
}
|
|
|
|
|
|
//判断是否需要进行周打卡
|
|
|
if (Db::name('user_week_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ '<', $beginToday-(7*24*60*60)]])->find()){
|
|
|
$is_week=1;
|
|
|
}else{
|
|
|
$is_week=0;
|
|
|
}
|
|
|
|
|
|
$this->success('首页信息',array(
|
|
|
'sign'=>$data['sign'],
|
|
|
'slogan'=>$re['slogan'],
|
|
|
'start_time'=>$data['start_time'],
|
|
|
'end_time'=>$data['end_time'],
|
|
|
'is_week'=>$is_week
|
|
|
));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -205,12 +215,7 @@ class SignController extends RestBaseController |
|
|
Db::name('user')->where('id',$user['id'])->setInc('score',$score);
|
|
|
Db::name('user_score_log')->insert(['score'=>$score,'create_time'=>time(),'action'=>'打卡','user_id'=>$user['id'],'now_score'=>$user['score']+$score]);
|
|
|
|
|
|
//判断是否需要进行周打卡
|
|
|
if (Db::name('user_week_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ '<', $beginToday-(7*24*60*60)]])->find()){
|
|
|
$is_week=1;
|
|
|
}else{
|
|
|
$is_week=0;
|
|
|
}
|
|
|
|
|
|
|
|
|
//返回
|
|
|
$this->success('日打卡提交结果',array(
|
...
|
...
|
@@ -224,6 +229,9 @@ class SignController extends RestBaseController |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 分享接口
|
|
|
* @description 分享接口结果返回
|
...
|
...
|
|