|
@@ -174,12 +174,12 @@ func GetCountByRegionalAgentUserBelongById(Db *xorm.Engine, uid interface{}, pvd |
|
|
} |
|
|
} |
|
|
fmt.Println(pvd) |
|
|
fmt.Println(pvd) |
|
|
if pvd == md.PVD_COMMON { |
|
|
if pvd == md.PVD_COMMON { |
|
|
if has, err := Db.Where("uid = ? and (pvd='' or pvd=?)", uid, pvd).Get(&m); err != nil || has == false { |
|
|
|
|
|
|
|
|
if has, err := Db.Where("uid = ? and (pvd='' or pvd=?)", uid, pvd).Desc("id").Get(&m); err != nil || has == false { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
return &m, nil |
|
|
return &m, nil |
|
|
} else { |
|
|
} else { |
|
|
if has, err := Db.Where("uid = ? and pvd=?", uid, pvd).Get(&m); err != nil || has == false { |
|
|
|
|
|
|
|
|
if has, err := Db.Where("uid = ? and pvd=?", uid, pvd).Desc("id").Get(&m); err != nil || has == false { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
return &m, nil |
|
|
return &m, nil |
|
|