From 827c10309944b3522247a3ea7dc486b8f8927161 Mon Sep 17 00:00:00 2001 From: wule Date: Wed, 21 Oct 2026 15:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=90=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A7=A3=E7=BB=91=E5=AF=BC=E8=87=B4=E6=8B=8D?= =?UTF-8?q?=E5=8D=95=E8=BD=AF=E4=BB=B6=E5=BA=97=E9=93=BA=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KJD_WebService/BLL/WXXD/WXShopManage.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/KJD_WebService/BLL/WXXD/WXShopManage.cs b/KJD_WebService/BLL/WXXD/WXShopManage.cs index 043d639..8bd403e 100644 --- a/KJD_WebService/BLL/WXXD/WXShopManage.cs +++ b/KJD_WebService/BLL/WXXD/WXShopManage.cs @@ -70,9 +70,11 @@ namespace KJD_Web.BLL.WXXD MysqlUtils mySql = new MysqlUtils(conn); string sql; bool isPayUser = false; + int userGroup = 4; + string parentUserName = ""; if (!isAdmin) { - sql = "select u.authority,uu.authority as main_authority " + + sql = "select u.parent_user_name,u.group_id,u.authority,uu.authority as main_authority " + "FROM wxxd.user u LEFT JOIN wxxd.user uu ON uu.user_name=u.parent_user_name where u.user_name='" + user_name + "'"; @@ -88,6 +90,12 @@ namespace KJD_Web.BLL.WXXD return "{\"code\":501,\"msg\":\"" + mySql.Message + "\",\"data\":null}"; } isPayUser = dtRow["authority"].ToString().Contains("充值用户") || dtRow["main_authority"].ToString().Contains("充值用户"); + userGroup = dtRow["group_id"].ParseToInt(); + parentUserName = dtRow["parent_user_name"].ParseToString(); + if (userGroup != 3 && parentUserName.IsNullOrEmpty()) + { + return "{\"code\":501,\"msg\":\"用户名错误\",\"data\":null}"; + } } sql = "SELECT COUNT(*) FROM wxxd.shop s WHERE 1=1"; @@ -97,7 +105,12 @@ namespace KJD_Web.BLL.WXXD if (isAdmin) where += " and (s.cookie='' or s.shop_id!='')"; if (!isAdmin) - where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')"; + { + if (userGroup != 3) + where += " and (s.user_name='" + parentUserName + "' and s.sub_user_name like '%" + user_name + "%')"; + else + where += " and (s.user_name='" + user_name + "')"; + } if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; if (!string.IsNullOrWhiteSpace(search_user_name))