From d2ece017dfae9a8f8b8a1616aa8f23bd83050e3b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 29 Dec 2023 10:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/store/order/StoreOrderOtherDao.php | 2 +- .../model/store/order/StoreOrderOther.php | 1 + .../store/order/StoreOtherOrderRepository.php | 2 +- app/controller/api/Auth.php | 17 +++++++++++++---- app/controller/api/store/merchant/Merchant.php | 7 +++---- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/common/dao/store/order/StoreOrderOtherDao.php b/app/common/dao/store/order/StoreOrderOtherDao.php index e3a4dade..c33f39ae 100644 --- a/app/common/dao/store/order/StoreOrderOtherDao.php +++ b/app/common/dao/store/order/StoreOrderOtherDao.php @@ -206,7 +206,7 @@ class StoreOrderOtherDao extends BaseDao $query->where('order_sn', 'like', '%' . $where['order_search'] . '%')->whereOr('user_phone', $where['order_search']); }) ->when(isset($where['group_order_sn']) && $where['group_order_sn'] !== '', function ($query) use ($where) { - $query->join('StoreGroupOrder GO', 'StoreOrderOther.group_order_id = GStoreOrderOther.group_order_id')->where('group_order_sn', $where['group_order_sn']); + $query->join('StoreGroupOrder GO', 'StoreOrderOther.group_order_id = GO.group_order_id')->where('group_order_sn', $where['group_order_sn']); }) ->when(isset($where['keywords']) && $where['keywords'] !== '', function ($query) use ($where) { $query->where(function ($query) use ($where) { diff --git a/app/common/model/store/order/StoreOrderOther.php b/app/common/model/store/order/StoreOrderOther.php index adfd44b3..3898f22a 100644 --- a/app/common/model/store/order/StoreOrderOther.php +++ b/app/common/model/store/order/StoreOrderOther.php @@ -20,6 +20,7 @@ use app\common\model\store\product\ProductGroupUser; use app\common\model\store\service\StoreService; use app\common\model\store\shipping\Express; use app\common\model\system\merchant\Merchant; +use app\common\model\system\merchant\MerchantIntention; use app\common\model\user\User; use app\common\repositories\store\MerchantTakeRepository; diff --git a/app/common/repositories/store/order/StoreOtherOrderRepository.php b/app/common/repositories/store/order/StoreOtherOrderRepository.php index f73c66f4..751c6fc8 100644 --- a/app/common/repositories/store/order/StoreOtherOrderRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderRepository.php @@ -1254,7 +1254,7 @@ class StoreOtherOrderRepository extends BaseRepository ->with([ 'orderProduct', 'merchant' => function ($query) { - return $query->field('mer_id,mer_name,is_trader'); + return $query->field('mer_id,mer_name,is_trader,financial_bank'); }, 'verifyService' => function ($query) { return $query->field('service_id,nickname'); diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index f697f7b9..cf3b50fb 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1608,11 +1608,20 @@ class Auth extends BaseController 'fail_msg' => $remark ]; Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 2)->update($updData); - $merId = Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 2)->value('mer_id', 0); - Db::name('merchant')->where('mer_id', $merId)->where('status', 1)->update(['business_status' => ($status == 1 ? 2 : 3)]); - if ($status == 1) { - Db::name('merchant')->where('mer_id', $merId)->update(['mer_settlement_agree_status' => 1]); + $merchant_intention = Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 2)->find(); + if($merchant_intention){ + if ($status == 1) { + $datas['business_status']=2; + $datas['mer_settlement_agree_status']=1; + $datas['financial_bank']=json_encode(['name'=>$merchant_intention['bank_username'], + 'bank_code'=>$merchant_intention['bank_code'],'bank'=>$merchant_intention['bank_opening'],'bank_branch'=>""]); + }else{ + $datas['business_status']=3; + } + Db::name('merchant')->where('mer_id', $merchant_intention['mer_id'])->where('status', 1)->update($datas); } + + } return app('json')->success('同步成功'); diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 6013cc2f..0c309dbc 100755 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -319,7 +319,6 @@ class Merchant extends BaseController $_line = bcsub($merchant->mer_money, $extract_minimum_line, 2); $_extract = ($_line < 0) ? 0 : $_line; $merLockMoney = app()->make(UserBillRepository::class)->merchantLickMoney($merId); - $merchant_intention= Db::name('merchant_intention')->where('mer_id',$merchant->mer_id)->find(); $data = [ 'mer_id' => $merchant->mer_id, //商户id 'mer_name' => $merchant->mer_name, //商户名称 @@ -329,9 +328,9 @@ class Merchant extends BaseController 'extract_minimum_line' => $extract_minimum_line, //提现最低额度 'extract_minimum_num' => $extract_minimum_num, //提现最低次数 'extract_money' => $_extract, //可提现金额 - 'financial_bank_bank' => $merchant_intention->bank_username ?? '', //银行账户姓名 - 'financial_bank_opening' => $merchant_intention->bank_opening ?? '', //开户行 - 'financial_bank_code' => $merchant_intention->bank_code ?? '', //银行账号 + 'financial_bank_bank' => $merchant->financial_bank->name ?? '', //银行账户姓名 + 'financial_bank_opening' => $merchant->financial_bank->bank ?? '', //开户行 + 'financial_bank_code' => $merchant->financial_bank->bank_code ?? '', //银行账号 'financial_type' => $merchant->financial_type, //提现方式 'ot_margin' => $merchant->ot_margin, //提现方式