|
@@ -214,12 +214,12 @@ class Party extends Common
|
|
|
*/
|
|
|
public function savePartyStatus() {
|
|
|
$party_id = $this->request->request('party_id'); // 派对ID
|
|
|
- $room_type = $this->request->request('room_type',1); // 房间类型:1=派对,2=直播
|
|
|
+ $room_type = 1; // 房间类型:1=派对,2=直播
|
|
|
if (!$party_id || !in_array($room_type,[1,2])) $this->error(__('Invalid parameters'));
|
|
|
$user_id = $this->auth->id;
|
|
|
$partyInfo = \app\common\model\Party::get($party_id);
|
|
|
if($partyInfo->status < 0) $this->error("当前状态不支持变更!");
|
|
|
- if($partyInfo->user_id !== $user_id) $this->error("当前账号异常,非工会长禁止操作!");
|
|
|
+ if($partyInfo->user_id !== $user_id) $this->error("当前账号异常,非房主禁止操作!");
|
|
|
$partyInfo->status = 1;
|
|
|
$res = $partyInfo->save();
|
|
|
|
|
@@ -237,7 +237,7 @@ class Party extends Common
|
|
|
$redPartyInfo["status"] = 1;
|
|
|
$redis->set($this->roomTypeArr[$room_type]."_".$partyInfo["id"],json_encode($redPartyInfo));
|
|
|
}
|
|
|
- $this->success("更新公会状态成功!");
|
|
|
+ $this->success("更新房间状态成功!");
|
|
|
} else {
|
|
|
$this->error("网络错误,请稍后重试!");
|
|
|
}
|
|
@@ -411,7 +411,7 @@ class Party extends Common
|
|
|
$party_id = $this->request->request('party_id',0,"intval"); // 直播间ID
|
|
|
$user_id = $this->request->request('user_id',0,"intval"); // 用户ID
|
|
|
$upOrdown = $this->request->request('upordown'); // 上下麦:1=上麦-1=下麦
|
|
|
- $room_type = $this->request->request('room_type',1); // 房间类型
|
|
|
+ $room_type = 1; // 房间类型
|
|
|
$avatar = $this->request->request('avatar'); // 用户头像 (upOrdown参数为-1时可以不传)
|
|
|
$position = $this->request->request('position'); // 麦位置:0=支持人,1=1号麦,2=2号麦,3=3号麦,4=4号麦
|
|
|
if (!$party_id || !$user_id || !in_array($position,[0,1,2,3,4,5,6,7,8]) || !in_array($upOrdown,[1,-1])) {
|
|
@@ -1267,8 +1267,8 @@ class Party extends Common
|
|
|
*/
|
|
|
public function getPatyIspass() {
|
|
|
$party_id = $this->request->request("party_id");// 派对ID
|
|
|
- $room_type = $this->request->request("room_type",1);//
|
|
|
- $is_miniprogram = $this->request->request("is_miniprogram",0);//
|
|
|
+ $room_type = 1;
|
|
|
+ $is_miniprogram = 0;//
|
|
|
if (!$party_id) $this->error(__('Invalid parameters'));
|
|
|
|
|
|
$user_id = $this->auth->id;
|
|
@@ -1290,43 +1290,7 @@ class Party extends Common
|
|
|
$data = [];
|
|
|
$data["status"] = 0;
|
|
|
$data["is_pass"] = $partyInfo["party_pass"]?1:0;
|
|
|
- if($partyInfo["user_id"] == $user_id || $this->auth->mobile == '17353993050') $data["is_pass"] = 0;
|
|
|
-
|
|
|
- if($is_miniprogram == 1) { // 小程序单独处理
|
|
|
- // 判断当前用户是否被该房间设置限制 //项目:1=房管,2=禁言,3=拉黑,4=踢出
|
|
|
- $lsetList = [];
|
|
|
- for($i=1;$i<=4;$i++) {
|
|
|
- $hgetlist = $redis->hGet("party_manage_".$party_id,$user_id."-".$i);
|
|
|
-
|
|
|
- $hgetlist = unserialize($hgetlist);
|
|
|
- $restime = time() - intval($hgetlist["createtime"]);
|
|
|
-
|
|
|
- // 房管
|
|
|
- if($hgetlist && $i == 1) $lsetList["manage_restime"] = "";
|
|
|
- // 禁言
|
|
|
- if($hgetlist && $i == 2 && $restime < $hgetlist["time"]) $lsetList["manage_notalk"] = $restime;
|
|
|
- // 拉黑
|
|
|
- if($hgetlist && $i == 3 && $restime < $hgetlist["time"]) {
|
|
|
- $restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
|
|
|
- $lsetList["manage_black"] = $restime;
|
|
|
- $lsetList["tips"] = '您已被该房间拉黑,解除时间:'.$restime;
|
|
|
-// $this->error(__('您已被该房间拉黑,解除时间:'.$restime));
|
|
|
- break;
|
|
|
- }
|
|
|
- // 踢出
|
|
|
- if($hgetlist && $i == 4 && $restime < $hgetlist["time"]) {
|
|
|
- $restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
|
|
|
- $lsetList["manage_takeout"] = $restime;
|
|
|
- $lsetList["tips"] = '您已被该房间踢出,解除时间:'.$restime;
|
|
|
-// $this->error(__('您已被该房间踢出,解除时间:'.$restime));
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if($lsetList) {
|
|
|
- $data["status"] = 1;
|
|
|
- $data["hgetlist"] = $lsetList;
|
|
|
- }
|
|
|
- }
|
|
|
+ if($partyInfo["user_id"] == $user_id || $this->auth->mobile == '18560505277') $data["is_pass"] = 0;
|
|
|
|
|
|
$this->success("获取成功!",$data);
|
|
|
}
|
|
@@ -1345,8 +1309,8 @@ class Party extends Common
|
|
|
*/
|
|
|
public function getPartGifList()
|
|
|
{
|
|
|
- $type_id = $this->request->request("type_id", 1);// 类型ID
|
|
|
- $list = \app\common\model\PartyGif::field("id,gif_image")->where('party_gif_type_id', $type_id)->order("weight", "asc")->select();
|
|
|
+// $type_id = $this->request->request("type_id", 1);// 类型ID
|
|
|
+ $list = \app\common\model\PartyGif::field("id,gif_image")->order("weight", "asc")->select();
|
|
|
$this->success("获取成功!", $list);
|
|
|
}
|
|
|
|
|
@@ -1360,7 +1324,7 @@ class Party extends Common
|
|
|
/**
|
|
|
* 随机获取礼物盒礼物
|
|
|
*/
|
|
|
- private function getBoxGift($gift_box_type) {
|
|
|
+ /*private function getBoxGift($gift_box_type) {
|
|
|
// 查询本奖池内礼物是否还有可抽礼物
|
|
|
$where = [];
|
|
|
$where["Jackpot_id"] = $gift_box_type;
|
|
@@ -1384,7 +1348,7 @@ class Party extends Common
|
|
|
$giftInfo = $giftArr[$giftids];
|
|
|
|
|
|
return $giftInfo;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -1398,7 +1362,7 @@ class Party extends Common
|
|
|
$user_ids = $this->request->request("user_id");// 赠送对象
|
|
|
$gift_id = $this->request->request("gift_id");// 礼物ID
|
|
|
$party_id = $this->request->request("party_id",0);// 派对ID
|
|
|
- $room_type = $this->request->request('room_type',1); // 房间类型
|
|
|
+ $room_type = 1; // 房间类型
|
|
|
$number = $this->request->request("number");// 赠送数量
|
|
|
$is_back = $this->request->request("is_back",0);// 是否背包赠送: 1=是,0=否
|
|
|
if (!$user_ids || !in_array($is_back,[0,1]) || !$gift_id || !$number || !in_array($room_type,[1,2])) $this->error(__('Invalid parameters'));
|
|
@@ -1446,10 +1410,10 @@ class Party extends Common
|
|
|
$giftCountValue = $giftInfo["value"] * $number * $userCount;
|
|
|
$getValue = $giftValue;
|
|
|
// 判断如果是礼物盒则随机开礼物盒礼物
|
|
|
- if($giftInfo->box_type > 0) {
|
|
|
+ /*if($giftInfo->box_type > 0) {
|
|
|
$boxgiftInfo = $this->getBoxGift($giftInfo->box_type);
|
|
|
$getValue = $boxgiftInfo["price"];
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 判断当前用户余额
|
|
|
$where = [];
|