添加校验支付密码
This commit is contained in:
parent
f7dcde9937
commit
76a8afe6cd
@ -275,11 +275,13 @@ class Store extends BaseController
|
||||
public function refuse($id)
|
||||
{
|
||||
$userId = $this->request->uid();
|
||||
$reason = $this->request->post('reason');
|
||||
$couponDetail = StoreCouponDetail::where('id', $id)->where('uid', $userId)->find();
|
||||
if (empty($couponDetail) || $couponDetail['send_status'] != StoreCouponDetail::SEND_CONFIRM) {
|
||||
return app('json')->fail('当前状态不支持操作');
|
||||
}
|
||||
$couponDetail->send_status = StoreCouponDetail::SEND_AUDIT;
|
||||
$couponDetail->reason = $reason;
|
||||
if (!$couponDetail->save()) {
|
||||
throw new \Exception('优惠券详情保存出错');
|
||||
}
|
||||
|
@ -350,5 +350,21 @@ class StoreOrder extends BaseController
|
||||
return app('json')->success('上传凭证成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验支付密码
|
||||
* @return mixed
|
||||
*/
|
||||
public function verifyPwd()
|
||||
{
|
||||
$user = $this->request->userInfo();
|
||||
if (empty($user['withdrawal_pwd'])) {
|
||||
return app('json')->fail(['msg' => '请设置支付密码', 'code'=> 101]);
|
||||
}
|
||||
$transPwd = $this->request->post('withdrawal_pwd');
|
||||
if (!password_verify((string)$transPwd, $user['withdrawal_pwd'])) {
|
||||
return app('json')->fail(['msg' => '支付密码错误', 'code'=> 102]);
|
||||
}
|
||||
return app('json')->success('验证通过');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,6 +100,7 @@ Route::group('api/', function () {
|
||||
Route::post('receipt/:id', '/createReceipt');
|
||||
Route::get('delivery/:id', '/getOrderDelivery');
|
||||
Route::post('upload/:id', '/upload_verify');
|
||||
Route::post('verifyPwd', '/verifyPwd');
|
||||
})->prefix('api.store.order.StoreOrder');
|
||||
|
||||
// 预售
|
||||
@ -318,8 +319,8 @@ Route::group('api/', function () {
|
||||
Route::get('attr/list', 'StoreProductAttrTemplate/getlist');
|
||||
Route::get('subsidy', 'Store/subsidy');
|
||||
Route::get('subsidyRecord', 'Store/subsidyRecord');
|
||||
Route::get('subsidyReceive', 'Store/receive');
|
||||
Route::get('subsidyRefuse', 'Store/refuse');
|
||||
Route::get('subsidyReceive/:id', 'Store/receive');
|
||||
Route::post('subsidyRefuse/:id', 'Store/refuse');
|
||||
})->prefix('api.server.')->middleware(\app\common\middleware\MerchantServerMiddleware::class, 1);
|
||||
|
||||
//管理员订单
|
||||
|
Loading…
x
Reference in New Issue
Block a user