作者 yangfu

模式查询列表修改

... ... @@ -29,6 +29,8 @@ type SearchCooperationModeQuery struct {
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 共创模式状态,1启用,2禁用
Status int32 `json:"status"`
}
func (searchCooperationModeQuery *SearchCooperationModeQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -188,6 +188,9 @@ func (repository *CooperationModeRepository) Find(queryOptions map[string]interf
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
query.Where("org->>'orgId' = '?'", orgId)
}
if status, ok := queryOptions["status"]; ok && status.(int32) > 0 {
query.Where("status = ?", status)
}
if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 {
newOrgIds := utils.SliceItoa(orgIds.([]int64))
query.Where("org->>'orgId' in (?)", pg.In(newOrgIds))
... ...