...
|
...
|
@@ -50,12 +50,6 @@ func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOp |
|
|
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
|
|
|
query = query.Where(`cooperation_contract.org @> '{"orgId":"?"}'`, orgId)
|
|
|
}
|
|
|
if user, ok := queryOptions["user"]; ok && user.(bool) != false {
|
|
|
query = query.Where("user_type = ?", 1)
|
|
|
}
|
|
|
if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false {
|
|
|
query = query.Where("user_type = ?", 2)
|
|
|
}
|
|
|
if count, err := query.SelectAndCount(); err != nil {
|
|
|
return false, err
|
|
|
} else {
|
...
|
...
|
@@ -65,6 +59,12 @@ func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOp |
|
|
var cooperationContractUndertakerModels []*models.CooperationContractUndertaker
|
|
|
queryUndertaker := tx.Model(&cooperationContractUndertakerModels)
|
|
|
queryUndertaker.Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber)
|
|
|
if user, ok := queryOptions["user"]; ok && user.(bool) != false {
|
|
|
query = query.Where("user_type = ?", 1)
|
|
|
}
|
|
|
if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false {
|
|
|
query = query.Where("user_type = ?", 2)
|
|
|
}
|
|
|
ok, err2 := queryUndertaker.Exists()
|
|
|
return !ok, err2
|
|
|
}
|
...
|
...
|
|