From 562378fe8362fa59760c0ef558e69ffe52476a34 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Wed, 17 Dec 2025 15:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=9C=8B=E5=8F=8B=E5=9C=88?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/enterprise/controller/Posts.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/enterprise/controller/Posts.php b/app/enterprise/controller/Posts.php index 0041787..1764336 100644 --- a/app/enterprise/controller/Posts.php +++ b/app/enterprise/controller/Posts.php @@ -43,12 +43,13 @@ class Posts extends BaseController } $where .= ')'; - $field = 'p.id,p.content,p.location,p.address as location_address,p.type,p.user_id,p.create_time'; + $field = 'p.id,p.content,p.location,p.address as location_address,p.type,p.user_id,p.create_time,p.privacy'; $order = 'p.create_time desc'; $model = new PostsModel(); $list = $this->paginate($model->alias('p')->where($where)->field($field)->order($order)); $data = []; + $privacyDescribe = ['', '公开', '部分可见', '私密', '不给谁看']; if ($list) { $data = $list->toArray()['data']; foreach ($data as &$item) { @@ -65,6 +66,7 @@ class Posts extends BaseController $item['is_like'] = $likesData['is_like']; $item['comment'] = Comment::getPostsComment($item['id'], $this->uid, $userIdArr); + $item['privacy_describe'] = $privacyDescribe[$item['privacy']]; } } return success('', $data,$list->total(),$list->currentPage());