|
|
@@ -3323,6 +3323,20 @@ class User extends BaseController
|
|
3323
|
3323
|
public function new_sign_info()
|
|
3324
|
3324
|
{
|
|
3325
|
3325
|
$uid = $this->request->uid();
|
|
|
3326
|
+ $key = 'user_sign_score_' . $uid;
|
|
|
3327
|
+ if (Cache::get($key)) {
|
|
|
3328
|
+ $data = [
|
|
|
3329
|
+ 'today' => 0,
|
|
|
3330
|
+ 'day' => 0
|
|
|
3331
|
+ ];
|
|
|
3332
|
+ return app('json')->success($data);
|
|
|
3333
|
+ }
|
|
|
3334
|
+
|
|
|
3335
|
+ $now = time();
|
|
|
3336
|
+ $todayEnd = strtotime('today 23:59:59');
|
|
|
3337
|
+ $remainingSeconds = $todayEnd - $now;
|
|
|
3338
|
+ Cache::set($key, 1, $remainingSeconds);
|
|
|
3339
|
+
|
|
3326
|
3340
|
// 查询今天是否已经签到
|
|
3327
|
3341
|
$today_signin_info = Db::name('user_sign_score')->where(array('uid' => $uid))->whereDay('signin_time')->find();
|
|
3328
|
3342
|
// 查询昨天是否已经签到了
|