| | |
| | | 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 |
| | | } |
| | |
| | | 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 |
| | | } |