diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index 779ef358..643f7d96 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,10 +65,14 @@ class Category extends Controller foreach ($hasGoods as $v) { $arr[] = $v['category_id']; } + } else { + return $this->renderSuccess(compact('list')); } - + if (!empty($arr)) { $arr1 = ['cataIds' => $arr]; + } else { + return $this->renderSuccess(compact('list')); } $list = $model->getListPublic($this->request->param(), $arr1); 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); //累计商户余额支付金额 diff --git a/app/common/model/Merchant.php b/app/common/model/Merchant.php index 44136f60..42b6a337 100644 --- a/app/common/model/Merchant.php +++ b/app/common/model/Merchant.php @@ -146,7 +146,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);