From 86d76c5c2bdbaf50bcd717e410d5b1a15e7ed38b Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 27 Sep 2023 10:22:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=9D=E8=AF=81=E9=87=91?= =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/system/merchant/Merchant.php | 2 +- app/controller/api/Auth.php | 8 ++------ .../api/store/merchant/Merchant.php | 13 +++++-------- app/listener/paySuccessMargin.php | 6 +++--- public/index.html | 2 +- public/static/images/GXSC/SS.png | Bin 5886 -> 2792 bytes public/static/images/LHYC/QB.png | Bin 1852 -> 2108 bytes 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index cb184416..4f006c3f 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -190,7 +190,7 @@ class Merchant extends BaseController */ public function checkParam(MerchantValidate $validate, $isUpdate = false) { - $data = $this->request->params([['area_id',0],['street_id',0],['village_id',0],['category_id', 0], ['type_id', 0], 'mer_name', 'commission_rate', 'real_name', 'mer_phone', 'mer_keyword', 'mer_address', 'mark', ['sort', 0], ['status', 0], ['is_audit', 0], ['is_best', 0], ['is_bro_goods', 0], ['is_bro_room', 0], ['is_trader', 0],'sub_mchid', 'auto_margin_rate', 'paid_margin']); + $data = $this->request->params([['area_id',0],['street_id',0],['village_id',0],['category_id', 0], ['type_id', 0], 'mer_name', 'commission_rate', 'real_name', 'mer_phone', 'mer_keyword', 'mer_address', 'mark', ['sort', 0], ['status', 0], ['is_audit', 0], ['is_best', 0], ['is_bro_goods', 0], ['is_bro_room', 0], ['is_trader', 0],'sub_mchid', 'auto_margin_rate', 'paid_margin', 'first_margin']); if (!$isUpdate) { $data += $this->request->params(['mer_account', 'mer_password']); }else { diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index bd0a4424..93b140a2 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -280,13 +280,9 @@ class Auth extends BaseController if (!$merchant) { return app('json')->fail('用户店铺异常'); } - $merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchant['type_id'])->find(); - if ($merchantTypeInfo['first_margin'] > 0) { - if (!$merchant['first_margin_status']) { - $merchant['margin'] = $merchantTypeInfo['first_margin']; - } + if ($merchant['first_margin'] > 0 && $merchant['first_margin_status'] == 0) { + $merchant['margin'] = $merchant['first_margin']; } - $repository = app()->make(StoreOrderRepository::class); $orderSn = "bzj" . date('YmdHis') . uniqid(); Db::name('margin_order')->insert([ diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 8bf7c8ba..c6c31de9 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -264,18 +264,15 @@ class Merchant extends BaseController if(empty($id)){ return app('json')->fail('参数不能为空'); } - $merchantInfo = Db::name('merchant')->where('mer_id',$id)->field('uid,mer_id,type_id,mer_name,margin,paid_margin,is_margin,first_margin_status')->find(); + $merchantInfo = Db::name('merchant')->where('mer_id',$id)->field('uid,mer_id,type_id,mer_name,margin,paid_margin,is_margin,first_margin,first_margin_status')->find(); if(empty($merchantInfo)){ return app('json')->fail('参数错误'); } $merchantInfo['unpaid_margin'] = $merchantInfo['margin']; - $merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find(); - if ($merchantTypeInfo['first_margin'] > 0) { - if ($merchantInfo['first_margin_status']) { - $merchantInfo['margin'] = $merchantInfo['margin']; - } else { - $merchantInfo['margin'] = $merchantTypeInfo['first_margin']; - } + if ($merchant['first_margin'] > 0 && $merchant['first_margin_status'] == 0) { + $merchantInfo['margin'] = $merchantInfo['first_margin']; + } else { + $merchantInfo['margin'] = $merchantTypeInfo['margin']; } return app('json')->success($merchantInfo); } diff --git a/app/listener/paySuccessMargin.php b/app/listener/paySuccessMargin.php index 1281a286..63dc7e83 100644 --- a/app/listener/paySuccessMargin.php +++ b/app/listener/paySuccessMargin.php @@ -31,9 +31,9 @@ class paySuccessMargin Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([ 'margin' => $marginAmount ]); - $merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find(); - if ($merchantTypeInfo['first_margin'] > 0) { - if (!$merchantInfo['first_margin_status'] && ($marginInfo['total_price'] <= $merchantTypeInfo['first_margin'])) { + + if ($merchantInfo['first_margin'] > 0 && $merchantInfo['first_margin_status'] == 0) { + if ($marginInfo['total_price'] <= $merchantTypeInfo['first_margin']) { Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([ 'first_margin_status' => 1 ]); diff --git a/public/index.html b/public/index.html index 1b842b3f..7c53bab1 100644 --- a/public/index.html +++ b/public/index.html @@ -2,4 +2,4 @@ document.write('') if(window.location.protocol == 'https:'){ document.write('') - }