ソースを参照

送礼的魅力值和财富值

lizhen_gitee 1 年間 前
コミット
838825defd
2 ファイル変更7 行追加7 行削除
  1. 1 1
      application/api/controller/Party.php
  2. 6 6
      application/common/model/User.php

+ 1 - 1
application/api/controller/Party.php

@@ -1901,7 +1901,7 @@ class Party extends Common
             }
 
             //增加送礼用户的财富等级
-            $res_wealth = \app\common\model\User::add_wearth_level($this->auth->id,$allVal);
+            $res_wealth = \app\common\model\User::add_wealth_level($this->auth->id,$allVal);
 
             // tcp 获取房间用户周前三名
             $partyUserTop = $this->getPartyUserTop($party_id, $room_type);

+ 6 - 6
application/common/model/User.php

@@ -361,17 +361,17 @@ class User extends Model
     /**
      * 增加财富等级
      */
-    public static function add_wearth_level($user_id,$empirical) {
+    public static function add_wealth_level($user_id,$empirical) {
         if($empirical <= 0) return false;
         // 获取用户经验值
-        $userInfo = \app\common\model\User::field("id,wearth_level,wearth_empirical")->where(["id"=>$user_id])->find();
+        $userInfo = \app\common\model\User::field("id,wealth_level,wealth_empirical")->where(["id"=>$user_id])->find();
         if(!$userInfo) return false;
-        $userempirical = $userInfo["wearth_empirical"];
+        $userempirical = $userInfo["wealth_empirical"];
 
         // 增加之后的经验值
         $empirical = $userempirical + $empirical;
         // 查询等级配置信息
-        $levelconfigModel = Db::name('user_config_wearth');
+        $levelconfigModel = Db::name('user_config_wealth');
         $where = [];
         $where["empirical"] = ["elt",$empirical];
         $userexplainstart = $levelconfigModel->where($where)->order("empirical","desc")->limit(1)->select();
@@ -384,8 +384,8 @@ class User extends Model
 
         // 更新用户等级信息和经验值
         $data = [];
-        $data["wearth_level"] = $userexplainlevel;
-        $data["wearth_empirical"] = $empirical;
+        $data["wealth_level"] = $userexplainlevel;
+        $data["wealth_empirical"] = $empirical;
         $where = [];
         $where["id"] = $user_id;
         $res = \app\common\model\User::update($data,$where);