user_info; if (!$data->head_img) { $data->head_img = 'https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/defaulthead.png'; } $data['is_vip'] = 0; $data['vip_days'] = 0; $year_record = YearOrderService::getRecord($this->uid); if ($year_record) { $data['is_vip'] = 1; $time = strtotime($year_record['end_time']) - time(); if ($time >= 86400) { $data['vip_days'] = floor($time / 86400) . '天'; } elseif ($time > 3600) { $data['vip_days'] = floor($time / 3600) . '小时'; } elseif ($time > 60) { $data['vip_days'] = floor($time / 60) . '分钟'; } else { $data['vip_days'] = $time . '秒'; } } return response()->success($data); } /** * @apiVersion 1.0.0 * @apiDescription 用户签到 * @api {GET} sign 用户签到 * @apiHeader {String} [Authorization] token * @apiGroup User * @apiName sign * @apiSuccessExample {json} Success-Response: * * { * "code": 0, * "msg": "", * "data": { * } * } */ public function sign(Request $request) { if (UserSignService::isSign($this->uid)) { return 0; } if (UserSignService::signV2($this->uid, date('Y-m-d'))) { return response()->success(); } return 0; } }