Authored by xiaofeng.yao@yoho.cn

直播打日志

@@ -58,7 +58,9 @@ class Request @@ -58,7 +58,9 @@ class Request
58 58
59 private function _send($uri, array $data) 59 private function _send($uri, array $data)
60 { 60 {
  61 + file_put_contents("/tmp/yoholive.log",date('Y-m-d H:i:s')."|request yohonow,url:".$this->makeUrl($uri, $data),FILE_APPEND);
61 $response = Curl::get($this->makeUrl($uri, $data)); 62 $response = Curl::get($this->makeUrl($uri, $data));
  63 + file_put_contents("/tmp/yoholive.log",date('Y-m-d H:i:s')."|request yohonow,result:".var_export($response,true),FILE_APPEND);
62 $response = json_decode($response,true); 64 $response = json_decode($response,true);
63 if ($response['code'] == self::$success) { 65 if ($response['code'] == self::$success) {
64 return true; 66 return true;
@@ -122,10 +122,11 @@ class Video extends \yii\db\ActiveRecord @@ -122,10 +122,11 @@ class Video extends \yii\db\ActiveRecord
122 ->from('tbl_room') 122 ->from('tbl_room')
123 ->where(['room_id' => $room_id]) 123 ->where(['room_id' => $room_id])
124 ->one(); 124 ->one();
  125 +
125 if(!$room['status']){ 126 if(!$room['status']){
126 throw new \Exception("该房间已被禁用,请联系管理员"); 127 throw new \Exception("该房间已被禁用,请联系管理员");
127 } 128 }
128 - if (1) { 129 + //if (1) {
129 $this->setAttributes([ 130 $this->setAttributes([
130 'app' => $room['app'], 131 'app' => $room['app'],
131 'task_id' => 0,//$ret['task_id'] 132 'task_id' => 0,//$ret['task_id']
@@ -171,9 +172,9 @@ class Video extends \yii\db\ActiveRecord @@ -171,9 +172,9 @@ class Video extends \yii\db\ActiveRecord
171 /*------------清除弹幕相关redis--------------*/ 172 /*------------清除弹幕相关redis--------------*/
172 $transaction->commit(); 173 $transaction->commit();
173 return true; 174 return true;
174 - } else { 175 + /*} else {
175 throw new \Exception(QcloudApiClient::self()->error()); 176 throw new \Exception(QcloudApiClient::self()->error());
176 - } 177 + }*/
177 } catch (\Exception $e) { 178 } catch (\Exception $e) {
178 $transaction->rollBack(); 179 $transaction->rollBack();
179 throw new \Exception($e->getMessage()); 180 throw new \Exception($e->getMessage());