Browse Source

优化朋友圈逻辑

author
wanghongjun 8 months ago
parent
commit
a87aafb0f0
  1. 5
      app/common/controller/Upload.php
  2. 8
      app/enterprise/controller/Posts.php

5
app/common/controller/Upload.php

@ -153,6 +153,8 @@ class Upload extends BaseController
}
return $data;
}else{
$fileInfo=new FileModel;
$fileInfo->save($ret);
// 上传视频切片
if ($fileType == 4) {
$videoInfo=$this->getVideoCover($filePath);
@ -162,9 +164,6 @@ class Upload extends BaseController
$poster=getMainHost().'/static/common/img/video.png';
}
$ret['poster'] = $poster;
} else {
$fileInfo=new FileModel;
$fileInfo->save($ret);
}
return $ret;
}

8
app/enterprise/controller/Posts.php

@ -131,11 +131,11 @@ class Posts extends BaseController
}
$where = [
'id' => $posts_id,
'user_id' => $this->uid,
['id', '=', $posts_id],
['user_id', '=', $this->uid],
['privacy', 'in', [1,2,3,4]],
['status', '=', 1],
'delete_time' => 0
['delete_time', '=', 0]
];
$field = 'id,content,location,address,type,user_id,create_time,privacy';
$data = (new PostsModel())->where($where)->field($field)->find();
@ -309,7 +309,7 @@ class Posts extends BaseController
}
Db::commit();
return success(lang('posts.submit'));
return $status == 2 ? success('') : success(lang('posts.submit'));
} catch (\Exception $e) {
Db::rollback();
return warning(lang('system.error'));

Loading…
Cancel
Save