Explorar o código

爆币40%。魅力榜,贡献榜,麦位红心,得礼物的人,平台抽成,房间抽成 ,消息通知,都折扣 40%

lizhen_gitee hai 1 ano
pai
achega
1eaa0e1def
Modificáronse 1 ficheiros con 13 adicións e 11 borrados
  1. 13 11
      application/api/controller/Party.php

+ 13 - 11
application/api/controller/Party.php

@@ -1890,14 +1890,7 @@ class Party extends Api
         if(in_array($userauthid,$user_id_arr)) $this->error("不可以赠送给自己!");
 
         $backGiftId = 0; //背包礼物表的 gift_id
-        $boxgiftInfo = [];
 
-        //每个人都能得到的礼物价值
-        $giftValue = 0;
-        //每个人都能得到的礼物价值
-        $getValue = 0;
-        //热度值
-        $hotValue = 0;
 
         Db::startTrans();
 
@@ -1948,6 +1941,9 @@ class Party extends Api
 
         }
 
+        //爆币基础要折扣,所以多两个变量
+        $giftValue_rate = $giftValue;
+        $giftCountValue_rate = $giftCountValue;
 
         //进行抽点设置
         $partyInfo = null;
@@ -1966,6 +1962,12 @@ class Party extends Api
             if(isset($giftInfo['is_baobi']) && $giftInfo['is_baobi'] == 1){
                 $platRate    = config('site.baobi_gift_platrate');
                 $guilderRate = config('site.baobi_gift_guilderrate');
+
+                //基数折扣
+                $baserate = config('site.baobi_gift_baserate') ?: 40;
+
+                $giftValue_rate = bcdiv(bcmul($giftValue_rate,$baserate),100);
+                $giftCountValue_rate = bcdiv(bcmul($giftCountValue_rate,$baserate),100);
             }
         }
 
@@ -2025,7 +2027,7 @@ class Party extends Api
                 $data["gift_gif_image"] = $giftInfo["image"];
                 $data["number"] = $number;
                 $data["price"] = $giftInfo["value"];
-                $data["value"] = $giftValue;
+                $data["value"] = $giftValue_rate;
 
 
                 //每个礼物都要计算平台抽成和房主抽成
@@ -2089,10 +2091,10 @@ class Party extends Api
 //                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $monthday . "m", $giftValue, $userauthid);
 
                         // tcp 更新用户魅力值
-                        $this->redis->zIncrBy("hourCharm_".$party_id, $giftValue, $user_id);
+                        $this->redis->zIncrBy("hourCharm_".$party_id, $giftValue_rate, $user_id);
 
                         // tcp 更新用户贡献值
-                        $this->redis->zIncrBy("hourWealth_".$party_id, $giftValue, $userauthid);
+                        $this->redis->zIncrBy("hourWealth_".$party_id, $giftValue_rate, $userauthid);
 
 
                     }
@@ -2103,7 +2105,7 @@ class Party extends Api
                     $res_charm = \app\common\model\User::add_charm_level($user_id,$giftValue);
                     */
                     // +message
-                    \app\common\model\Message::addMessage($user_id,"礼物通知","收到 ".$this->auth->nickname." 赠送的".$giftInfo["name"]." x".$number." 价值 ".$giftValue ." 金币");
+                    \app\common\model\Message::addMessage($user_id,"礼物通知","收到 ".$this->auth->nickname." 赠送的".$giftInfo["name"]." x".$number." 价值 ".$giftValue_rate ." 金币");
 
 
                 }