feat:完善项目信息
This commit is contained in:
@ -35,7 +35,7 @@ type (
|
||||
// ProductVisitInfo 产品浏览信息
|
||||
ProductVisitInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model.TechnologyProductVisitInfo
|
||||
*model.ProductVisitInfo
|
||||
CompanyID string `json:"company_id"`
|
||||
CompanyKeywords []string `json:"company_keywords"`
|
||||
}
|
||||
@ -116,14 +116,14 @@ func (c *Product) Match(id uint64) {
|
||||
|
||||
// Visit 访问信息
|
||||
func (c *Product) Visit(id uint64, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
mTechnologyProductVisit := model.NewTechnologyProductVisit()
|
||||
mUserVisit := model.NewUserVisit()
|
||||
|
||||
where := []*model2.ModelWhere{
|
||||
model2.NewWhere("product_id", id),
|
||||
}
|
||||
var count int64
|
||||
|
||||
out, err := mTechnologyProductVisit.Visit(page, pageSize, &count, where...)
|
||||
out, err := mUserVisit.Product(page, pageSize, &count, where...)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -138,10 +138,10 @@ func (c *Product) Visit(id uint64, page, pageSize int) (*controller.ReturnPages,
|
||||
v.CompanyImage = mManageCompany.Image.Analysis(config2.SettingInfo.Domain)
|
||||
|
||||
list = append(list, &ProductVisitInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
TechnologyProductVisitInfo: v,
|
||||
CompanyID: (&model2.Model{ID: v.CompanyID}).GetEncodeID(),
|
||||
CompanyKeywords: mManageCompany.GetKeywordAttribute(),
|
||||
ID: v.GetEncodeID(),
|
||||
ProductVisitInfo: v,
|
||||
CompanyID: (&model2.Model{ID: v.CompanyID}).GetEncodeID(),
|
||||
CompanyKeywords: mManageCompany.GetKeywordAttribute(),
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
|
@ -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())).
|
||||
|
@ -28,10 +28,10 @@ func (m *ManageLaboratory) Laboratory(page, pageSize int, count *int64, where ..
|
||||
Select("l.id", "l.name", "l.industry", "u.name AS username", "u.mobile", "v.count AS visit_count",
|
||||
"c.count AS collect_count", "l.examine_at AS settled_at").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS u ON l.uid = u.uuid", model.NewUserInstance().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT laboratory_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY laboratory_id) AS v ON l.id = v.laboratory_id",
|
||||
model.NewManageLaboratoryVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT laboratory_id, COUNT(id) AS count FROM %s WHERE is_deleted = %d GROUP BY laboratory_id) AS c ON l.id = c.laboratory_id",
|
||||
model.NewManageLaboratoryCollect().TableName(), model.DeleteStatusForNot))
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON l.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserCollectKindForLaboratory, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON l.id = c.object_id",
|
||||
model.NewUserCollect().TableName(), model.UserCollectKindForLaboratory, model.DeleteStatusForNot))
|
||||
|
||||
if len(where) > 0 {
|
||||
for _, v := range where {
|
||||
|
@ -24,8 +24,8 @@ type TechnologyAchievementInfo struct {
|
||||
func (m *TechnologyAchievement) Achievement(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*TechnologyAchievementInfo, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS a").
|
||||
Select("a.id", "a.title", "a.industry", "v.count AS visit_count", "a.shelf_status", "a.created_at").
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT achievement_id, COUNT(id) AS count FROM %s WHERE is_deleted = %d) AS v ON a.id = v.achievement_id",
|
||||
model.NewTechnologyAchievementVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON a.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
|
||||
Where("a.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
if len(where) > 0 {
|
||||
|
@ -30,10 +30,10 @@ func (m *TechnologyProduct) Product(page, pageSize int, count *int64, where ...*
|
||||
db := orm.GetDB().Table(m.TableName()+" AS p").
|
||||
Select("p.id", "p.title", "p.image", "p.maturity", "p.industry", "p.cooperation_mode", "p.keyword",
|
||||
"v.count AS v visit_count", "c.count AS collect_count").
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT product_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY product_id) AS v ON p.id = v.product_id",
|
||||
model.NewTechnologyProductVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT product_id, COUNT(id) AS count FROM %s WHERE is_deleted = %d GROUP BY product_id) AS c ON p.id = c.product_id",
|
||||
model.NewTechnologyProductCollect().TableName(), model.DeleteStatusForNot))
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON p.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserVisitKindForTechnologyProduct, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON p.id = c.object_id",
|
||||
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyProduct, model.DeleteStatusForNot))
|
||||
|
||||
out := make([]*TechnologyProductInfo, 0)
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type TechnologyProductCollect struct {
|
||||
*model.TechnologyProductCollect
|
||||
}
|
||||
|
||||
func NewTechnologyProductCollect() *TechnologyProductCollect {
|
||||
return &TechnologyProductCollect{model.NewTechnologyProductCollect()}
|
||||
}
|
11
app/api/enterprise/model/user_collect.go
Normal file
11
app/api/enterprise/model/user_collect.go
Normal file
@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type UserCollect struct {
|
||||
*model.UserCollect
|
||||
}
|
||||
|
||||
func NewUserCollect() *UserCollect {
|
||||
return &UserCollect{model.NewUserCollect()}
|
||||
}
|
@ -7,17 +7,19 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type TechnologyProductVisit struct {
|
||||
*model.TechnologyProductVisit
|
||||
type UserVisit struct {
|
||||
*model.UserVisit
|
||||
}
|
||||
|
||||
type TechnologyProductVisitInfo struct {
|
||||
model.Model
|
||||
VisitAt time.Time `json:"visit_at"`
|
||||
model.ManageCompanyBasic
|
||||
}
|
||||
type (
|
||||
ProductVisitInfo 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) {
|
||||
func (m *UserVisit) Product(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ProductVisitInfo, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS v").
|
||||
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").
|
||||
@ -25,9 +27,10 @@ func (m *TechnologyProductVisit) Visit(page, pageSize int, count *int64, where .
|
||||
model.NewUserCompany().TableName(), model.InvalidStatusForNot, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON u_c.company_id = c.id", model.NewManageCompany().TableName())).
|
||||
Where("v.is_deleted = ?", model.DeleteStatusForNot).
|
||||
Where("v.kind = ?", model.UserVisitKindForTechnologyProduct).
|
||||
Where("u_c.id > ?", 0)
|
||||
|
||||
out := make([]*TechnologyProductVisitInfo, 0)
|
||||
out := make([]*ProductVisitInfo, 0)
|
||||
|
||||
if len(where) > 0 {
|
||||
for _, v := range where {
|
||||
@ -43,6 +46,6 @@ func (m *TechnologyProductVisit) Visit(page, pageSize int, count *int64, where .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func NewTechnologyProductVisit() *TechnologyProductVisit {
|
||||
return &TechnologyProductVisit{model.NewTechnologyProductVisit()}
|
||||
func NewUserVisit() *UserVisit {
|
||||
return &UserVisit{model.NewUserVisit()}
|
||||
}
|
@ -9,8 +9,6 @@ import (
|
||||
"SciencesServer/config"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Achievement 技术成果
|
||||
@ -91,16 +89,19 @@ func (c *Achievement) Detail(id uint64) (*AchievementDetailInfo, error) {
|
||||
} else if out.ID <= 0 {
|
||||
return nil, errors.New("操作错误,成果信息不存在或已被删除")
|
||||
}
|
||||
var uid uint64 = 0
|
||||
//var uid uint64 = 0
|
||||
|
||||
if c.Enterprise != nil {
|
||||
uid = c.UID
|
||||
//uid = c.UID
|
||||
}
|
||||
mTechnologyAchievementCollect := model.NewTechnologyAchievementCollect()
|
||||
|
||||
_ = model2.UpdatesWhere(mTechnologyAchievementCollect.TechnologyAchievementCollect, map[string]interface{}{
|
||||
"count": gorm.Expr("count + ?", 1), "updated_at": time.Now(),
|
||||
}, []*model2.ModelWhere{model2.NewWhere("uid", uid), model2.NewWhere("achievement_id", id)})
|
||||
// TODO:缺少错误
|
||||
//mUserCollect := model.NewUserCollect()
|
||||
//
|
||||
//_ = model2.UpdatesWhere(mUserCollect.UserCollect, map[string]interface{}{
|
||||
// "count": gorm.Expr("count + ?", 1), "updated_at": time.Now(),
|
||||
//}, []*model2.ModelWhere{model2.NewWhere("uid", uid),
|
||||
// model2.NewWhere("kind", model2.UserCollectKindForTechnologyAchievement),
|
||||
// model2.NewWhere("achievement_id", id)})
|
||||
|
||||
return &AchievementDetailInfo{
|
||||
AchievementInfo: AchievementInfo{
|
||||
|
@ -20,19 +20,19 @@ type ManageCompanyProduct struct {
|
||||
|
||||
// Product 产品信息
|
||||
func (m *ManageCompany) Product(id, uid uint64, page, pageSize int, count *int64) ([]*ManageCompanyProduct, error) {
|
||||
mTechnologyProductCollect := model.NewTechnologyProductCollect()
|
||||
mNewUserCollect := model.NewUserCollect()
|
||||
|
||||
db := orm.GetDB().Table(model.NewUserCompany().TableName()+" u_c").
|
||||
Select("p.id", "p.title", "p.image", "p.industry", "p.maturity", "p.lead_standard", "p.cooperation_mode",
|
||||
"p.keyword", "v.count AS visit_count", "IFNULL(c_u.id, 0) AS is_collect", "c.count AS collect_count").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS p ON u_c.uid = p.uid AND p.shelf_status = %d AND p.status = %d AND p.is_deleted = %d",
|
||||
model.NewTechnologyProduct().TableName(), model.ShelfStatusForUp, model.TechnologyProductStatusForAgree, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT product_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY product_id) AS v ON p.id = v.product_id",
|
||||
model.NewTechnologyProductVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT product_id, COUNT(count) AS count FROM %s WHERE is_deleted = %d GROUP BY product_id) AS c ON p.id = c.product_id",
|
||||
mTechnologyProductCollect.TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c_u ON p.id = c_u.product_id AND c_u.uid = %d AND c_u.is_deleted = %d",
|
||||
mTechnologyProductCollect.TableName(), uid, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON p.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserVisitKindForTechnologyProduct, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON p.id = c.object_id",
|
||||
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyProduct, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c_u ON p.id = c_u.product_id AND c_u.uid = %d AND c_u.kind = %d AND c_u.is_deleted = %d",
|
||||
mNewUserCollect.TableName(), uid, model.UserCollectKindForTechnologyProduct, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("")).
|
||||
Where("u_c.company_id = ?", id).
|
||||
Where("u_c.invalid_status = ?", model.InvalidStatusForNot).
|
||||
|
@ -22,10 +22,10 @@ func (m *TechnologyAchievement) Achievement(page, pageSize int, count *int64, wh
|
||||
db := orm.GetDB().Table(m.TableName()+" AS a").
|
||||
Select("a.id", "a.title", "a.mode", "a.image", "a.charge_info", "a.industry", "a.customer", "a.maturity",
|
||||
"a.cooperation_mode", "a.keyword", "v.count AS visit_count", "c.count AS collect_count").
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT achievement_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY achievement_id) AS v ON a.id = v.achievement_id",
|
||||
model.NewTechnologyAchievementVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT achievement_id, COUNT(id) AS count FROM %s WHERE is_deleted = %d GROUP BY achievement_id) AS c ON a.id = c.achievement_id",
|
||||
model.NewTechnologyAchievementCollect().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON a.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON a.id = c.object_id",
|
||||
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
|
||||
Where("a.status = ?", model.TechnologyAchievementStatusForAgree).
|
||||
Where("a.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
@ -49,10 +49,10 @@ func (m *TechnologyAchievement) Achievement(page, pageSize int, count *int64, wh
|
||||
func (m *TechnologyAchievement) Detail(id uint64) (*TechnologyAchievementInfo, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS a").
|
||||
Select("a.*", "v.count AS visit_count", "c.count AS collect_count").
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT achievement_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY achievement_id) AS v ON a.id = v.achievement_id",
|
||||
model.NewTechnologyAchievementVisit().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT achievement_id, SUM(count) AS count FROM %s WHERE is_deleted = %d GROUP BY achievement_id) AS c ON a.id = c.achievement_id",
|
||||
model.NewTechnologyAchievementCollect().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON a.id = v.object_id",
|
||||
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON a.id = c.object_id",
|
||||
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
|
||||
Where("a.id = ?", id)
|
||||
|
||||
out := new(TechnologyAchievementInfo)
|
||||
|
@ -1,11 +0,0 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type TechnologyAchievementCollect struct {
|
||||
*model.TechnologyAchievementCollect
|
||||
}
|
||||
|
||||
func NewTechnologyAchievementCollect() *TechnologyAchievementCollect {
|
||||
return &TechnologyAchievementCollect{model.NewTechnologyAchievementCollect()}
|
||||
}
|
11
app/api/website/model/user_collect.go
Normal file
11
app/api/website/model/user_collect.go
Normal file
@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type UserCollect struct {
|
||||
*model.UserCollect
|
||||
}
|
||||
|
||||
func NewUserCollect() *UserCollect {
|
||||
return &UserCollect{model.NewUserCollect()}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// ManageExpertVisit 专家浏览记录数据模型
|
||||
type ManageExpertVisit struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
ExpertID uint64 `gorm:"column:expert_id;index:idx_expert_visit_expert;type:int(11);default:0;comment:专家ID" json:"-"`
|
||||
Count int `gorm:"column:count;type:int(8);default:0;comment:浏览次数" json:"count"`
|
||||
Date time.Time `gorm:"column:date;type:datetime;not null;comment:浏览时间" json:"date"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *ManageExpertVisit) TableName() string {
|
||||
return "manage_expert_visit"
|
||||
}
|
||||
|
||||
func NewManageExpertVisit() *ManageExpertVisit {
|
||||
return &ManageExpertVisit{}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package model
|
||||
|
||||
// ManageLaboratoryCollect 实验室收藏数据模型
|
||||
type ManageLaboratoryCollect struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
LaboratoryID uint64 `gorm:"column:laboratory_id;type:int(11);default:0;comment:实验室ID" json:"-"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *ManageLaboratoryCollect) TableName() string {
|
||||
return "manage_laboratory_collect"
|
||||
}
|
||||
|
||||
func NewManageLaboratoryCollect() *ManageLaboratoryCollect {
|
||||
return &ManageLaboratoryCollect{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// ManageLaboratoryVisit 实验室浏览记录数据模型
|
||||
type ManageLaboratoryVisit struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
LaboratoryID uint64 `gorm:"column:laboratory_id;index:idx_laboratory_visit_laboratory;type:int(11);default:0;comment:实验室ID" json:"-"`
|
||||
Count int `gorm:"column:count;type:int(8);default:0;comment:浏览次数" json:"count"`
|
||||
Date time.Time `gorm:"column:date;type:datetime;not null;comment:浏览时间" json:"date"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *ManageLaboratoryVisit) TableName() string {
|
||||
return "manage_laboratory_visit"
|
||||
}
|
||||
|
||||
func NewManageLaboratoryVisit() *ManageLaboratoryVisit {
|
||||
return &ManageLaboratoryVisit{}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package model
|
||||
|
||||
// TechnologyAchievementCollect 科技成果收藏数据模型
|
||||
type TechnologyAchievementCollect struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
AchievementID uint64 `gorm:"column:achievement_id;type:int(11);default:0;comment:科技成果ID" json:"-"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *TechnologyAchievementCollect) TableName() string {
|
||||
return "technology_achievement_collect"
|
||||
}
|
||||
|
||||
func NewTechnologyAchievementCollect() *TechnologyAchievementCollect {
|
||||
return &TechnologyAchievementCollect{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// TechnologyAchievementVisit 科技成果访问数据模型
|
||||
type TechnologyAchievementVisit struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
AchievementID uint64 `gorm:"column:achievement_id;index:idx_achievement_visit_achievement;type:int(11);default:0;comment:科技成果ID" json:"-"`
|
||||
Count int `gorm:"column:count;type:int(8);default:0;comment:浏览次数" json:"count"`
|
||||
Date time.Time `gorm:"column:date;type:datetime;not null;comment:浏览时间" json:"date"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *TechnologyAchievementVisit) TableName() string {
|
||||
return "technology_achievement_visit"
|
||||
}
|
||||
|
||||
func NewTechnologyAchievementVisit() *TechnologyAchievementVisit {
|
||||
return &TechnologyAchievementVisit{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// TechnologyDemandVisit 技术需求访问数据模型
|
||||
type TechnologyDemandVisit struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
DemandID uint64 `gorm:"column:demand_id;index:idx_demand_visit_demand;type:int(11);default:0;comment:科技产品ID" json:"product_id"`
|
||||
Count int `gorm:"column:count;type:int(8);default:0;comment:浏览次数" json:"count"`
|
||||
Date time.Time `gorm:"column:date;type:datetime;not null;comment:浏览时间" json:"date"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *TechnologyDemandVisit) TableName() string {
|
||||
return "technology_demand_visit"
|
||||
}
|
||||
|
||||
func NewTechnologyDemandVisit() *TechnologyDemandVisit {
|
||||
return &TechnologyDemandVisit{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// TechnologyProductVisit 技术产品访问数据模型
|
||||
type TechnologyProductVisit struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
ProductID uint64 `gorm:"column:product_id;index:idx_product_visit_product;type:int(11);default:0;comment:科技产品ID" json:"product_id"`
|
||||
Count int `gorm:"column:count;type:int(8);default:0;comment:浏览次数" json:"count"`
|
||||
Date time.Time `gorm:"column:date;type:datetime;not null;comment:浏览时间" json:"date"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *TechnologyProductVisit) TableName() string {
|
||||
return "technology_product_visit"
|
||||
}
|
||||
|
||||
func NewTechnologyProductVisit() *TechnologyProductVisit {
|
||||
return &TechnologyProductVisit{}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package model
|
||||
|
||||
// TechnologyProductCollect 产品收藏数据模型
|
||||
type TechnologyProductCollect struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
ProductID uint64 `gorm:"column:product_id;type:int(11);default:0;comment:产品ID" json:"-"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *TechnologyProductCollect) TableName() string {
|
||||
return "technology_product_collect"
|
||||
}
|
||||
|
||||
func NewTechnologyProductCollect() *TechnologyProductCollect {
|
||||
return &TechnologyProductCollect{}
|
||||
}
|
@ -17,6 +17,12 @@ const (
|
||||
UserCollectKindForLaboratory UserCollectKind = iota + 1
|
||||
// UserCollectKindForExpert 专家
|
||||
UserCollectKindForExpert
|
||||
// UserCollectKindForCompany 公司
|
||||
UserCollectKindForCompany
|
||||
// UserCollectKindForTechnologyAchievement 技术成果
|
||||
UserCollectKindForTechnologyAchievement
|
||||
// UserCollectKindForTechnologyProduct 技术产品
|
||||
UserCollectKindForTechnologyProduct
|
||||
)
|
||||
|
||||
func (m *UserCollect) TableName() string {
|
||||
|
@ -21,6 +21,12 @@ const (
|
||||
UserVisitKindForLaboratory UserCollectKind = iota + 1
|
||||
// UserVisitKindForExpert 专家
|
||||
UserVisitKindForExpert
|
||||
// UserVisitKindForCompany 公司
|
||||
UserVisitKindForCompany
|
||||
// UserVisitKindForTechnologyAchievement 技术成果
|
||||
UserVisitKindForTechnologyAchievement
|
||||
// UserVisitKindForTechnologyProduct 技术产品
|
||||
UserVisitKindForTechnologyProduct
|
||||
)
|
||||
|
||||
func (m *UserVisit) TableName() string {
|
||||
|
Reference in New Issue
Block a user