From fc60a58a9c86c92eb3df306f84434973ba61b548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Mon, 26 Jan 2026 19:29:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0-=E5=B0=81?= =?UTF-8?q?=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/User.php | 28 ++++++++++++++++++++++++ application/cron/controller/Test.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/application/adminapi/controller/User.php b/application/adminapi/controller/User.php index 898efb5b..9f7a4bb0 100644 --- a/application/adminapi/controller/User.php +++ b/application/adminapi/controller/User.php @@ -226,6 +226,13 @@ class User extends adminApi $status = input('status', 1); $ban_eason = input('ban_eason', 0); $ban_day = input('ban_day', 0); + if(empty($time)){ + if(!empty($ban_day)){ + $time = date('Y-m-d H:i:s', time() + $ban_day * 86400); + }else{ + $time = ""; + } + } $user_info = model('User')->where('id', $user_id)->find(); if(!$user_info){ return V(0, "用户不存在"); @@ -257,10 +264,21 @@ class User extends adminApi 'type_text' => $type_text, 'block_time' => $block_time, 'createtime' => time(), + 'ban_eason' => $ban_eason, + 'ban_day' => $ban_day, ]); if (!$res) { return V(0, "添加失败"); } + //加推送单聊消息 + $content = "您的账号因 含有".model('Block')->getBanReason()[$ban_eason] . "内容 于".date('Y-m-d H:i:s',time())." 被封禁".model('Block')->getBanTime()[$ban_day]." ,".date('Y-m-d H:i:s',$block_time)."解封,如对处罚有异议请及时联系管理员申诉"; + $text = [ + 'MsgType' => 404, + 'ToUserId' => $user_id, + 'Text' => $content + ]; + //谁发送给谁,什么消息,是否同步到发送者1是,2否,消息是否只下发给在线用户 1 是,0 否 + model('Tencent')->user_sendmsg("管理员",$user_id,json_encode($text),2,1); }else{ if($type ==1) { $res = model('User')->where('id', $user_id)->update(['status' => 1]); @@ -284,6 +302,16 @@ class User extends adminApi TokenLib::delete($token); return V(1,"成功", null); } + //封禁理由 + public function getBanEason(){ + $list = model('Block')->getBanReason(); + return V(1,"成功", $list); + } + //封禁时长 + public function getBanDay(){ + $list = model('Block')->getBanTime(); + return V(1,"成功", $list); + } /* * 设为官方账号 diff --git a/application/cron/controller/Test.php b/application/cron/controller/Test.php index 4151c0d8..5c0790de 100644 --- a/application/cron/controller/Test.php +++ b/application/cron/controller/Test.php @@ -33,7 +33,7 @@ class Test // $this->task_coin_count(); // $this->createGuildSubsidyDataNew(); // $this->repair_guild_room_data(); - $this->check_guild_room_data(); +// $this->check_guild_room_data(); }