|
@@ -2,12 +2,16 @@
|
|
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
|
|
|
|
+use App\Models\AccountLog;
|
|
use App\Models\BaseDictionaryOptionModel;
|
|
use App\Models\BaseDictionaryOptionModel;
|
|
use App\Models\BaseSettingsModel;
|
|
use App\Models\BaseSettingsModel;
|
|
use App\Models\DreamInfoModel;
|
|
use App\Models\DreamInfoModel;
|
|
use App\Models\SearchInfoModel;
|
|
use App\Models\SearchInfoModel;
|
|
|
|
+use App\Models\Suggest;
|
|
use App\Models\SystemInfoModel;
|
|
use App\Models\SystemInfoModel;
|
|
|
|
+use App\Models\UserBank;
|
|
use App\Models\UserCareDream;
|
|
use App\Models\UserCareDream;
|
|
|
|
+use App\Models\UserCashOut;
|
|
use App\Models\UserInfoModel;
|
|
use App\Models\UserInfoModel;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
use App\Services\Base\ErrorCode;
|
|
use App\Services\Base\ErrorCode;
|
|
@@ -243,6 +247,125 @@ class MyController extends Controller
|
|
return $this->api(compact('data'));
|
|
return $this->api(compact('data'));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {post} /api/my/cash 提现
|
|
|
|
+ * @apiDescription 提现
|
|
|
|
+ * @apiGroup My
|
|
|
|
+ * @apiParam {int} data[cash] 提现金额
|
|
|
|
+ * @apiParam {string} data[type] 选择类型
|
|
|
|
+ * @apiParam {string} data[account] 提现账号
|
|
|
|
+ * @apiParam {string} data[name] 账号姓名
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 1413,
|
|
|
|
+ * "message": "系统审核中",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 700,
|
|
|
|
+ * "message": "操作失败",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ */
|
|
|
|
+ public function cash(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $data = $request->data;
|
|
|
|
+ $user = $this->getUser();
|
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
|
+ [
|
|
|
|
+ 'data.cash' => 'required|integer',
|
|
|
|
+ 'data.type' => 'required',
|
|
|
|
+ 'data.account' => 'required',
|
|
|
|
+ 'data.name' => 'required',
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'data.cash.required' => '请输入金额',
|
|
|
|
+ 'data.type.required' => '请选择类型',
|
|
|
|
+ 'data.account.required' => '请输入提现账号',
|
|
|
|
+ 'data.name.required' => '请输入账号姓名',
|
|
|
|
+ 'data.cash.integer' => '请输入整数',
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
|
+// $info = [] ;
|
|
|
|
+// $info['from_type'] = '余额';
|
|
|
|
+// $info['from_id'] = $user->id;
|
|
|
|
+// $info['from_name'] = $user->name;
|
|
|
|
+// $info['op'] = '提现';
|
|
|
|
+// $info['from_amount'] = $data['coin'];
|
|
|
|
+// $info['to_type'] = '现金';
|
|
|
|
+// $info['to_id'] = $user->id;
|
|
|
|
+// $info['to_name'] = $data['account']; //账号
|
|
|
|
+// $info['note'] = $data['type'].$data['name'];
|
|
|
|
+// $ok = AccountLog::create($info);
|
|
|
|
+ $data['user_id'] = $user->id;
|
|
|
|
+ $data['status'] = 0;
|
|
|
|
+ $ok = UserCashOut::create($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->error(ErrorCode::verify);
|
|
|
|
+ }else{
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// 联系客服
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {post} /api/my/suggest 联系客服
|
|
|
|
+ * @apiDescription 联系客服
|
|
|
|
+ * @apiGroup My
|
|
|
|
+ * @apiParam {string} data[content] 内容
|
|
|
|
+ * @apiParam {string} data[email] 邮箱
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 200,
|
|
|
|
+ * "message": "操作成功",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 700,
|
|
|
|
+ * "message": "操作失败",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ */
|
|
|
|
+ public function suggest(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $data = $request->data;
|
|
|
|
+ $user = $this->getUser();
|
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
|
+ [
|
|
|
|
+ 'data.content' => 'required',
|
|
|
|
+ 'data.email' => 'required|email',
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'data.content.required' => '请输入你遇到的问题',
|
|
|
|
+ 'data.email.required' => '请输入正确的邮箱地址',
|
|
|
|
+ 'data.email.email' => '请输入正确的邮箱地址',
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
|
+ $data['user_id'] = $user->id;
|
|
|
|
+ $ok =Suggest::create($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_SUCCESS);
|
|
|
|
+ }else{
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// 回复我的
|
|
// 回复我的
|
|
// public function replyMy()
|
|
// public function replyMy()
|
|
// {
|
|
// {
|
|
@@ -464,6 +587,59 @@ class MyController extends Controller
|
|
return $this->api($data);
|
|
return $this->api($data);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {get} /api/my/care 我关注的用户
|
|
|
|
+ * @apiDescription 我关注的用户
|
|
|
|
+ * @apiGroup My
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ *{
|
|
|
|
+ * "status": true,
|
|
|
|
+ * "status_code": 0,
|
|
|
|
+ * "message": "",
|
|
|
|
+ * "data":[] or
|
|
|
|
+ * "data": [
|
|
|
|
+ * {
|
|
|
|
+ * "id": 2,
|
|
|
|
+ * "phone": "13880642881",
|
|
|
|
+ * "nickname": "name2",
|
|
|
|
+ * "avatar": "http://www.miao.com/upload/user/20170630/08e235d7211944e9b6482965b4d7c42e.jpg",
|
|
|
|
+ * "birthday": "2000-06-21",
|
|
|
|
+ * "sign": 0,
|
|
|
|
+ * "money": 0,
|
|
|
|
+ * "coin": 800,
|
|
|
|
+ * "sex": 1,
|
|
|
|
+ * "signture": "我的个性签名2",
|
|
|
|
+ * "height": 200,
|
|
|
|
+ * "work": "兼职",
|
|
|
|
+ * "emotion": 2,
|
|
|
|
+ * "address": "370105",
|
|
|
|
+ * "city": "成都",
|
|
|
|
+ * "detail_address": "",
|
|
|
|
+ * "status": 1,
|
|
|
|
+ * "wechat": "",
|
|
|
|
+ * "weibo": "",
|
|
|
|
+ * "remember_token": "",
|
|
|
|
+ * "created_at": "2017-06-25 10:42:06",
|
|
|
|
+ * "updated_at": "2017-06-30 09:15:04",
|
|
|
|
+ * "deleted_at": null,
|
|
|
|
+ * }
|
|
|
|
+ * ]
|
|
|
|
+ *}
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
|
+ */
|
|
|
|
+ public function care()
|
|
|
|
+ {
|
|
|
|
+ $user = $this->getUser();
|
|
|
|
+ $users =$user->UserCareUser;
|
|
|
|
+ return $this->api($users);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
public function insertSearchTable($id,$keyword)
|
|
public function insertSearchTable($id,$keyword)
|
|
{
|
|
{
|
|
$info = SearchInfoModel::where('user_id',$id)->
|
|
$info = SearchInfoModel::where('user_id',$id)->
|
|
@@ -477,4 +653,97 @@ class MyController extends Controller
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //我的银行账户
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {get} /api/my/bank/list 我的银行账户
|
|
|
|
+ * @apiDescription 我的银行账户
|
|
|
|
+ * @apiGroup My
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ *{
|
|
|
|
+ * "status": true,
|
|
|
|
+ * "status_code": 0,
|
|
|
|
+ * "message": "",
|
|
|
|
+ * "data":[] or
|
|
|
|
+ * "data": [
|
|
|
|
+ * {
|
|
|
|
+ * "id": 1,
|
|
|
|
+ * "user_id": 1,
|
|
|
|
+ * "bank_name": "1",
|
|
|
|
+ * "bank_number": "1",
|
|
|
|
+ * "bank_phone": "1",
|
|
|
|
+ * "bank_user": "1"
|
|
|
|
+ * }
|
|
|
|
+ *]
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
|
+ */
|
|
|
|
+ public function bankList()
|
|
|
|
+ {
|
|
|
|
+ $user = $this->getUser();
|
|
|
|
+ $data = UserBank::where('user_id',$user->id)->orderBy('id','desc')->get();
|
|
|
|
+ return $this->api($data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 添加银行卡
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {post} /api/my/bank/create 添加银行卡
|
|
|
|
+ * @apiDescription 添加银行卡
|
|
|
|
+ * @apiGroup My
|
|
|
|
+ * @apiParam {string} data[bank_name] 银行名称
|
|
|
|
+ * @apiParam {string} data[bank_number] 银行卡号
|
|
|
|
+ * @apiParam {int} data[bank_phone] 银行卡绑定手机号
|
|
|
|
+ * @apiParam {string} data[bank_user] 银行卡用户姓名
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 200,
|
|
|
|
+ * "message": "操作成功",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ *{
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 700,
|
|
|
|
+ * "message": "操作失败",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ */
|
|
|
|
+ public function bankCreate(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $data = $request->data;
|
|
|
|
+ $user = $this->getUser();
|
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
|
+ [
|
|
|
|
+ 'data.bank_name' => 'required',
|
|
|
|
+ 'data.bank_number' => 'required',
|
|
|
|
+ 'data.bank_phone' => 'required',
|
|
|
|
+ 'data.bank_user' => 'required',
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'data.bank_name.required' => '请选择账号类型',
|
|
|
|
+ 'data.bank_number.required' => '请输入账号',
|
|
|
|
+ 'data.bank_phone.required' => '请输入账号绑定手机号码',
|
|
|
|
+ 'data.bank_user.required' => '请输入账号绑定用户姓名',
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
|
+ $data['user_id'] = $user->id;
|
|
|
|
+ $ok =UserBank::create($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_SUCCESS);
|
|
|
|
+ }else{
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|