|
@@ -177,13 +177,15 @@ class Party extends Common
|
|
|
*/
|
|
|
public function savePartyStatus() {
|
|
|
$party_id = $this->request->request('party_id'); // 派对ID
|
|
|
- $room_type = 1; // 房间类型:1=派对,2=直播
|
|
|
+ $room_type = $this->request->request('room_type');; // 房间类型: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("当前账号异常,非房主禁止操作!");
|
|
|
$partyInfo->status = 1;
|
|
|
+ $partyInfo->updatetime = time();
|
|
|
+
|
|
|
$res = $partyInfo->save();
|
|
|
|
|
|
if($res) {
|
|
@@ -214,7 +216,7 @@ class Party extends Common
|
|
|
*/
|
|
|
public function closeParty() {
|
|
|
$party_id = $this->request->request('party_id'); // 派对ID
|
|
|
- $room_type = 1; // 房间类型:1=派对,2=直播
|
|
|
+ $room_type = $this->request->request('room_type',1); // 房间类型:1=派对,2=直播
|
|
|
if (!$party_id || !in_array($room_type,[1,2])) $this->error(__('Invalid parameters'));
|
|
|
$partyInfo = \app\common\model\Party::where(["id"=>$party_id])->find();
|
|
|
if(!$partyInfo) $this->error(__('派对不存在!'));
|