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];