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,'房主收益');