From 5357e9fa081ce4c09c96381ec9eafe892104958d Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jan 2024 10:10:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=93=B6=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/financial/FinancialRepository.php | 77 ++++++++++--------- app/listener/paySuccessOrderOther.php | 10 +-- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/app/common/repositories/system/financial/FinancialRepository.php b/app/common/repositories/system/financial/FinancialRepository.php index db7f41d3..4d696576 100644 --- a/app/common/repositories/system/financial/FinancialRepository.php +++ b/app/common/repositories/system/financial/FinancialRepository.php @@ -41,33 +41,34 @@ class FinancialRepository extends BaseRepository Elm::radio('financial_type', '转账类型', $merchant->financial_type) ->setOptions([ ['value' => 1, 'label' => '银行卡'], - ['value' => 2, 'label' => '微信'], - ['value' => 3, 'label' => '支付宝'], + // ['value' => 2, 'label' => '微信'], + // ['value' => 3, 'label' => '支付宝'], ])->control([ [ 'value' => 1, 'rule'=> [ - Elm::input('name', '姓名')->value($merchant->financial_bank->name??'')->required(), + Elm::input('name', '公司名称')->value($merchant->financial_bank->name??'')->required(), Elm::input('bank', '开户银行')->value($merchant->financial_bank->bank??'')->required(), - Elm::input('bank_code', '银行卡号')->value($merchant->financial_bank->bank_code??'')->required(), - ] - ], - [ - 'value' => 2, - 'rule'=> [ - Elm::input('name', '姓名')->value($merchant->financial_wechat->name??'')->required(), - Elm::input('wechat', '微信号')->value($merchant->financial_wechat->wechat??'')->required(), - Elm::frameImage('wechat_code', '收款二维码', '/' . config('admin.merchant_prefix') . '/setting/uploadPicture?field=wechat_code&type=1')->value($merchant->financial_wechat->wechat_code??'')->modal(['modal' => false])->width('896px')->height('480px'), - ] - ], - [ - 'value' => 3, - 'rule'=> [ - Elm::input('name', '姓名')->value($merchant->financial_alipay->name??'')->required(), - Elm::input('alipay', '支付宝账号')->value($merchant->financial_alipay->alipay??'')->required(), - Elm::frameImage('alipay_code', '收款二维码', '/' . config('admin.merchant_prefix') . '/setting/uploadPicture?field=alipay_code&type=1')->value($merchant->financial_alipay->alipay_code??'')->modal(['modal' => false])->width('896px')->height('480px'), + Elm::input('bank_code', '对公账号')->value($merchant->financial_bank->bank_code??'')->required(), + Elm::input('bank_branch', '开户网点')->value($merchant->financial_bank->bank_branch??'')->required(), ] ], + // [ + // 'value' => 2, + // 'rule'=> [ + // Elm::input('name', '姓名')->value($merchant->financial_wechat->name??'')->required(), + // Elm::input('wechat', '微信号')->value($merchant->financial_wechat->wechat??'')->required(), + // Elm::frameImage('wechat_code', '收款二维码', '/' . config('admin.merchant_prefix') . '/setting/uploadPicture?field=wechat_code&type=1')->value($merchant->financial_wechat->wechat_code??'')->modal(['modal' => false])->width('896px')->height('480px'), + // ] + // ], + // [ + // 'value' => 3, + // 'rule'=> [ + // Elm::input('name', '姓名')->value($merchant->financial_alipay->name??'')->required(), + // Elm::input('alipay', '支付宝账号')->value($merchant->financial_alipay->alipay??'')->required(), + // Elm::frameImage('alipay_code', '收款二维码', '/' . config('admin.merchant_prefix') . '/setting/uploadPicture?field=alipay_code&type=1')->value($merchant->financial_alipay->alipay_code??'')->modal(['modal' => false])->width('896px')->height('480px'), + // ] + // ], ]), ]); @@ -93,24 +94,24 @@ class FinancialRepository extends BaseRepository 'bank_code' => $data['bank_code'], ]; break; - case 2: - $key = 'financial_wechat' ; - $update = [ - 'name' => $data['name'], - //'idcard' => $data['idcard'], - 'wechat' => $data['wechat'], - 'wechat_code' => $data['wechat_code'], - ]; - break; - case 3: - $key = 'financial_alipay' ; - $update = [ - 'name' => $data['name'], - //'idcard' => $data['idcard'], - 'alipay' => $data['alipay'], - 'alipay_code' => $data['alipay_code'], - ]; - break; + // case 2: + // $key = 'financial_wechat' ; + // $update = [ + // 'name' => $data['name'], + // //'idcard' => $data['idcard'], + // 'wechat' => $data['wechat'], + // 'wechat_code' => $data['wechat_code'], + // ]; + // break; + // case 3: + // $key = 'financial_alipay' ; + // $update = [ + // 'name' => $data['name'], + // //'idcard' => $data['idcard'], + // 'alipay' => $data['alipay'], + // 'alipay_code' => $data['alipay_code'], + // ]; + // break; } return app()->make(MerchantRepository::class)->update($merId,[$key => json_encode($update),'financial_type' => $data['financial_type']]); } diff --git a/app/listener/paySuccessOrderOther.php b/app/listener/paySuccessOrderOther.php index cf1539c0..26e5446d 100644 --- a/app/listener/paySuccessOrderOther.php +++ b/app/listener/paySuccessOrderOther.php @@ -45,9 +45,7 @@ class paySuccessOrderOther $commission_rate = ($event['order']['commission_rate'] / 100); //该笔订单平台总手续费 - $realPrice = bcsub((string)$event['order']['total_price'], (string)$event['order']['extension_one'], 2); - $realPrice = bcsub($realPrice, (string)$event['order']['extension_two'], 2); - $this->totalAmount = bcmul($realPrice, (string)$commission_rate, 2); + $this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2); $this->remain = $this->totalAmount; // $typeTownServerId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownServer'])->value('mer_type_id'); @@ -82,11 +80,7 @@ class paySuccessOrderOther } Db::commit(); } catch (\Exception $e) { - if ($e->getCode() == 200) { - Db::commit(); - } else { - Db::rollback(); - } + Db::rollback(); Log::error('订单分润出错', ['code' => $e->getCode(), 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString()]); DingTalk::exception($e, '订单分润出错'); }