| xqd
@@ -252,10 +252,8 @@ class MyController extends Controller
|
|
|
* @api {post} /api/my/cash 提现
|
|
|
* @apiDescription 提现
|
|
|
* @apiGroup My
|
|
|
- * @apiParam {int} data[cash] 提现金额
|
|
|
- * @apiParam {string} data[type] 选择类型
|
|
|
- * @apiParam {string} data[account] 提现账号
|
|
|
- * @apiParam {string} data[name] 账号姓名
|
|
|
+ * @apiParam {int} data[bank_id] 银行卡号id
|
|
|
+ * @apiParam {int} data[cash] 银行卡号id
|
|
|
* @apiPermission Passport
|
|
|
* @apiVersion 0.1.0
|
|
|
* @apiSuccessExample {json} Success-Response:
|
| xqd
@@ -280,17 +278,12 @@ class MyController extends Controller
|
|
|
$user = $this->getUser();
|
|
|
$validator = \Validator::make($request->all(),
|
|
|
[
|
|
|
- 'data.cash' => 'required|integer',
|
|
|
- 'data.type' => 'required',
|
|
|
- 'data.account' => 'required',
|
|
|
- 'data.name' => 'required',
|
|
|
+ 'data.bank_id' => 'required',
|
|
|
+ 'data.cash' => 'required',
|
|
|
],
|
|
|
[
|
|
|
+ 'data.id.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);
|
| xqd
@@ -746,4 +739,47 @@ class MyController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @api {post} /api/my/bank/delete 删除银行卡
|
|
|
+ * @apiDescription 删除银行卡
|
|
|
+ * @apiGroup My
|
|
|
+ * @apiParam {int} id 银行卡id
|
|
|
+ * @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 bankDelete(Request $request)
|
|
|
+ {
|
|
|
+ $id = $request->id;
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
+ [
|
|
|
+ 'id' => 'required',
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'id.required' => '银行账号不存在',
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
+ $ok =UserBank::destroy($id);
|
|
|
+ if ($ok) {
|
|
|
+ return $this->error(ErrorCode::OPERATION_SUCCESS);
|
|
|
+ }else{
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|