From 29ec30fd65448a44511da04c3a09d5087ea1be49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Wed, 22 Oct 2025 14:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=83=85=E7=AE=A1=E7=90=86-=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/RoomEmoji.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/application/adminapi/controller/RoomEmoji.php b/application/adminapi/controller/RoomEmoji.php index 5d54dc6..b4eaf73 100644 --- a/application/adminapi/controller/RoomEmoji.php +++ b/application/adminapi/controller/RoomEmoji.php @@ -169,4 +169,59 @@ class RoomEmoji extends adminApi return V(1,"成功", $emoji_type); } + //表情类型添加 + function add_emoji_type(){ + $type_name = input('type_name', '', 'trim'); + if (!$type_name) { + return V(0, '请输入表情类型名称'); + } + $data = [ + 'type_name' => $type_name, + 'sort' => 0, + 'status' => 1, + 'createtime' => time(), + ]; + $res = Db::name($this->table_type)->insert($data); + if ($res) { + return V(1, '添加成功'); + } + } + //表情类型修改 + function edit_emoji_type(){ + $id = input('id', 0, 'intval'); + $type_name = input('type_name', '', 'trim'); + $sort = input('sort', 0, 'intval'); + $status = input('status', 1, 'intval'); + if (!$id) { + return V(0, '请选择要修改的表情类型'); + } + if($type_name){ + $data['type_name'] = $type_name; + } + if($sort){ + $data['sort'] = $sort; + } + if($status){ + $data['status'] = $status; + } + $res = Db::name($this->table_type)->where('id',$id)->update($data); + if ($res) { + return V(1, '修改成功'); + } + return V(0, '修改失败'); + } + //表情类型删除 + function del_emoji_type(){ + $id = input('id', 0, 'intval'); + if (!$id) { + return V(0, '请选择要删除的表情类型'); + } + $res = Db::name($this->table_type)->where('id',$id)->update( + ['deletetime' => time()] + ); + if ($res) { + return V(1, '删除成功'); + } + return V(0, '删除失败'); + } } \ No newline at end of file