feat:完善项目信息
This commit is contained in:
@ -14,6 +14,7 @@ type ServiceMessage struct {
|
||||
type ServiceMessageInfo struct {
|
||||
*model.ServiceMessage
|
||||
model.Area
|
||||
Domain string `json:"-"`
|
||||
HandleContent string `json:"handle_content"`
|
||||
HandleCreatedAt time.Time `json:"handle_created_at"`
|
||||
}
|
||||
@ -21,11 +22,12 @@ type ServiceMessageInfo struct {
|
||||
func (m *ServiceMessage) Message(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ServiceMessageInfo, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS m").
|
||||
Select("m.*", "l.content AS handle_content", "l.created_at AS handle_created_at",
|
||||
"t.province", "t.city").
|
||||
"t.province", "t.city", "t.domain").
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT MAX(id) AS id, message_id, MAX(created_at) AS created_at, MAX(content) AS content "+
|
||||
"FROM %s WHERE is_deleted = %d GROUP BY message_id) AS l ON m.id = l.message_id",
|
||||
model.NewServiceMessageLog().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON m.tenant_id = t.id", model.NewSysTenant().TableName()))
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON m.tenant_id = t.id", model.NewSysTenant().TableName())).
|
||||
Where("m.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
if len(where) > 0 {
|
||||
for _, v := range where {
|
||||
|
||||
Reference in New Issue
Block a user