|
@@ -315,7 +315,7 @@ func GetEdbInfoRelationDetailList(edbInfoId int, startSize, pageSize int) (total
|
|
|
func GetReplaceChildEdbInfoRelationTotal(edbInfoId int) (total int, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
// 数量汇总
|
|
|
- totalSql := ` SELECT count(*) FROM edb_info_relation where child_edb_info_id=? and root_edb_info_id !=? group by parent_relation_id`
|
|
|
+ totalSql := ` SELECT count(*) FROM edb_info_relation where relation_type=1 and (child_edb_info_id=? or edb_info_id=? ) group by parent_relation_id`
|
|
|
err = o.Raw(totalSql, edbInfoId, edbInfoId).QueryRow(&total)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -327,7 +327,7 @@ func GetReplaceChildEdbInfoRelationTotal(edbInfoId int) (total int, err error) {
|
|
|
func GetReplaceChildEdbInfoRelationList(edbInfoId int, startSize, pageSize int) (items []*EdbInfoRelation, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
// 列表数据
|
|
|
- sql := ` SELECT * FROM edb_info_relation where child_edb_info_id=? and root_edb_info_id !=? group by parent_relation_id ORDER BY edb_info_relation_id ASC LIMIT ?,? `
|
|
|
+ sql := ` SELECT * FROM edb_info_relation where relation_type=1 and (child_edb_info_id=? or edb_info_id=? ) group by parent_relation_id ORDER BY edb_info_relation_id ASC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, edbInfoId, edbInfoId, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|