...
|
...
|
@@ -591,32 +591,53 @@ class Create extends Api |
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$user_id = $this->auth->id;
|
|
|
$data = Db::name('collect')
|
|
|
$data['note'] = Db::name('collect')
|
|
|
->alias('a')
|
|
|
->join('savemes b','a.savemes_id = b.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->where('b.type',1)
|
|
|
->field('a.id,a.user_id,a.savemes_id,b.name,b.type,b.images,b.video,b.content,b.is_open,b.is_up,b.createtime')
|
|
|
->select();
|
|
|
foreach ($data as &$v){
|
|
|
if(!empty($v['images'])){
|
|
|
$v['video'] = '';
|
|
|
$v['video_image'] = '';
|
|
|
$v['content'] = '';
|
|
|
$v['images'] = $qiniu.$v['images'];
|
|
|
}
|
|
|
if(!empty($v['content'])){
|
|
|
$v['images'] = '';
|
|
|
$v['video'] = '';
|
|
|
$v['video_image'] = '';
|
|
|
}
|
|
|
if(!empty($v['video'])){
|
|
|
$v['images'] = '';
|
|
|
$v['content'] = '';
|
|
|
$v['video'] = $qiniu.$v['video'];
|
|
|
// 获取视频第一帧图片
|
|
|
$video_info = json_decode(file_get_contents($v['video'] . '?avinfo'), true);
|
|
|
$v['video_image'] = $this->get_video_first_image($v['video'], $video_info);
|
|
|
}
|
|
|
|
|
|
$data['pic'] = Db::name('collect')
|
|
|
->alias('a')
|
|
|
->join('savemes b','a.savemes_id = b.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->where('b.type',2)
|
|
|
->field('a.id,a.user_id,a.savemes_id,b.name,b.type,b.images,b.video,b.content,b.is_open,b.is_up,b.createtime')
|
|
|
->select();
|
|
|
|
|
|
$data['video'] = Db::name('collect')
|
|
|
->alias('a')
|
|
|
->join('savemes b','a.savemes_id = b.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->where('b.type',3)
|
|
|
->field('a.id,a.user_id,a.savemes_id,b.name,b.type,b.images,b.video,b.content,b.is_open,b.is_up,b.createtime')
|
|
|
->select();
|
|
|
|
|
|
foreach ($data['note'] as &$v){
|
|
|
$v['images'] = '';
|
|
|
$v['video'] = '';
|
|
|
$v['video_image'] = '';
|
|
|
$v['createtime'] = date('Y-m-d',$v['createtime']);
|
|
|
}
|
|
|
|
|
|
foreach ($data['pic'] as &$v){
|
|
|
$v['video'] = '';
|
|
|
$v['video_image'] = '';
|
|
|
$v['content'] = '';
|
|
|
$v['images'] = $qiniu.$v['images'];
|
|
|
|
|
|
$v['createtime'] = date('Y-m-d',$v['createtime']);
|
|
|
}
|
|
|
|
|
|
foreach ($data['video'] as &$v){
|
|
|
$v['images'] = '';
|
|
|
$v['content'] = '';
|
|
|
$v['video'] = $qiniu.$v['video'];
|
|
|
// 获取视频第一帧图片
|
|
|
$video_info = json_decode(file_get_contents($v['video'] . '?avinfo'), true);
|
|
|
$v['video_image'] = $this->get_video_first_image($v['video'], $video_info);
|
|
|
$v['createtime'] = date('Y-m-d',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
...
|
...
|
|