feat:完善项目信息

This commit is contained in:
henry
2021-12-27 11:48:44 +08:00
parent 4926c5b765
commit 45b2e85cfd
23 changed files with 92 additions and 240 deletions

View File

@ -64,8 +64,8 @@ func (m *ManageExpert) CompanyVisit(page, pageSize int, count *int64, where ...*
db := orm.GetDB().Table(m.TableName()+" e").
Select("e.id", "e.name", "e.mobile", "e.industry", "v.count AS visit_count", "v.date AS visit_at",
"c.name AS company_name").
Joins(fmt.Sprintf("LEFT JOIN %s AS v ON e.id = v.expert_id AND v.is_deleted = %d",
model.NewManageExpertVisit().TableName(), model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN %s AS v ON e.id = v.object_id AND v.kind = %d AND v.is_deleted = %d",
model.NewUserVisit().TableName(), model.UserVisitKindForCompany, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN %s AS u_c ON v.uid = u_c.uid AND u_c.invalid_status = %d",
model.NewUserCompany().TableName(), model.InvalidStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON u_c.company_id = c.id", model.NewManageCompany().TableName())).