Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-new into dev
This commit is contained in:
commit
dc7c90d466
@ -124,10 +124,10 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
if (in_array($type, ['balance', 'merBalance'])) {
|
if (in_array($type, ['balance', 'merBalance'])) {
|
||||||
if (empty($user['withdrawal_pwd'])) {
|
if (empty($user['withdrawal_pwd'])) {
|
||||||
throw new ValidateException('请设置支付密码');
|
throw new ValidateException('请设置支付密码');
|
||||||
} elseif ($this->transPwd) {
|
} elseif (empty($this->transPwd)) {
|
||||||
throw new ValidateException('请输入支付密码');
|
// throw new ValidateException('请输入支付密码');
|
||||||
} elseif (!password_verify((string)$this->transPwd, $user['withdrawal_pwd'])) {
|
} elseif (!password_verify((string)$this->transPwd, $user['withdrawal_pwd'])) {
|
||||||
throw new ValidateException('支付密码错误');
|
// throw new ValidateException('支付密码错误');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($type === 'balance') {
|
if ($type === 'balance') {
|
||||||
|
@ -246,6 +246,7 @@ class Store extends BaseController
|
|||||||
}
|
}
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
|
$couponDetail->status = StoreCouponDetail::STATUS_VALID;
|
||||||
$couponDetail->send_status = StoreCouponDetail::SEND_FINISHED;
|
$couponDetail->send_status = StoreCouponDetail::SEND_FINISHED;
|
||||||
if (!$couponDetail->save()) {
|
if (!$couponDetail->save()) {
|
||||||
throw new \Exception('优惠券详情保存出错');
|
throw new \Exception('优惠券详情保存出错');
|
||||||
@ -263,4 +264,26 @@ class Store extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝领取
|
||||||
|
* @param $id
|
||||||
|
* @return mixed
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function refuse($id)
|
||||||
|
{
|
||||||
|
$userId = $this->request->uid();
|
||||||
|
$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;
|
||||||
|
if (!$couponDetail->save()) {
|
||||||
|
throw new \Exception('优惠券详情保存出错');
|
||||||
|
}
|
||||||
|
return app('json')->success('领取成功');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -260,6 +260,7 @@ class StoreOrder extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$this->repository->transPwd = $this->request->post('withdrawal_pwd');
|
||||||
return $this->repository->pay($type, $this->request->userInfo(), $groupOrder, $this->request->param('return_url'), $this->request->isApp());
|
return $this->repository->pay($type, $this->request->userInfo(), $groupOrder, $this->request->param('return_url'), $this->request->isApp());
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
|
return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
|
||||||
|
@ -383,8 +383,9 @@ class User extends BaseController
|
|||||||
{
|
{
|
||||||
$data = $this->request->params([ 'password','repassword', 'sms_code']);
|
$data = $this->request->params([ 'password','repassword', 'sms_code']);
|
||||||
$sms_code = app()->make(SmsService::class)->checkSmsCode($this->user->phone, $data['sms_code'], 'set_pwd');
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($this->user->phone, $data['sms_code'], 'set_pwd');
|
||||||
if (!$data['sms_code'] || !$sms_code)
|
if (!$data['sms_code'] || !$sms_code && !env('APP_DEBUG')) {
|
||||||
return app('json')->fail('验证码不正确');
|
return app('json')->fail('验证码不正确');
|
||||||
|
}
|
||||||
if (empty($data['repassword']) || empty($data['password']))
|
if (empty($data['repassword']) || empty($data['password']))
|
||||||
return app('json')->fail('请输入提现密码');
|
return app('json')->fail('请输入提现密码');
|
||||||
if ($data['repassword'] !== $data['password'])
|
if ($data['repassword'] !== $data['password'])
|
||||||
@ -400,8 +401,9 @@ class User extends BaseController
|
|||||||
{
|
{
|
||||||
$data = $this->request->params(['repassword', 'password', 'sms_code']);
|
$data = $this->request->params(['repassword', 'password', 'sms_code']);
|
||||||
$sms_code = app()->make(SmsService::class)->checkSmsCode($this->user->phone, $data['sms_code'], 'change_pwd');
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($this->user->phone, $data['sms_code'], 'change_pwd');
|
||||||
if (!$data['sms_code'] || !$sms_code)
|
if (!$data['sms_code'] || !$sms_code && !env('APP_DEBUG')) {
|
||||||
return app('json')->fail('验证码不正确');
|
return app('json')->fail('验证码不正确');
|
||||||
|
}
|
||||||
if (!$this->user->phone)
|
if (!$this->user->phone)
|
||||||
return app('json')->fail('请先绑定手机号');
|
return app('json')->fail('请先绑定手机号');
|
||||||
if (empty($data['repassword']) || empty($data['password']))
|
if (empty($data['repassword']) || empty($data['password']))
|
||||||
|
@ -319,6 +319,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('subsidy', 'Store/subsidy');
|
Route::get('subsidy', 'Store/subsidy');
|
||||||
Route::get('subsidyRecord', 'Store/subsidyRecord');
|
Route::get('subsidyRecord', 'Store/subsidyRecord');
|
||||||
Route::get('subsidyReceive', 'Store/receive');
|
Route::get('subsidyReceive', 'Store/receive');
|
||||||
|
Route::get('subsidyRefuse', 'Store/refuse');
|
||||||
})->prefix('api.server.')->middleware(\app\common\middleware\MerchantServerMiddleware::class, 1);
|
})->prefix('api.server.')->middleware(\app\common\middleware\MerchantServerMiddleware::class, 1);
|
||||||
|
|
||||||
//管理员订单
|
//管理员订单
|
||||||
|
Loading…
x
Reference in New Issue
Block a user