1、优化"查询系统渠道编码"接口,新增产品ID;
This commit is contained in:
parent
24e7e90a7e
commit
ca88bb7ab6
|
@ -1859,21 +1859,11 @@ func (e MiGuDeployService) SysChannelList(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
// 4. 构建所有组合,并剔除重复的渠道编码
|
||||
channelSet := make(map[string]struct{})
|
||||
|
||||
// 添加渠道表中的主渠道和子渠道编码
|
||||
for _, channel := range mgChannels {
|
||||
channelSet[channel.SubChannelCode] = struct{}{}
|
||||
}
|
||||
|
||||
// 5. 转换为ChannelData结构体并分页
|
||||
for code := range channelSet {
|
||||
if code != "" { // 跳过空的channel_code
|
||||
channels = append(channels, models.ChannelData{
|
||||
ChannelCode: code,
|
||||
})
|
||||
}
|
||||
for _, item := range mgChannels {
|
||||
channels = append(channels, models.ChannelData{
|
||||
ChannelCode: item.SubChannelCode,
|
||||
ProductID: item.ProductID,
|
||||
})
|
||||
}
|
||||
|
||||
// 总数
|
||||
|
|
|
@ -528,6 +528,7 @@ type SysChannelListResp struct {
|
|||
|
||||
type ChannelData struct {
|
||||
ChannelCode string `json:"channel_code"` // 渠道编码
|
||||
ProductID int `json:"product_id"` // 产品ID
|
||||
}
|
||||
|
||||
// AddProductReq 添加新产品请求结构体
|
||||
|
|
Loading…
Reference in New Issue
Block a user