From 550b1e4fd9b8add0344708db3eed8f096f2048f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Thu, 4 Dec 2025 14:25:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A-=20=E7=88=B5?= =?UTF-8?q?=E4=BD=8D=E7=BB=AD=E8=B4=B9=E9=99=90=E5=88=B6-=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Nobility.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/api/model/Nobility.php b/application/api/model/Nobility.php index 72f1f8c..e47f698 100644 --- a/application/api/model/Nobility.php +++ b/application/api/model/Nobility.php @@ -135,7 +135,7 @@ class Nobility extends Model ->where('lid', $lid) ->find(); if (!$nobility_info) { - return ['code' => 0, 'msg' => '爵位不存在']; + return ['code' => 0, 'msg' => '爵位不存在', 'data' => null]; } $user_info = db::name('user') ->field('id,nickname,avatar') @@ -143,7 +143,7 @@ class Nobility extends Model ->where('id', $user_id) ->find(); if (!$user_info) { - return ['code' => 0, 'msg' => '用户不存在']; + return ['code' => 0, 'msg' => '用户不存在', 'data' => null]; } $user_nobility_info = db::name('vs_user_nobility') ->field('id,user_id,lid,end_time') @@ -162,7 +162,7 @@ class Nobility extends Model //判断是否可以续费 $end_time_to_day = floor($end_time / 86400); if($end_time_to_day > $nobility_info['day'] * 2){ - return ['code' => 0, 'msg' => '已超过2倍有效期,无序续费']; + return ['code' => 0, 'msg' => '已超过2倍有效期,无序续费', 'data' => null]; } $data = [ 'end_time' => $end_time, @@ -170,7 +170,7 @@ class Nobility extends Model ]; $re = db::name('vs_user_nobility')->where('id', $user_nobility_info['id'])->update($data); if (!$re) { - return ['code' => 0, 'msg' => '失败']; + return ['code' => 0, 'msg' => '失败', 'data' => null]; } }else{ //升级 @@ -190,7 +190,7 @@ class Nobility extends Model db::name('vs_user_nobility')->where('id', $user_nobility_info['id'])->update(['delete_time'=>time()]); $re = db::name('vs_user_nobility')->insert($data); if (!$re) { - return ['code' => 0, 'msg' => '失败']; + return ['code' => 0, 'msg' => '失败', 'data' => null]; } } }else{ //未购买 新购 @@ -204,7 +204,7 @@ class Nobility extends Model ]; $re = db::name('vs_user_nobility')->insert($data); if (!$re) { - return ['code' => 0, 'msg' => '失败']; + return ['code' => 0, 'msg' => '失败', 'data' => null]; } } //记录日志 @@ -237,7 +237,7 @@ class Nobility extends Model if($pay_coin > 0){ $reslut = model('common/UserWallet')->change_user_money($user_id, $pay_coin, model('common/UserWallet')::MONEYTYPECOIN, model('common/UserWallet')::NOBILITY_PURCHASE_COIN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::NOBILITY_PURCHASE_COIN)); if (!$reslut) { - return ['code' => 0, 'msg' => '失败']; + return ['code' => 0, 'msg' => '失败', 'data' => null]; } } return ['code' => 1, 'msg' => '成功']; @@ -251,7 +251,7 @@ class Nobility extends Model ->where('lid', $lid) ->find(); if (!$nobility_info) { - return ['code' => 0, 'msg' => '爵位不存在']; + return ['code' => 0, 'msg' => '爵位不存在', 'data' => null]; } $user_info = db::name('user') ->field('id,nickname,avatar') @@ -259,7 +259,7 @@ class Nobility extends Model ->where('id', $user_id) ->find(); if (!$user_info) { - return ['code' => 0, 'msg' => '用户不存在']; + return ['code' => 0, 'msg' => '用户不存在', 'data' => null]; } $user_nobility_info = db::name('vs_user_nobility') ->field('id,user_id,lid,end_time') @@ -275,7 +275,7 @@ class Nobility extends Model //判断是否可以续费 $end_time_to_day = floor($end_time / 86400); if($end_time_to_day > $nobility_info['day'] * 2){ - return ['code' => 0, 'msg' => '已超过2倍有效期,无序续费']; + return ['code' => 0, 'msg' => '已超过2倍有效期,无序续费', 'data' => null]; } }else{ //升级 $old_nobility_info = db::name('vs_nobility')