【项目关联逻辑BUG修改】
This commit is contained in:
parent
8efa8fdad4
commit
370bc1e5fb
|
@ -52,21 +52,23 @@ func delProjectMapLink(pid int32) {
|
|||
// 保存项目尺寸关联关系
|
||||
func saveProjectSize(pid int32, sids []*int32) {
|
||||
if len(sids) == 0 {
|
||||
sizeInfos := make([]*model.ProjectTrainSizeLink, len(sids))
|
||||
for i, sid := range sids {
|
||||
sizeInfos[i] = &model.ProjectTrainSizeLink{Pid: pid, Sid: *sid}
|
||||
}
|
||||
dbquery.ProjectTrainSizeLink.Save(sizeInfos...)
|
||||
return
|
||||
}
|
||||
sizeInfos := make([]*model.ProjectTrainSizeLink, len(sids))
|
||||
for i, sid := range sids {
|
||||
sizeInfos[i] = &model.ProjectTrainSizeLink{Pid: pid, Sid: *sid}
|
||||
}
|
||||
dbquery.ProjectTrainSizeLink.Save(sizeInfos...)
|
||||
}
|
||||
|
||||
// 保存项目地图关联关系
|
||||
func saveProjectMapLink(pid int32, mids []*int32) {
|
||||
if len(mids) == 0 {
|
||||
mapInfos := make([]*model.ProjectPublishLink, len(mids))
|
||||
for i, mid := range mids {
|
||||
mapInfos[i] = &model.ProjectPublishLink{Pid: pid, Mid: *mid}
|
||||
}
|
||||
dbquery.ProjectPublishLink.Save(mapInfos...)
|
||||
return
|
||||
}
|
||||
mapInfos := make([]*model.ProjectPublishLink, len(mids))
|
||||
for i, mid := range mids {
|
||||
mapInfos[i] = &model.ProjectPublishLink{Pid: pid, Mid: *mid}
|
||||
}
|
||||
dbquery.ProjectPublishLink.Save(mapInfos...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue