From 1c7edc4b86a5ea423fa03c4f1ac30278deadb27d Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 8 Oct 2019 17:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgetStoresSql=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E8=A7=92=E8=89=B2=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index ebcefd970..987404971 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -188,9 +188,10 @@ func getStoresSql(ctx *jxcontext.Context, keyword string, params map[string]inte SELECT COUNT(*) FROM casbin_rule t11 JOIN user t12 ON t12.user_id = t11.v0 AND t12.mobile LIKE ? - WHERE t11.v1 <> '' AND (t11.v1 = CONCAT(?, t1.id) OR t11.v1 = t1.market_man_role OR t11.v1 = t1.operator_role OR t11.v1 = t1.operator_role2) + WHERE t11.v1 <> '' AND (t11.v1 = CONCAT(?, t1.id) OR t11.v1 = CONCAT(?, t1.market_man_role) OR t11.v1 = CONCAT(?, t1.operator_role) OR t11.v1 = CONCAT(?, t1.operator_role2)) ) > 0` - sqlWhereParams = append(sqlWhereParams, keyword+"%", autils.NewStoreBossRole(-1).GetFullName()) // 必须要前缀,不然不能用过些会很慢 + prefix := autils.NewRole("", 0).GetFullName() + sqlWhereParams = append(sqlWhereParams, keyword+"%", autils.NewStoreBossRole(-1).GetFullName(), prefix, prefix, prefix) // 必须要前缀,不然不能用过些会很慢 } sqlWhere += " OR t1.id = ? OR t1.city_code = ? OR t1.district_code = ?" sqlWhereParams = append(sqlWhereParams, keywordInt64, keywordInt64, keywordInt64)