...
|
...
|
@@ -4,6 +4,7 @@ namespace backend\controllers; |
|
|
use Yii;
|
|
|
use common\components\cachekey\Parser;
|
|
|
use common\config\Params;
|
|
|
use common\models\Video;
|
|
|
/**
|
|
|
* Ajax controller
|
|
|
*/
|
...
|
...
|
@@ -26,11 +27,21 @@ class AjaxController extends BaseController |
|
|
{
|
|
|
$room_id = Yii::$app->request->get('room_id');
|
|
|
|
|
|
//更新房间主表直播状态
|
|
|
/*//更新房间主表直播状态
|
|
|
$living_status = Params::LIVE_END;
|
|
|
$result = Yii::$app->db->createCommand()
|
|
|
->update('{{%room}}', ['living' => $living_status,'update_time'=>time()], ['room_id' => $room_id])
|
|
|
->execute();
|
|
|
$this->renderJson(Yii::$app->params['success_code'],'',$room_id);
|
|
|
->execute();*/
|
|
|
try {
|
|
|
$model = new Video();
|
|
|
$result = $model->setVideoStop($room_id);
|
|
|
if($result){
|
|
|
$this->renderJson(Yii::$app->params['success_code'],'结束成功',$room_id);
|
|
|
}else{
|
|
|
$this->renderJson(Yii::$app->params['failed_code'],'结束失败');
|
|
|
}
|
|
|
} catch (\Exception $e){
|
|
|
$this->renderJson(Yii::$app->params['failed_code'],$e->getMessage(),'');
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|