From 30027973a647cacce905b282781ecd0f7c1480d7 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 27 Feb 2024 16:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E6=88=B7=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E5=BC=80=E9=80=9A=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/MerchantIntentionRepository.php | 5 ++--- .../api/store/merchant/MerchantIntention.php | 18 +----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantIntentionRepository.php b/app/common/repositories/system/merchant/MerchantIntentionRepository.php index 969d538a..753618b5 100755 --- a/app/common/repositories/system/merchant/MerchantIntentionRepository.php +++ b/app/common/repositories/system/merchant/MerchantIntentionRepository.php @@ -172,7 +172,7 @@ class MerchantIntentionRepository extends BaseRepository } Db::transaction(function () use ($config, $intention, $data, $create,$margin,$merData,$smsData,$autoCreate) { if ($data['status'] == 1) { - if ($create) { + if ($create && $intention['type'] == 1) { $merchant = app()->make(MerchantRepository::class)->createMerchant($merData); $data['mer_id'] = $merchant->mer_id; $data['uid'] = $intention['uid']; @@ -193,9 +193,8 @@ class MerchantIntentionRepository extends BaseRepository $store_service_data['phone'] = $intention['phone']; $store_service_data['create_time'] = date('Y-m-d H:i:s'); Db::name('store_service')->insert($store_service_data); - - Queue::push(SendSmsJob::class, ['tempId' => 'APPLY_MER_SUCCESS', 'id' => $smsData]); } + Queue::push(SendSmsJob::class, ['tempId' => 'APPLY_MER_SUCCESS', 'id' => $smsData]); } else { Queue::push(SendSmsJob::class, ['tempId' => 'APPLY_MER_FAIL', 'id' => $smsData]); } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index eb57f3cd..6492fec6 100755 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -194,19 +194,6 @@ class MerchantIntention extends BaseController if (!empty($merInfo['business_status']) && ($merInfo['business_status'] == 2)) { return app('json')->fail('商户交易申请已通过'); } - $intenInfo = Db::name('merchant_intention')->where('mer_intention_id', $merInfo['mer_intention_id'] ?? 0)->where('type', 1)->find(); - if (empty($intenInfo)) { - // 兼容处理已开通商户 - $intenInfo = [ - 'uid' => $merInfo['uid'], - 'mer_id' => $merInfo['mer_id'], - 'phone' => $merInfo['mer_phone'], - 'mer_name' => $merInfo['mer_name'], - 'name' => $merInfo['mer_name'], - 'merchant_category_id' => $merInfo['category_id'], - 'mer_type_id' => $merInfo['type_id'], - ]; - } $intenInfo['bank_username'] = $data['bank_username']; $intenInfo['bank_opening'] = $data['bank_opening']; $intenInfo['bank_code'] = $data['bank_code']; @@ -214,13 +201,10 @@ class MerchantIntention extends BaseController $intenInfo['bank_back'] = $data['bank_back']; $intenInfo['cardno_front'] = $data['cardno_front']; $intenInfo['cardno_back'] = $data['cardno_back']; - $intenInfo['type'] = 2; $intenInfo['status'] = 0; $intenInfo['create_time'] = date('Y-m-d H:i:s'); - - unset($intenInfo['mer_intention_id']); - Db::name('merchant')->where('uid', $this->userInfo->uid)->where('status', 1)->update(['business_status' => 1]); + $this->repository->create($intenInfo); return app('json')->success('申请成功'); }