From 6f511d649af471df6e049e1a46207ee60d922a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Sat, 1 Jun 2024 18:53:51 +0800 Subject: [PATCH 1/3] 11 --- app/api/controller/Category.php | 3 +++ app/api/service/order/PaySuccess.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index 779ef358..2545a85b 100644 --- a/app/api/controller/Category.php +++ b/app/api/controller/Category.php @@ -55,6 +55,7 @@ class Category extends Controller public function listmerchant(): Json { + $list = []; $merchantId = (int)$this->request->param('merchantId', 0); $model = new CategoryModel; $hasGoods = GoodsCategoryRel::getcategory($this->storeId,$merchantId); @@ -64,6 +65,8 @@ class Category extends Controller foreach ($hasGoods as $v) { $arr[] = $v['category_id']; } + } else { + return $this->renderSuccess(compact('list')); } if (!empty($arr)) { diff --git a/app/api/service/order/PaySuccess.php b/app/api/service/order/PaySuccess.php index 1a2b6271..e805693b 100644 --- a/app/api/service/order/PaySuccess.php +++ b/app/api/service/order/PaySuccess.php @@ -360,7 +360,7 @@ class PaySuccess extends BaseService if ($model['commission_ratio']) { $precent = (1 - $model['commission_ratio'] / 1000); } - $precentPrice = $precent * $orderInfo['pay_price']; + $precentPrice = round($precent * $orderInfo['pay_price'], 2); (new merchantPayModel())->addDetail($orderInfo, $precentPrice); //累计商户余额支付金额 From aaefee8a72ef7a3683391c14092ba49e3afc9a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Sat, 1 Jun 2024 18:57:22 +0800 Subject: [PATCH 2/3] 1 --- app/api/controller/Category.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index 2545a85b..8b0c773e 100644 --- a/app/api/controller/Category.php +++ b/app/api/controller/Category.php @@ -71,6 +71,8 @@ class Category extends Controller if (!empty($arr)) { $arr1 = ['cataIds' => $arr]; + } else { + return $this->renderSuccess(compact('list')); } $list = $model->getListPublic($this->request->param(), $arr1); From 275047fb889b254078c3780fdfa151a9290a58a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Sat, 1 Jun 2024 19:08:20 +0800 Subject: [PATCH 3/3] 1 --- app/api/controller/Category.php | 2 +- app/common/model/Merchant.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index 8b0c773e..643f7d96 100644 --- a/app/api/controller/Category.php +++ b/app/api/controller/Category.php @@ -68,7 +68,7 @@ class Category extends Controller } else { return $this->renderSuccess(compact('list')); } - + if (!empty($arr)) { $arr1 = ['cataIds' => $arr]; } else { diff --git a/app/common/model/Merchant.php b/app/common/model/Merchant.php index 696814df..c712ec56 100644 --- a/app/common/model/Merchant.php +++ b/app/common/model/Merchant.php @@ -145,7 +145,7 @@ class Merchant extends BaseModel * @param float $money * @return mixed */ - public static function setIncTotal(int $merchantId, float $money) + public static function setIncTotal(int $merchantId, $money) { (new static)->setInc($merchantId, 'total_amount', $money); (new static)->setInc($merchantId, 'available_amount', $money);