...
|
...
|
@@ -101,7 +101,6 @@ class Lists extends Api |
|
|
*/
|
|
|
public function sou()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$user_id = $this->auth->id;
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
...
|
...
|
@@ -146,7 +145,7 @@ class Lists extends Api |
|
|
$video_avinfo = json_decode(file_get_contents(cdnurl($v['video_file'], true) . '?avinfo'), true); // 获取视频元信息
|
|
|
$duration = ceil($video_avinfo['format']['duration']);
|
|
|
$v['duration'] = gmdate('H:i:s',$duration);
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
...
|
...
|
@@ -169,7 +168,7 @@ class Lists extends Api |
|
|
->order('id desc')
|
|
|
->select();
|
|
|
foreach ($data['info'] as &$v){
|
|
|
$v['video_file'] = $qiniu.$v['video_file'];
|
|
|
$v['video_file'] = cdnurl($v['video_file'],true);
|
|
|
$video_info = json_decode(file_get_contents($v['video_file'] . '?avinfo'), true);
|
|
|
$v['video_image'] = $this->get_video_first_image( $v['video_file'], $video_info);
|
|
|
}
|
...
|
...
|
@@ -329,7 +328,6 @@ class Lists extends Api |
|
|
*/
|
|
|
public function index_info()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
...
|
...
|
@@ -358,7 +356,7 @@ class Lists extends Api |
|
|
foreach ($file_list as &$v){
|
|
|
if(!empty($v['file'])){
|
|
|
$base_url = $v['file'];
|
|
|
$qiniu_url = $qiniu.$v['file'];
|
|
|
$qiniu_url = cdnurl($v['file'],true);
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
...
|
...
|
@@ -401,7 +399,6 @@ class Lists extends Api |
|
|
*/
|
|
|
public function policy_info()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
...
|
...
|
@@ -430,7 +427,7 @@ class Lists extends Api |
|
|
foreach ($file_list as &$v){
|
|
|
if(!empty($v['file'])){
|
|
|
$base_url = $v['file'];
|
|
|
$qiniu_url = $qiniu.$v['file'];
|
|
|
$qiniu_url = cdnurl($v['file'],true);
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
...
|
...
|
@@ -476,7 +473,6 @@ class Lists extends Api |
|
|
*/
|
|
|
public function download_info()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
...
|
...
|
@@ -492,7 +488,7 @@ class Lists extends Api |
|
|
foreach ($file_list as &$v){
|
|
|
if(!empty($v['file'])){
|
|
|
$base_url = $v['file'];
|
|
|
$qiniu_url = $qiniu.$v['file'];
|
|
|
$qiniu_url = cdnurl($v['file'],true);
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
...
|
...
|
@@ -539,7 +535,6 @@ class Lists extends Api |
|
|
{
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data['total_num'] = Db::name('optimization')
|
|
|
->count();
|
|
|
$data['info'] = Db::name('optimization')
|
...
|
...
|
@@ -552,7 +547,7 @@ class Lists extends Api |
|
|
$video_avinfo = json_decode(file_get_contents(cdnurl($v['video_file'], true) . '?avinfo'), true); // 获取视频元信息
|
|
|
$duration = ceil($video_avinfo['format']['duration']);
|
|
|
$v['duration'] = gmdate('H:i:s',$duration);
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
...
|
...
|
@@ -587,12 +582,11 @@ class Lists extends Api |
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data = Db::name('optimization')
|
|
|
->where('id',$id)
|
|
|
->find();
|
|
|
$data['image'] = $qiniu.$data['image'];
|
|
|
$data['video_file'] = $qiniu.$data['video_file'];
|
|
|
$data['image'] = cdnurl($data['image'],true);
|
|
|
$data['video_file'] = cdnurl($data['video_file'],true);
|
|
|
|
|
|
// 获取视频时长
|
|
|
$video_avinfo = json_decode(file_get_contents(cdnurl($data['video_file'], true) . '?avinfo'), true); // 获取视频元信息
|
...
|
...
|
@@ -643,7 +637,6 @@ class Lists extends Api |
|
|
}
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
// $user_id = Session::get('user_id');
|
|
|
$user_id = $this->auth->id;
|
|
|
$where['expirationtime'] = ['>',time()];
|
...
|
...
|
@@ -675,7 +668,7 @@ class Lists extends Api |
|
|
}
|
|
|
|
|
|
}
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$v['expirationtime'] = date('Y-m-d H:i:s',$v['expirationtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
...
|
...
|
@@ -726,7 +719,6 @@ class Lists extends Api |
|
|
}
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 12, 'intval');
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
// $user_id = Session::get('user_id');
|
|
|
$user_id = $this->auth->id;
|
|
|
$where['expirationtime'] = ['>',time()];
|
...
|
...
|
@@ -762,7 +754,7 @@ class Lists extends Api |
|
|
$third_study = Db::name('third_study')->where('third_id',$user_id)->where('study_id',$v['id'])->field('periodtime')->find();
|
|
|
$v['expirationtime'] = !empty($third_study) ? date('Y-m-d H:i:s',$third_study['periodtime']) : date('Y-m-d H:i:s',$v['expirationtime']);
|
|
|
}
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}
|
...
|
...
|
@@ -824,8 +816,6 @@ class Lists extends Api |
|
|
public function password_login(){
|
|
|
|
|
|
$type = $this->request->param('type');
|
|
|
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$username = $this->request->param('username');
|
|
|
$password = $this->request->param('password');
|
|
|
if(empty($username) || empty($password)){
|
...
|
...
|
@@ -843,7 +833,7 @@ class Lists extends Api |
|
|
// $this->error('抱歉,有效期已过');
|
|
|
// }
|
|
|
if(!empty($user['image'])){
|
|
|
$user['image'] = $qiniu.$user['image'];
|
|
|
$user['image'] = cdnurl($user['image'],true);
|
|
|
}else{
|
|
|
$user['image'] = '';
|
|
|
}
|
...
|
...
|
@@ -1094,11 +1084,10 @@ class Lists extends Api |
|
|
{
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data['total_num'] = Db::name('kelist')->count();
|
|
|
$data['info'] = Db::name('kelist')->order('id desc')->field('updatetime',true)->page($page,$pageNum)->select();
|
|
|
foreach ($data['info'] as &$v){
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
...
|
...
|
@@ -1131,13 +1120,12 @@ class Lists extends Api |
|
|
*/
|
|
|
public function ke_list_detail()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = Db::name('kelist')->where('id',$id)->find();
|
|
|
$data['image'] = $qiniu.$data['image'];
|
|
|
$data['image'] = cdnurl($data['image'],true);
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
...
|
...
|
|