From 0aa351cd63de1901d75cb680f47ec3e2797fee99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Sat, 3 Jan 2026 18:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=A3=85=E6=89=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Decorate.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/application/api/model/Decorate.php b/application/api/model/Decorate.php index b9dcb6ee..af418f0d 100644 --- a/application/api/model/Decorate.php +++ b/application/api/model/Decorate.php @@ -95,11 +95,13 @@ class Decorate extends Model $v['base_image'] = localpath_to_netpath($v['base_image']); $v['play_image'] = localpath_to_netpath($v['play_image']); $v['price'] = (int)$v['price']; - if(isset($v['discount']) && ($v['discount']<=0 || $v['discount']>=10)){ - $v['discount'] = 0; - $v['discount_str'] = "无折扣"; - }else{ - $v['discount_str'] = $v['discount']."折"; + if(isset($v['discount'])){ + if($v['discount']<=0 || $v['discount']>=10){ + $v['discount'] = 0; + $v['discount_str'] = "无折扣"; + }else{ + $v['discount_str'] = $v['discount']."折"; + } } } return ['code' => 1, 'msg' => '获取成功', 'data' => $list];