🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
- * null 数据不会拼接 - group\_concat(ifNull([s.name](http://s.name/), '')) --- ~~~ modelDB4, err := dao2.BoardStock.As("a").Ctx(ctx). Fields("a.SecuCode"). Fields("GROUP_CONCAT(b.`Name` order by (case b.`Category` when 3 then 3 when 1 then 2 when 2 then 1 end) desc, b.BeginDate desc, b.InnerCode) as name"). Fields("GROUP_CONCAT(b.`Code` order by (case b.`Category` when 3 then 3 when 1 then 2 when 2 then 1 end) desc, b.BeginDate desc, b.Code) as inner_code"). InnerJoin("board_main b on a.InnerCode=b.InnerCode"). Where("a.State=1 and b.EndDate is NULL"). Group("SecuCode").All() ~~~