|
|
|
@ -48,7 +48,7 @@ class Posts extends BaseController |
|
|
|
// 不可见 |
|
|
|
$where .= " or ( p.privacy = 4 and not exists ( |
|
|
|
select 1 from {$prefix}posts_privacy_users peu |
|
|
|
where peu.posts_id = p.id and peu.user_id = p.user_id |
|
|
|
where peu.posts_id = p.id |
|
|
|
and peu.type = 2 and peu.user_id = {$this->uid} |
|
|
|
))"; |
|
|
|
} |
|
|
|
@ -211,6 +211,9 @@ class Posts extends BaseController |
|
|
|
$type = '1'; |
|
|
|
} |
|
|
|
if (!empty($imgArr)) { |
|
|
|
if (is_array($imgArr) && count($imgArr) > 9) { |
|
|
|
return error(lang('posts.img_max_length')); |
|
|
|
} |
|
|
|
$type .= '2'; |
|
|
|
} elseif (!empty($video_file)) { |
|
|
|
$type .= '3'; |
|
|
|
@ -337,20 +340,7 @@ class Posts extends BaseController |
|
|
|
$field = 'id as posts_id,content,type,location,address as location_address,privacy'; |
|
|
|
$data = PostsModel::where($existsWhere)->field($field)->find(); |
|
|
|
if ($data) { |
|
|
|
$fileWhere = [ |
|
|
|
'posts_id' => $data['posts_id'], |
|
|
|
'delete_time' => 0 |
|
|
|
]; |
|
|
|
$files = (new PostsFile()) |
|
|
|
->where($fileWhere) |
|
|
|
->field('file_id,type') |
|
|
|
->order('sort asc') |
|
|
|
->select() |
|
|
|
->toArray(); |
|
|
|
foreach ($files as $fileKey => $fileValue) { |
|
|
|
$files[$fileKey]['src'] = File::where(['file_id' => $fileValue['file_id']])->value('src'); |
|
|
|
} |
|
|
|
$data['files'] = $files; |
|
|
|
$data['files'] = PostsFile::getPostsFile($data['posts_id']); |
|
|
|
$privacy_user =[]; |
|
|
|
if (in_array($data['privacy'], $this->privacyUserArr)) { |
|
|
|
$PrivacyUsers = PostsPrivacyUsers::where(['posts_id' => $data['id']])->column('user_id'); |
|
|
|
|