From 2976c07084e59d50160a413d83c8c05e8c87c2d0 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 27 May 2025 19:19:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(model):=20=E6=96=B0=E5=A2=9E=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E5=A5=BD=E5=8F=8B=E5=92=8C=E8=81=8A=E5=A4=A9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 ChatFriends 模型,用于员工与会员聊天好友关系 - 添加 ChatMessages 模型,用于员工与会员聊天记录 - 实现了软删除、搜索器等功能 --- .../app/model/chat_friends/ChatFriends.php | 91 +++++++++++++++++++ .../app/model/chat_messages/ChatMessages.php | 50 ++++++++++ 2 files changed, 141 insertions(+) create mode 100644 niucloud/app/model/chat_friends/ChatFriends.php create mode 100644 niucloud/app/model/chat_messages/ChatMessages.php diff --git a/niucloud/app/model/chat_friends/ChatFriends.php b/niucloud/app/model/chat_friends/ChatFriends.php new file mode 100644 index 00000000..bb68bf3e --- /dev/null +++ b/niucloud/app/model/chat_friends/ChatFriends.php @@ -0,0 +1,91 @@ +where("personnel_id", $value); + } + } + + /** + * 搜索器:学生资源表id + * @param $value + * @param $data + */ + public function searchCustomerResourcesIdAttr($query, $value, $data) + { + if ($value) { + $query->where("customer_resources_id", $value); + } + } + + + public function campus(){ + return $this->hasOne(CustomerResources::class, 'id', 'customer_resources_id')->joinType('left')->withField('name,id')->bind(['customer_resources_id'=>'name']); + } + + public function personnel(){ + return $this->hasOne(Personnel::class, 'id', 'personnel_id')->joinType('left')->withField('name,id')->bind(['personnel_id_name'=>'name']); + } + +} diff --git a/niucloud/app/model/chat_messages/ChatMessages.php b/niucloud/app/model/chat_messages/ChatMessages.php new file mode 100644 index 00000000..aaf46334 --- /dev/null +++ b/niucloud/app/model/chat_messages/ChatMessages.php @@ -0,0 +1,50 @@ +