Authored by xiaofeng.yao@yoho.cn

直播打日志

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