From a923615190912e0bbb07ee4d8ab513149ba86150 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Sun, 28 Sep 2025 18:06:18 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/chukebao/config/route.php | 1 + .../chukebao/controller/ContentController.php | 17 +++++++++++++++++ .../chukebao/controller/FollowUpController.php | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Server/application/chukebao/config/route.php b/Server/application/chukebao/config/route.php index 849051ae..2c1e4487 100644 --- a/Server/application/chukebao/config/route.php +++ b/Server/application/chukebao/config/route.php @@ -96,6 +96,7 @@ Route::group('v1/', function () { Route::group('content/', function () { //素材管理 Route::group('material/', function () { + Route::get('all', 'app\chukebao\controller\ContentController@getAllMaterial'); Route::get('list', 'app\chukebao\controller\ContentController@getMaterial'); Route::post('add', 'app\chukebao\controller\ContentController@createMaterial'); Route::get('details', 'app\chukebao\controller\ContentController@detailsMaterial'); diff --git a/Server/application/chukebao/controller/ContentController.php b/Server/application/chukebao/controller/ContentController.php index dce4eecd..09d58484 100644 --- a/Server/application/chukebao/controller/ContentController.php +++ b/Server/application/chukebao/controller/ContentController.php @@ -11,6 +11,23 @@ use library\ResponseHelper; class ContentController extends BaseController { //===================================================== 素材管理 ===================================================== + + public function getAllMaterial(){ + + $keyword = $this->request->param('keyword', ''); + $userId = $this->getUserInfo('id'); + $companyId = $this->getUserInfo('companyId'); + + $query = Material::where(['userId' => $userId,'companyId' => $companyId,'isDel' => 0,'status' => 1]) + ->field('id,title,cover') + ->order('id desc'); + + $list = $query->select()->toArray(); + + return ResponseHelper::success($list); + } + + /** * 素材列表 * @return \think\response\Json diff --git a/Server/application/chukebao/controller/FollowUpController.php b/Server/application/chukebao/controller/FollowUpController.php index 2a529d7a..35d7d56e 100644 --- a/Server/application/chukebao/controller/FollowUpController.php +++ b/Server/application/chukebao/controller/FollowUpController.php @@ -73,7 +73,7 @@ class FollowUpController extends BaseController if (empty($title) || empty($reminderTime) || empty($description) || empty($friendId)){ return ResponseHelper::error('参数缺失'); } - $friend = Db::name('wechat_friendship')->where(['id' => $friendId])->find(); + $friend = Db::table('s2_wechat_friend')->where(['id' => $friendId])->find(); if (empty($friend)) { return ResponseHelper::error('好友不存在'); }