123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Http\Controllers\Api\V1;
- use App\Models\BaseSettingsModel;
- use App\Models\DreamInfoModel;
- use App\Models\UserInfoModel;
- use Illuminate\Http\Request;
- use App\Services\Base\ErrorCode;
- class HomeController extends Controller
- {
- /**
- * @api {get} /api/home/index 首页(home)
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * "state": true,
- * "code": 0,
- * "message": "",
- * "data": {
- * "verify_code": "1234"//该值调试时使用,sms调通后取消
- * }
- * }
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "state": false,
- * "code": 1000,
- * "message": "传入参数不正确",
- * "data": null or []
- * }
- * 可能出现的错误代码:
- * 1000 CLIENT_WRONG_PARAMS 传入参数不正确
- */
- public function index(Request $request)
- {
- // $tel = $request->session()->get('tel');
- $a = 1234235434534;
- return $a;
- $user = UserInfoModel::where('tel',$tel)->frist();
- //获取轮播图
- $banner = BaseSettingsModel::where([['category' => 'banner'],['status' => '1']])
- ->orderBy('sort')->limit('3')->get()->toArray();
- // 关注的用户
- $other_user = $user->UserCareUser;
- return $other_user;
- dd($other_user);
- // 获取其他用户信息 及梦想
- $user_info = UserInfoModel::orderBy('id')->get()->toArray();
- $dream = DreamInfoModel::orderBy('created_at')->get()->toArray();
- return $this->error(ErrorCode::SERVICE_CODE_FAILED);
- }
- }
|