feat:完善企业信息

This commit is contained in:
henry
2021-12-08 10:07:54 +08:00
parent 95e8fdb9bb
commit 10a7e9cacd
8 changed files with 81 additions and 26 deletions

View File

@ -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)