Authored by xiaofeng.yao@yoho.cn

增加开始按钮

... ... @@ -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(),'');
}
}
}
... ...
... ... @@ -76,5 +76,5 @@ return [
'failed_code'=>8001,
//异常状态
'exception_code'=>500,
'news_domain'=>'http://newboys.test.yoho.cn/',
'news_domain'=>'http://new.yohoboys.com/',
];
... ...
... ... @@ -167,7 +167,7 @@ class Video extends \yii\db\ActiveRecord
//清在线观看数
Yii::$app->redisIm->del(sprintf($cache_prefix . "audience_nums_room_%s", $room_id));
//清点赞数
//Yii::$app->redisIm->del(sprintf($cache_prefix . "like_numbers_room_%s", $room_id));
Yii::$app->redisIm->del(sprintf($cache_prefix . "like_numbers_room_%s", $room_id));
//清直播状态
Yii::$app->redisIm->del(sprintf($cache_prefix . "play_stat_room_%s", $room_id));
/*------------清除弹幕相关redis--------------*/
... ...