|  | @@ -1492,6 +1492,22 @@ class Party extends Common
 | 
	
		
			
				|  |  |          return $giftInfo;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 单独赠送礼物,一键清空背包
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    public function giveAllbackGiftToYou(){
 | 
	
		
			
				|  |  | +        // 接口防并发
 | 
	
		
			
				|  |  | +        if (!$this->apiLimit(1, 1000)) {
 | 
	
		
			
				|  |  | +            $this->error(__('Operation frequently'));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        $user_ids = $this->request->request("user_id");// 赠送对象
 | 
	
		
			
				|  |  | +        $party_id = $this->request->request("party_id",0);// 派对ID
 | 
	
		
			
				|  |  | +        $room_type = $this->request->request('room_type',1); // 房间类型
 | 
	
		
			
				|  |  | +        $is_back = 1; // 是否背包赠送: 1=是,0=否
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (!$user_ids || !in_array($room_type,[1,2])) $this->error(__('Invalid parameters'));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 全麦/单独赠送礼物
 | 
	
	
		
			
				|  | @@ -1583,6 +1599,7 @@ class Party extends Common
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 转换声币后 再进行抽点设置
 | 
	
		
			
				|  |  | +        $partyInfo = null;
 | 
	
		
			
				|  |  |          if(!$party_id) {
 | 
	
		
			
				|  |  |              $platRate = 10;
 | 
	
		
			
				|  |  |              $guilderRate = 30;
 | 
	
	
		
			
				|  | @@ -1593,13 +1610,11 @@ class Party extends Common
 | 
	
		
			
				|  |  |              $guilderRate = $partyInfo->guilderRate; // 工会长抽成百分比
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        $platValue = bcmul($platRate/100,$getValue,2);
 | 
	
		
			
				|  |  | -        $guilderValue = bcmul($guilderRate/100,$getValue,2);
 | 
	
		
			
				|  |  | +        $platValue = bcmul($platRate/100,$getValue);
 | 
	
		
			
				|  |  | +        $guilderValue = bcmul($guilderRate/100,$getValue);
 | 
	
		
			
				|  |  |          $getValue = bcsub(bcsub($getValue,$platValue),$guilderValue);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  //        $gif_image = $is_back==1?$giftInfo["gif_image"]:$giftInfo["special"];
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          $returnData = [];
 | 
	
		
			
				|  |  |          Db::startTrans();
 | 
	
		
			
				|  |  |          try {
 | 
	
	
		
			
				|  | @@ -1703,7 +1718,10 @@ class Party extends Common
 | 
	
		
			
				|  |  |                      $usersoundcoinlogModel->addUserSoundcoinLog($partyInfo->user_id, $guilderValue, "+", $touserInfo["sound_coin"], "{$this->auth->nickname}送礼物{$giftInfo['name']}x{$number}给{$touserInfo['nickname']},房间礼物抽成", 4, $giftuserpartyModel->id);
 | 
	
		
			
				|  |  |                  }*/
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                if ($res1 && $res2 && $res5) {
 | 
	
		
			
				|  |  | +                //总消费增加
 | 
	
		
			
				|  |  | +                $res6 = Db::name('user')->where('id',$user_id)->setInc("renewcount", $giftCountValue);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if ($res1 && $res2 && $res5 && $res6) {
 | 
	
		
			
				|  |  |                      $i++;
 | 
	
		
			
				|  |  |                      if($party_id > 0) {
 | 
	
		
			
				|  |  |                          // 添加redis记录做财富排行榜日榜用
 | 
	
	
		
			
				|  | @@ -1743,11 +1761,17 @@ class Party extends Common
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      // 增加用户经验值
 | 
	
		
			
				|  |  | -                    \app\common\model\User::addEmpirical($this->auth->id,$getempirical);
 | 
	
		
			
				|  |  | +                    $res = \app\common\model\User::addEmpirical($this->auth->id,$getempirical);
 | 
	
		
			
				|  |  | +                    if ($res){
 | 
	
		
			
				|  |  | +                        $this->auth->level = $res->level;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      // +exp
 | 
	
		
			
				|  |  |                      \app\common\model\TaskLog::tofinish($this->auth->id,"OBHqCX4g",$number);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                    //贵族升级处理
 | 
	
		
			
				|  |  | +                    $this->checkBeNoble($redis,$this->auth->id,$giftCountValue);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                      // +message
 | 
	
		
			
				|  |  |                      \app\common\model\Message::addMessage($user_id,"礼物通知","收到 ".$this->auth->nickname." 赠送的".$giftInfo["name"]." x".$number);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1787,7 +1811,6 @@ class Party extends Common
 | 
	
		
			
				|  |  |              // tcp 获取房间用户周前三名
 | 
	
		
			
				|  |  |              $partyUserTop = $this->getPartyUserTop($party_id, $room_type);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              if($i == $userCount) {
 | 
	
		
			
				|  |  |                  $returnData["userCharm"] = $userCharm;
 | 
	
		
			
				|  |  |                  $returnData["partyHot"] = $this->changeW($partyHot);
 |