|
@@ -1197,10 +1197,10 @@ class Party extends Api
|
|
}
|
|
}
|
|
|
|
|
|
//腾讯im设置管理员
|
|
//腾讯im设置管理员
|
|
- private function setGroupAdmin($user_id,$party_id,$status)
|
|
|
|
|
|
+ private function setGroupAdmin($user_id,$easemob_room_id)
|
|
{
|
|
{
|
|
- $tenIm = new Tenim();
|
|
|
|
- return $tenIm->setUpIMAdmin($user_id, $party_id,$status);
|
|
|
|
|
|
+ $easemob = new Easemob();
|
|
|
|
+ $easemob->room_promoteRoomAdmin($user_id,$easemob_room_id);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1215,19 +1215,21 @@ class Party extends Api
|
|
$this->error(__('Invalid parameters'));
|
|
$this->error(__('Invalid parameters'));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //2=禁言,3=拉黑,4=踢出 ,都要有时间
|
|
if($item>1 && $time<=0) {
|
|
if($item>1 && $time<=0) {
|
|
$this->error(__('时间设置有误'));
|
|
$this->error(__('时间设置有误'));
|
|
}
|
|
}
|
|
|
|
|
|
- $partyUserId = \app\common\model\Party::where('id', $party_id)->value('user_id');
|
|
|
|
- if ($partyUserId == $user_id && in_array($item, [2, 3, 4])) {
|
|
|
|
|
|
+ //不能对房主恶意操作
|
|
|
|
+ $partyinfo = \app\common\model\Party::where('id', $party_id)->field('user_id,easemob_room_id')->find();
|
|
|
|
+ if ($partyinfo['user_id'] == $user_id && in_array($item, [2, 3, 4])) {
|
|
$this->error("您当前无权限操作!");
|
|
$this->error("您当前无权限操作!");
|
|
}
|
|
}
|
|
|
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- $userInfo = \app\common\model\User::field("avatar,nickname,gender,level")->where(["id"=>$user_id])->find();
|
|
|
|
|
|
+ $userInfo = \app\common\model\User::field("avatar,nickname,gender")->where(["id"=>$user_id])->find();
|
|
if(!$userInfo) $this->error("用户信息获取失败!");
|
|
if(!$userInfo) $this->error("用户信息获取失败!");
|
|
- // 贵族防踢。
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
$data = [];
|
|
$data = [];
|
|
@@ -1235,13 +1237,16 @@ class Party extends Api
|
|
$data["avatar"] = $userInfo->avatar;
|
|
$data["avatar"] = $userInfo->avatar;
|
|
$data["nickname"] = $userInfo->nickname;
|
|
$data["nickname"] = $userInfo->nickname;
|
|
$data["gender"] = $userInfo->gender;
|
|
$data["gender"] = $userInfo->gender;
|
|
- $data["level"] = $userInfo->level;
|
|
|
|
$data["item"] = $item;
|
|
$data["item"] = $item;
|
|
$data["time"] = $time;
|
|
$data["time"] = $time;
|
|
$data["createtime"] = time();
|
|
$data["createtime"] = time();
|
|
|
|
|
|
$res = $this->redis->hSet("party_manage_".$party_id,$user_id."-".$item,serialize($data));
|
|
$res = $this->redis->hSet("party_manage_".$party_id,$user_id."-".$item,serialize($data));
|
|
|
|
|
|
|
|
+ if ($item==1) {
|
|
|
|
+ $this->setGroupAdmin($user_id,$partyinfo['easemob_room_id']);
|
|
|
|
+ }
|
|
|
|
+
|
|
if($res !== false) {
|
|
if($res !== false) {
|
|
$this->success("设置成功!",$data);
|
|
$this->success("设置成功!",$data);
|
|
} else {
|
|
} else {
|
|
@@ -1602,7 +1607,7 @@ class Party extends Api
|
|
}
|
|
}
|
|
|
|
|
|
$userauthid = $this->auth->id;
|
|
$userauthid = $this->auth->id;
|
|
- $money_to_jewel = config('site.money_to_jewel') ?: 10; //余额兑换钻石
|
|
|
|
|
|
+ $money_to_jewel = config('site.money_to_jewel') ?: 10; //余额兑换金币
|
|
|
|
|
|
// 不可以赠送给自己
|
|
// 不可以赠送给自己
|
|
//if(in_array($userauthid,$user_id_arr)) $this->error("不可以赠送给自己!");
|
|
//if(in_array($userauthid,$user_id_arr)) $this->error("不可以赠送给自己!");
|
|
@@ -1668,7 +1673,7 @@ class Party extends Api
|
|
$giftCountValue = $giftInfo["value"] * $number * $userCount;
|
|
$giftCountValue = $giftInfo["value"] * $number * $userCount;
|
|
$user_jewel = model('wallet')->getWallet($this->auth->id,'jewel');
|
|
$user_jewel = model('wallet')->getWallet($this->auth->id,'jewel');
|
|
if($user_jewel < $giftCountValue){
|
|
if($user_jewel < $giftCountValue){
|
|
- $this->error("您的钻石余额不足!");
|
|
|
|
|
|
+ $this->error("您的金币余额不足!");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1726,7 +1731,7 @@ class Party extends Api
|
|
} else {
|
|
} else {
|
|
$res1 = true;
|
|
$res1 = true;
|
|
|
|
|
|
- // 扣除当前用户钻石余额
|
|
|
|
|
|
+ // 扣除当前用户金币余额
|
|
$rs_wallet = model('wallet')->lockChangeAccountRemain($userauthid, $giftValue, '-', 0, "赠送礼物:'" . $giftInfo["name"] . "',扣除" . $giftValue . "金币!", 3,'jewel');
|
|
$rs_wallet = model('wallet')->lockChangeAccountRemain($userauthid, $giftValue, '-', 0, "赠送礼物:'" . $giftInfo["name"] . "',扣除" . $giftValue . "金币!", 3,'jewel');
|
|
if($rs_wallet['status'] == false){
|
|
if($rs_wallet['status'] == false){
|
|
Db::rollback();
|
|
Db::rollback();
|
|
@@ -1845,7 +1850,7 @@ class Party extends Api
|
|
\app\common\model\TaskLog::tofinish($this->auth->id,"OBHqCX4g",$number);
|
|
\app\common\model\TaskLog::tofinish($this->auth->id,"OBHqCX4g",$number);
|
|
*/
|
|
*/
|
|
// +message
|
|
// +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 ." 金币");
|
|
|
|
|
|
$allVal = $allVal + $hotValue;
|
|
$allVal = $allVal + $hotValue;
|
|
|
|
|