models/userCar.go
@@ -26,6 +26,16 @@ return all,nil } 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 { return true } return false } func (uc *UserCar) DeleteByUserId(userId string) (int64, error) { o := orm.NewOrm() result, err := o.Raw("delete from ? where userId=?", uc.TableName(), userId).Exec()