Gorm 如何实现whereHas 这种查询

	subQuery := global.GVA_DB.Select("id").
		Where("status <> ?", 2).
		Where("id = `sys_user_authority`.`ess_proxy_operator_id` ").
		Table("ess_proxy_operator")
	global.GVA_DB.Where("sys_user_id = ?", id).
		Where(
			global.GVA_DB.Where("ess_proxy_operator_id in (?)", subQuery).
				Or("sys_authority_authority_id in (1,4)"),
		).

你可能感兴趣的:(Gorm)