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 * @apiSuccess {Double} fee 签到奖励 * @apiSuccess {Number} days 签到天数 * @apiSuccessExample {json} Success-Response: * * { * "code": 0, * "msg": "", * "data": { * "fee": 30, * "days": 1 * } * } */ public function sign() { $result = UserSignService::signV2($this->uid, date('Y-m-d')); if ($result) { return response()->success($result); } return response()->error('QAPP_SYS_ERROR'); } }