diff --git a/app/Controller/Api/SystemController.php b/app/Controller/Api/SystemController.php index d125aac..c21864a 100644 --- a/app/Controller/Api/SystemController.php +++ b/app/Controller/Api/SystemController.php @@ -17,6 +17,8 @@ use Hyperf\HttpServer\Annotation\Middleware; use Hyperf\HttpServer\Annotation\Middlewares; use Hyperf\HttpServer\Annotation\RequestMapping; use Hyperf\Validation\Annotation\Scene; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; #[Controller(prefix: 'api/system')] @@ -58,7 +60,13 @@ class SystemController extends AbstractController return (new IndexService)->handle(); } + /** + * @return array + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ #[RequestMapping(path: "sts/accredit", methods: "GET")] + #[Scene(scene: 'sts_accredit')] #[Middleware(JwtAuthMiddleware::class)] public function aliSts() { diff --git a/app/Service/Api/Order/ConfirmationOrderService.php b/app/Service/Api/Order/ConfirmationOrderService.php index ca6d971..f6670b7 100644 --- a/app/Service/Api/Order/ConfirmationOrderService.php +++ b/app/Service/Api/Order/ConfirmationOrderService.php @@ -72,7 +72,7 @@ class ConfirmationOrderService extends BaseOrderService foreach ($filtered as &$value) { $value['amount'] = match ($value['coupon_type']) { CouponCode::COUPON_TYPE_INSTANT_REDUCTION => $value['amount'], - CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("1", $value['ratio'],2),$orderMaxPrice,2), + CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("1", (string)$value['ratio'],2),(string)$orderMaxPrice,2), default => 0 }; diff --git a/app/Service/ServiceTrait/Api/OrderTrait.php b/app/Service/ServiceTrait/Api/OrderTrait.php index 760cf7d..6d7f7ef 100644 --- a/app/Service/ServiceTrait/Api/OrderTrait.php +++ b/app/Service/ServiceTrait/Api/OrderTrait.php @@ -418,8 +418,8 @@ trait OrderTrait $this->orderRes['favorable_good_price'] = $this->orderRes['coupon']['coupon_type'] == CouponCode::COUPON_TYPE_INSTANT_REDUCTION ? min($this->orderRes['coupon']['amount'], $this->orderRes['good_after_discount_price']) : $this->orderRes['coupon']['amount']; - $this->orderRes['good_after_discount_price'] = bcsub($this->orderRes['good_after_discount_price'],$this->orderRes['favorable_good_price'],2); - $this->orderRes['actual_price'] = bcsub($this->orderRes['actual_price'],$this->orderRes['favorable_good_price'],2); + $this->orderRes['good_after_discount_price'] = bcsub((string)$this->orderRes['good_after_discount_price'],(string)$this->orderRes['favorable_good_price'],2); + $this->orderRes['actual_price'] = bcsub((string)$this->orderRes['actual_price'],(string)$this->orderRes['favorable_good_price'],2); } /**