...
|
...
|
@@ -56,7 +56,7 @@ func GetUsersById(id int64) (v *User, err error) { |
|
|
|
|
|
// GetAllUsers retrieves all Users matches certain condition. Returns empty list if
|
|
|
// no records exist
|
|
|
func GetAllUsers(query map[string]string, fields []string, sortby []string, order []string,
|
|
|
func GetAllUser(query map[string]string, fields []string, sortby []string, order []string,
|
|
|
offset int64, limit int64) (ml []interface{}, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
qs := o.QueryTable(new(User))
|
...
|
...
|
@@ -162,18 +162,9 @@ func DeleteUsers(id int64) (err error) { |
|
|
return
|
|
|
}
|
|
|
|
|
|
func GetUsersByMobile(mobile string) (v *User, err error) {
|
|
|
func GetUserKefu() (v []*User, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `select * from users where username=?`
|
|
|
if err = o.Raw(sql, mobile).QueryRow(&v); err == nil {
|
|
|
return v, nil
|
|
|
}
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
func GetUsersKefu() (v []*User, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `select * from users where is_kefu = 1`
|
|
|
sql := `select * from user where is_kefu = 1`
|
|
|
if _, err = o.Raw(sql).QueryRows(&v); err == nil {
|
|
|
return v, nil
|
|
|
}
|
...
|
...
|
@@ -182,18 +173,9 @@ func GetUsersKefu() (v []*User, err error) { |
|
|
|
|
|
func GetUserByMobile(mobile string) (v *User, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := "select * from users where phone=?"
|
|
|
sql := "select * from user where phone=?"
|
|
|
if err = o.Raw(sql, mobile).QueryRow(&v); err == nil {
|
|
|
return v, nil
|
|
|
}
|
|
|
return nil, err
|
|
|
} |
|
|
|
|
|
//func GetUserInfoByClientId(clintId string) (v *User, err error) {
|
|
|
// o := orm.NewOrm()
|
|
|
// sql := "select * from users where clientId=?"
|
|
|
// if err = o.Raw(sql, clintId).QueryRow(&v); err == nil {
|
|
|
// return v, nil
|
|
|
// }
|
|
|
// return nil, err
|
|
|
//} |
...
|
...
|
|