|
@@ -126,10 +126,11 @@ class SignController extends RestBaseController |
|
@@ -126,10 +126,11 @@ class SignController extends RestBaseController |
126
|
public function daySign(){
|
126
|
public function daySign(){
|
127
|
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
|
127
|
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
|
128
|
//判断是否需要进行周打卡
|
128
|
//判断是否需要进行周打卡
|
129
|
- if (!Db::name('user_week_sign')->where(['user_id'=>$this->getUserId()])->find()){
|
129
|
+ $re=Db::name('user_week_sign')->where(['user_id'=>$this->getUserId()])->order('create_time','desc')->find();
|
|
|
130
|
+ if (!$re){
|
130
|
$is_week=1;
|
131
|
$is_week=1;
|
131
|
}
|
132
|
}
|
132
|
- else if (Db::name('user_week_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ '<', $beginToday-(7*24*60*60)]])->find()){
|
133
|
+ else if ($re['create_time']<$beginToday-(7*24*60*60)){
|
133
|
$is_week=1;
|
134
|
$is_week=1;
|
134
|
}else{
|
135
|
}else{
|
135
|
$is_week=0;
|
136
|
$is_week=0;
|