From ca00b1ab27a1eaec170687bc4cf3472e8f1e6bd1 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Sat, 9 Mar 2024 16:50:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E6=88=B7=E6=8A=BC?= =?UTF-8?q?=E9=87=91=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/server/StoreOrder.php | 6 +++--- app/controller/api/store/merchant/Merchant.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controller/api/server/StoreOrder.php b/app/controller/api/server/StoreOrder.php index 571d5182..7feaef9f 100755 --- a/app/controller/api/server/StoreOrder.php +++ b/app/controller/api/server/StoreOrder.php @@ -405,14 +405,14 @@ class StoreOrder extends BaseController return app('json')->success($list); } - + /** * 获取商户押金列表 */ public function getOrderAutoMarginList($merId){ [$page, $limit] = $this->getPage(); - $select= Db::name('financial_record')->where('mer_id',$merId)->where('type',1) - ->where('financial_type','auto_margin')->where('financial_pm',0) + $select= Db::name('financial_record')->where('mer_id',$merId) + ->where('financial_type','auto_margin') ->page($page)->limit($limit)->order('financial_record_id','desc')->select(); return app('json')->success($select); diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index a0b046a4..fe71060d 100755 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -301,10 +301,10 @@ class Merchant extends BaseController if (empty($merchantInfo)) { return app('json')->fail('参数错误'); } - $margin = Db::name('MerchantType')->where('mer_type_id', $merchantInfo['type_id'])->value('margin'); - $merchantInfo['unpaid_margin'] = bcsub($margin, $merchantInfo['paid_margin'], 2); - if ($merchantInfo['margin'] == 0) { - $merchantInfo['margin'] = $merchantInfo['unpaid_margin']; + $merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2); + if ($merchantInfo['margin'] <= 0) { + $merchantInfo['unpaid_margin'] = 0; + $merchantInfo['paid_margin'] = 0; } return app('json')->success($merchantInfo); }