Merge branch 'master' of https://git.code.tencent.com/beijing-rtss-test/bj-rtsts-server-go
This commit is contained in:
commit
b28cda6837
|
@ -22,6 +22,8 @@ type PublishedDto struct {
|
|||
Category string `json:"category" form:"category"`
|
||||
PublishAt JsonTime `json:"publishAt" form:"publishAt" time_format:"2006-01-02 15:04:05"`
|
||||
Status int32 `json:"status" form:"status"`
|
||||
Version int32 `json:"version" form:"version"`
|
||||
Publisher string `json:"publisher" form:"publisher"`
|
||||
}
|
||||
|
||||
type PublishReqDto struct {
|
||||
|
|
|
@ -15,9 +15,15 @@ var publishMapMutex sync.Mutex
|
|||
|
||||
// 查找发布地图分页信息
|
||||
func PageQueryPublished(req *dto.PagePublishedReqDto) *dto.PageDto {
|
||||
p, pv := dbquery.Published, dbquery.PublishedVersion
|
||||
where := p.Select(p.ID, p.Code.As("name"), p.Type, p.Category, p.Status, pv.Note, pv.PublishAt).
|
||||
LeftJoin(pv, p.DataID.EqCol(pv.ID)).Order(pv.PublishAt.Desc())
|
||||
p, pv, u := dbquery.Published, dbquery.PublishedVersion, dbquery.User
|
||||
where := p.
|
||||
Select(
|
||||
p.ID, p.Code.As("name"), p.Type, p.Category, p.Status,
|
||||
pv.Note, pv.PublishAt, pv.Version, u.Name.As("publisher"),
|
||||
).
|
||||
LeftJoin(pv, p.DataID.EqCol(pv.ID)).
|
||||
LeftJoin(u, pv.UserID.EqCol(u.ID)).
|
||||
Order(pv.PublishAt.Desc())
|
||||
if req.Name != "" {
|
||||
where = where.Where(p.Code.Like(fmt.Sprintf("%%%s%%", req.Name)))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue