From 826392fbda42bead84950166f8756e4862c6e982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Fri, 26 Sep 2025 10:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E4=B8=BB=E6=94=B6=E7=9B=8A=E4=B8=BA0?= =?UTF-8?q?=20=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/GiveGift.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/api/model/GiveGift.php b/application/api/model/GiveGift.php index 5085fb0..b887513 100644 --- a/application/api/model/GiveGift.php +++ b/application/api/model/GiveGift.php @@ -262,11 +262,14 @@ class GiveGift extends Model } //增加房主收益并记录日志 $room_owner_earningss = $room_owner_earnings - $host_earnings; - $room_owner_earning = $this -> change_user_cion_or_earnings_log($room_owner,$room_owner_earningss,$from_id,2,18,'房主收益'); - if(!$room_owner_earning){ - Db::rollback(); - return ['code' => 0, 'msg' => '房主收益失败', 'data' => null]; + if($room_owner_earningss > 0){ + $room_owner_earning = $this -> change_user_cion_or_earnings_log($room_owner,$room_owner_earningss,$from_id,2,18,'房主收益'); + if(!$room_owner_earning){ + Db::rollback(); + return ['code' => 0, 'msg' => '房主收益失败', 'data' => null]; + } } + }else{ //增加房主收益并记录日志 $room_owner_earning = $this -> change_user_cion_or_earnings_log($room_owner,$room_owner_earnings,$from_id,2,18,'房主收益');