正在显示
1 个修改的文件
包含
7 行增加
和
1 行删除
@@ -183,19 +183,25 @@ class SignController extends RestBaseController | @@ -183,19 +183,25 @@ class SignController extends RestBaseController | ||
183 | $score=Db::name('config')->where('id',1)->find(); | 183 | $score=Db::name('config')->where('id',1)->find(); |
184 | if ($param['status']==1){ | 184 | if ($param['status']==1){ |
185 | //早签到积分 | 185 | //早签到积分 |
186 | + $end_time=$score['morning_sign_end_time']; | ||
186 | $score=$score['morning_sign_score']; | 187 | $score=$score['morning_sign_score']; |
187 | $type='morning'; | 188 | $type='morning'; |
188 | }elseif ($param['status']==2){ | 189 | }elseif ($param['status']==2){ |
190 | + $end_time=$score['noon_sign_end_time']; | ||
189 | $score=$score['noon_sign_score']; | 191 | $score=$score['noon_sign_score']; |
190 | $type='noon'; | 192 | $type='noon'; |
191 | }elseif ($param['status']==3){ | 193 | }elseif ($param['status']==3){ |
194 | + $end_time=$score['night_sign_end_time']; | ||
192 | $score=$score['night_sign_score']; | 195 | $score=$score['night_sign_score']; |
193 | $type='night'; | 196 | $type='night'; |
194 | }elseif ($param['status']==4){ | 197 | }elseif ($param['status']==4){ |
198 | + $end_time=$score['sleep_sign_end_time']; | ||
195 | $score=$score['sleep_sign_score']; | 199 | $score=$score['sleep_sign_score']; |
196 | $type='sleep'; | 200 | $type='sleep'; |
197 | } | 201 | } |
198 | - | 202 | + if(time()>$end_time){ |
203 | + $this->error('当前签到时间已过'); | ||
204 | + } | ||
199 | if(Db::name('user_sign')->where('user_id',$user['id'])->whereNotNull("$type")->find()){ | 205 | if(Db::name('user_sign')->where('user_id',$user['id'])->whereNotNull("$type")->find()){ |
200 | $this->error('当前时间段已签到'); | 206 | $this->error('当前时间段已签到'); |
201 | } | 207 | } |
-
请 注册 或 登录 后发表评论