feat:完善企业信息
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/serve/orm"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type TechnologyProductVisit struct {
|
||||
@ -11,11 +12,15 @@ type TechnologyProductVisit struct {
|
||||
}
|
||||
|
||||
type TechnologyProductVisitInfo struct {
|
||||
model.Model
|
||||
VisitAt time.Time `json:"visit_at"`
|
||||
model.ManageCompanyBasic
|
||||
}
|
||||
|
||||
func (m *TechnologyProductVisit) Visit(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*TechnologyProductVisitInfo, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS v").
|
||||
Select("v.id").
|
||||
Select("v.id", "v.visit_at", "c.id AS company_id", "c.name AS company_name", "c.image AS company_image",
|
||||
"c.kind AS company_kind", "c.url AS company_url").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON v.company_id = c.id", model.NewManageCompany().TableName())).
|
||||
Where("v.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
|
Reference in New Issue
Block a user