From 9b5710f23d6cbda9f2b0e650cf8916e7707d5588 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期一, 29 六月 2020 19:27:14 +0800 Subject: [PATCH] addPlateNo and findMyPlateNos --- models/userCar.go | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/userCar.go b/models/userCar.go index 24eb587..881e48c 100644 --- a/models/userCar.go +++ b/models/userCar.go @@ -29,8 +29,8 @@ func (uc *UserCar) Exist(userId string, plateNo string) bool { var list []UserCar o := orm.NewOrm() - i,_ := o.Raw("select * from ? where userId=? and plateNo=?", uc.TableName(), userId, plateNo).QueryRows(&list) - if i > 0 && len(list) >0 { + o.Raw("select * from ? where userId=? and plateNo=?", uc.TableName(), userId, plateNo).QueryRows(&list) + if len(list) >0 { return true } return false -- Gitblit v1.8.0