From 3f5a2189ce4b53fb8e4ff3e33338065907efaeef Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Sat, 20 Dec 2025 10:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ContentLibraryController.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Server/application/cunkebao/controller/ContentLibraryController.php b/Server/application/cunkebao/controller/ContentLibraryController.php index a92ac221..0fb4bab1 100644 --- a/Server/application/cunkebao/controller/ContentLibraryController.php +++ b/Server/application/cunkebao/controller/ContentLibraryController.php @@ -559,6 +559,7 @@ class ContentLibraryController extends Controller ['companyId', '=', $companyId], ['isDel', '=', 0] ]; + if (!$isAdmin) { $libraryWhere[] = ['userId', '=', $userId]; @@ -586,8 +587,9 @@ class ContentLibraryController extends Controller // 查询数据 $list = ContentItem::where($where) - ->field('id,libraryId,type,title,content,contentAi,contentType,resUrls,urls,friendId,wechatId,wechatChatroomId,createTime,createMomentTime,createMessageTime,coverImage') + ->field('id,libraryId,type,title,content,contentAi,contentType,resUrls,urls,friendId,wechatId,wechatChatroomId,createTime,createMomentTime,createMessageTime,coverImage,ossUrls') ->order('createMomentTime DESC,createTime DESC') + ->group('snsId') ->page($page, $limit) ->select(); @@ -643,6 +645,12 @@ class ContentLibraryController extends Controller // 处理JSON字段 $item['resUrls'] = json_decode($item['resUrls'] ?: [], true); $item['urls'] = json_decode($item['urls'] ?: [], true); + $item['ossUrls'] = json_decode($item['ossUrls'] ?: [], true); + + if(!empty($item['ossUrls']) && count($item['ossUrls']) > 0){ + $item['resUrls'] = $item['ossUrls']; + } + // 格式化时间 if (!empty($item['createMomentTime']) && is_numeric($item['createMomentTime'])) { @@ -674,7 +682,7 @@ class ContentLibraryController extends Controller } } - unset($item['contentAi']); + unset($item['contentAi'],$item['ossUrls']); } return json([ @@ -1314,7 +1322,7 @@ class ContentLibraryController extends Controller }*/ // 获取最近20条朋友圈 - $moments = $query->page(1, 20)->select(); + $moments = $query->page(1, 100)->select(); if (empty($moments)) { continue; }