From 8849dda9c4fd92467e2c05c15ea483abae6af8e5 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期三, 12 八月 2020 11:25:39 +0800 Subject: [PATCH] add testPush --- models/userClient.go | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/userClient.go b/models/userClient.go index fafebeb..208a77c 100644 --- a/models/userClient.go +++ b/models/userClient.go @@ -25,7 +25,7 @@ func (uc *UserClient) Exist(phoneNum string) bool { var list []UserClient o := orm.NewOrm() - o.Raw("select * from ? where phoneNum=?", uc.TableName(), phoneNum).QueryRows(&list) + o.QueryTable(uc.TableName()).Filter("phoneNum", phoneNum).All(&list) if len(list) >0 { return true } @@ -35,7 +35,7 @@ func (uc *UserClient) ExistByCid(phoneNum string, cid string) bool { var list []UserClient o := orm.NewOrm() - o.Raw("select * from ? where phoneNum=? and clientId=?", uc.TableName(), phoneNum, cid).QueryRows(&list) + o.QueryTable(uc.TableName()).Filter("phoneNum", phoneNum).Filter("clientId", cid).All(&list) if len(list) >0 { return true } -- Gitblit v1.8.0