mirror of https://gitee.com/karson/fastadmin.git
'有直播流可以直播'
parent
0f25bd16ac
commit
b525fd1b49
|
|
@ -53,16 +53,33 @@ class Live extends Api
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->request->request("username")) {
|
// if ($this->request->request("username")) {
|
||||||
$username = $this->request->request("username");
|
// $username = $this->request->request("username");
|
||||||
// $username = 'qq';
|
$username = 'xingchao';
|
||||||
$sql = "select b.*
|
$sql = "select b.*
|
||||||
from fa_user as a,fa_live as b
|
from fa_user as a,fa_live as b
|
||||||
where a.id=b.user_id and a.username = '$username'";
|
where a.id=b.user_id and a.username = '$username'";
|
||||||
|
|
||||||
$list = Db::query($sql);
|
$list = Db::query($sql);
|
||||||
if (!empty($list)) {
|
if (!empty($list)) {
|
||||||
return true;
|
|
||||||
|
$code = trim(strrchr($list[0]['push_url'], '/'), '/');
|
||||||
|
|
||||||
|
$len1 = strlen($list[0]['push_url']);
|
||||||
|
$len2 = strlen($code);
|
||||||
|
|
||||||
|
$base_url = substr($list[0]['push_url'],0,$len1 - $len2);
|
||||||
|
// echo $base_url;
|
||||||
|
|
||||||
|
$list = array(
|
||||||
|
'base_url' => $base_url,
|
||||||
|
'code' => $code,
|
||||||
|
);
|
||||||
|
|
||||||
|
$result = array("rows" => $list);
|
||||||
|
|
||||||
|
return (json($result));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//创建直播流
|
//创建直播流
|
||||||
$sql = "select id
|
$sql = "select id
|
||||||
|
|
@ -95,7 +112,7 @@ class Live extends Api
|
||||||
$result = array("rows" => $list);
|
$result = array("rows" => $list);
|
||||||
return json($result);
|
return json($result);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
$total = $this->model
|
$total = $this->model
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue