From b994cf75210ae9afaf01375620030578ce0626fe Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 25 May 2024 20:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0$is=5Fcheck=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E4=BC=98=E5=8C=96=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/merchant/MerchantController.php | 3 ++- app/api/logic/merchant/MerchantLogic.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/api/controller/merchant/MerchantController.php b/app/api/controller/merchant/MerchantController.php index ec49a1a..4d0cf87 100644 --- a/app/api/controller/merchant/MerchantController.php +++ b/app/api/controller/merchant/MerchantController.php @@ -24,11 +24,12 @@ class MerchantController extends BaseApiController public function amount_account() { $merchant = $this->request->userInfo['merchant']; + $is_check = $this->request->get('is_check',1); if (!$merchant) { return $this->fail('当前用户非商户'); } if (!$merchant->isEmpty()) { - $res=MerchantLogic::amount_account($merchant); + $res=MerchantLogic::amount_account($merchant,$is_check); if(MerchantLogic::hasError()){ return $this->fail(MerchantLogic::getError()); } diff --git a/app/api/logic/merchant/MerchantLogic.php b/app/api/logic/merchant/MerchantLogic.php index b1a71ab..82eebd3 100644 --- a/app/api/logic/merchant/MerchantLogic.php +++ b/app/api/logic/merchant/MerchantLogic.php @@ -16,11 +16,17 @@ class MerchantLogic extends BaseLogic /** * 获取用户余额和绑定银行账户信息 */ - public static function amount_account($merchant) + public static function amount_account($merchant,$is_check=1) { try { $mer_money = Merchant::where('mer_id', $merchant['mer_id'])->value('mer_money'); - $bank_list = MerchantBank::where('mer_id', $merchant['mer_id'])->where('is_check', 1)->select()->each(function ($data) { + $where=['mer_id'=>$merchant['mer_id']]; + if($is_check==1){ + $where[]=['is_check','=',1]; + }elseif($is_check==0){ + $where[]=['is_check','=',0]; + } + $bank_list = MerchantBank::where($where)->select()->each(function ($data) { $bank_info = Bank::where('id', $data['bank_id'])->findOrEmpty(); $data['bank_name'] = !$bank_info->isEmpty() ? $bank_info['name'] : ''; $data['bank_image'] = !$bank_info->isEmpty() ? $bank_info['image'] : '';