Authored by xiaofeng.yao@yoho.cn

修改详情接口

@@ -194,7 +194,7 @@ class LivingController extends BaseController @@ -194,7 +194,7 @@ class LivingController extends BaseController
194 {//直播视频详情 194 {//直播视频详情
195 195
196 //观看人数+1 196 //观看人数+1
197 - RoomNums::updateAllCounters(['audience_num' => 1],['room_id'=>$room_id]); 197 + //RoomNums::updateAllCounters(['audience_num' => 1],['room_id'=>$room_id]);
198 198
199 $key = __CLASS__.__FUNCTION__.'room_id'.$room_id; 199 $key = __CLASS__.__FUNCTION__.'room_id'.$room_id;
200 if (!$ret = $this->cache->get($key)){ 200 if (!$ret = $this->cache->get($key)){
@@ -223,12 +223,12 @@ class LivingController extends BaseController @@ -223,12 +223,12 @@ class LivingController extends BaseController
223 $ret['live_last_time'] = $model->videoLast ? $model->videoLast->live_end_time-$model->videoLast->live_start_time : 0; 223 $ret['live_last_time'] = $model->videoLast ? $model->videoLast->live_end_time-$model->videoLast->live_start_time : 0;
224 } 224 }
225 225
226 - if ($model->roomNums){ 226 + /*if ($model->roomNums){
227 $ret = array_merge($ret,[ 227 $ret = array_merge($ret,[
228 'like_num'=>(int)$model->roomNums->like_num, 228 'like_num'=>(int)$model->roomNums->like_num,
229 'audience_num'=>(int)$model->roomNums->online_num, 229 'audience_num'=>(int)$model->roomNums->online_num,
230 ]); 230 ]);
231 - } 231 + }*/
232 232
233 if ($model->master){ 233 if ($model->master){
234 $ret = array_merge($ret,[ 234 $ret = array_merge($ret,[
@@ -238,11 +238,11 @@ class LivingController extends BaseController @@ -238,11 +238,11 @@ class LivingController extends BaseController
238 ]); 238 ]);
239 } 239 }
240 240
241 - if ($model->videoRecording){ 241 + /*if ($model->videoRecording){
242 $ret = array_merge($ret,[ 242 $ret = array_merge($ret,[
243 'live_start_time'=>(int)$model->videoRecording->live_start_time, 243 'live_start_time'=>(int)$model->videoRecording->live_start_time,
244 ]); 244 ]);
245 - } 245 + }*/
246 246
247 if ($model->roomQchannel){ 247 if ($model->roomQchannel){
248 if (is_array($downstream_address = json_decode($model->roomQchannel->downstream_address)) && !empty($downstream_address[0])){ 248 if (is_array($downstream_address = json_decode($model->roomQchannel->downstream_address)) && !empty($downstream_address[0])){
@@ -262,7 +262,9 @@ class LivingController extends BaseController @@ -262,7 +262,9 @@ class LivingController extends BaseController
262 ->bindValue(':room_id', $room_id) 262 ->bindValue(':room_id', $room_id)
263 ->getRawSql()]); 263 ->getRawSql()]);
264 $this->cache->set($key, json_encode($ret), Yii::$app->params['defaultCacheExpire'], $dependency); 264 $this->cache->set($key, json_encode($ret), Yii::$app->params['defaultCacheExpire'], $dependency);
265 - }else{ 265 + }
  266 + /*
  267 + else{
266 Yii::$app->db->cache(function() use ($room_id,&$ret){ 268 Yii::$app->db->cache(function() use ($room_id,&$ret){
267 if (!$model = RoomNums::findOne(['room_id'=>$room_id])){ 269 if (!$model = RoomNums::findOne(['room_id'=>$room_id])){
268 return; 270 return;
@@ -273,7 +275,7 @@ class LivingController extends BaseController @@ -273,7 +275,7 @@ class LivingController extends BaseController
273 'audience_num'=>(int)$model->online_num, 275 'audience_num'=>(int)$model->online_num,
274 ]); 276 ]);
275 }, 60); 277 }, 60);
276 - } 278 + }*/
277 279
278 $this->renderJson(Yii::$app->params['success_code'],'',$ret); 280 $this->renderJson(Yii::$app->params['success_code'],'',$ret);
279 }elseif ($video_id = $this->requests('video_id')) 281 }elseif ($video_id = $this->requests('video_id'))
@@ -334,7 +336,7 @@ class LivingController extends BaseController @@ -334,7 +336,7 @@ class LivingController extends BaseController
334 if ($model){ 336 if ($model){
335 $_ret = json_decode($ret,true); 337 $_ret = json_decode($ret,true);
336 $ret = array_merge($_ret,[ 338 $ret = array_merge($_ret,[
337 - 'like_num'=>(int)$model->like_num, 339 +// 'like_num'=>(int)$model->like_num,
338 'audience_num'=>(int)($model->audience_num + $model->replay_num), 340 'audience_num'=>(int)($model->audience_num + $model->replay_num),
339 ]); 341 ]);
340 } 342 }