...
|
...
|
@@ -186,10 +186,10 @@ class SignController extends RestBaseController |
|
|
|
|
|
if ($user['stay_sign_day']==0||$last)
|
|
|
{
|
|
|
Db::name('user')->where('id',$this->getUserId())->setInc('stay_sign_day',1);
|
|
|
Db::name('user')->where('id',$user['id'])->setInc('stay_sign_day',1);
|
|
|
//判断最大连续打卡天数
|
|
|
if ($user['stay_sign_day']>$user['longest_sign_day']){
|
|
|
Db::name('user')->where('id',$this->getUserId())->update(['longest_sign_day'=>$user['stay_sign_day']]);
|
|
|
if (($user['stay_sign_day']+1)>$user['longest_sign_day']){
|
|
|
Db::name('user')->where('id',$user['id'])->update(['longest_sign_day'=>($user['stay_sign_day']+1)]);
|
|
|
}
|
|
|
}else{
|
|
|
//非连续打卡
|
...
|
...
|
@@ -202,7 +202,7 @@ class SignController extends RestBaseController |
|
|
Db::name('user_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),"$type"=>time()]);
|
|
|
}
|
|
|
//记录打卡积分
|
|
|
Db::name('user')->where('id',$this->getUserId())->setInc('score',$score);
|
|
|
Db::name('user')->where('id',$user['id'])->setInc('score',$score);
|
|
|
Db::name('user_score_log')->insert(['score'=>$score,'create_time'=>time(),'action'=>'打卡','user_id'=>$this->getUserId(),'now_score'=>$user['score']+$score]);
|
|
|
|
|
|
//判断是否需要进行周打卡
|
...
|
...
|
|