feat:完善项目信息
This commit is contained in:
@ -17,7 +17,7 @@ type (
|
||||
*model.ActivityApply
|
||||
Username string `json:"username"`
|
||||
model.Area
|
||||
HandleUsername string `json:"handle_name"`
|
||||
Handler string `json:"handler"`
|
||||
HandleRemark string `json:"handle_remark"`
|
||||
HandleCreatedAt time.Time `json:"handle_created_at"`
|
||||
}
|
||||
@ -28,11 +28,10 @@ func (m *ActivityApply) Apply(page, pageSize int, count *int64, where ...*model.
|
||||
db := orm.GetDB().Table(m.TableName()+" AS a").
|
||||
Select("a.id", "a.tenant_id", "a.identity", "a.image", "a.title", "a.contact", "a.contact_mobile", "a.begin_at",
|
||||
"a.finish_at", "a.amount", "a.max_number", "a.status", "a.created_at",
|
||||
"t.province", "t.city", "l.name AS handle_name", "l.remark AS handle_remark", "l.created_at AS handle_created_at").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS u ON a.uid = u.uuid", model.NewUserInstance().TableName())).
|
||||
"t.province", "t.city", "l.name AS handler", "l.remark AS handle_remark", "l.created_at AS handle_created_at").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON a.tenant_id = t.id", model.NewSysTenant().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT a.apply_id, MAX(a.id) AS id, MAX(a.created_at) AS created_at, MAX(a.remark) AS remark "+
|
||||
"MAX(u.`name`) AS name FROM %s AS a LEFT JOIN %s ON a.uid = u.uuid WHERE a.is_deleted = %d GROUP BY a.apply_id) AS l ON a.id = l.apply_id",
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT a.apply_id, MAX(a.id) AS id, MAX(a.created_at) AS created_at, MAX(a.remark) AS remark, "+
|
||||
"MAX(u.`name`) AS name FROM %s AS a LEFT JOIN %s AS u ON a.uid = u.uuid WHERE a.is_deleted = %d GROUP BY a.apply_id) AS l ON a.id = l.apply_id",
|
||||
model.NewActivityApplyLog().TableName(), model.NewSysUser().TableName(), model.DeleteStatusForNot)).
|
||||
Where("a.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
|
Reference in New Issue
Block a user