feat:优化项目信息
This commit is contained in:
@ -86,7 +86,7 @@ func (c *PatentParams) add(tenantID, uid uint64) error {
|
||||
// 查询当前的专家信息
|
||||
mUserExpert := model.NewUserExpert()
|
||||
|
||||
if isExist, err = model2.FirstField(mUserExpert.UserExpert, []string{"id", "expert_id"}, model2.NewWhere("uid", uid),
|
||||
if isExist, err = model2.LastWhere(mUserExpert.UserExpert, []string{"id", "expert_id"}, model2.NewWhere("uid", uid),
|
||||
model2.NewWhere("invalid_status", model2.InvalidStatusForNot)); err != nil {
|
||||
return err
|
||||
} else if !isExist {
|
||||
|
@ -142,8 +142,8 @@ func (c *Activity) Join(id uint64) error {
|
||||
var count int64
|
||||
|
||||
if err = model2.Count(model.NewActivityJoin().ActivityJoin, &count, model2.NewWhere("id", c.UID),
|
||||
model2.NewWhere("identity", c.SelectIdentity),
|
||||
model2.NewWhere("activity_id", id), model2.NewWhere("status", model2.ActivityJoinStatusForSuccess)); err != nil {
|
||||
model2.NewWhere("identity", c.SelectIdentity), model2.NewWhere("activity_id", id),
|
||||
model2.NewWhere("status", model2.ActivityJoinStatusForSuccess)); err != nil {
|
||||
return err
|
||||
}
|
||||
if count > 0 {
|
||||
|
@ -176,7 +176,7 @@ func (c *Index) static() (*InstanceStaticInfo, error) {
|
||||
// 专利信息
|
||||
mTechnologyPatent := model.NewTechnologyPatent()
|
||||
|
||||
if err = model2.Count(mTechnologyPatent.TechnologyPatent, &out.PatentCount, model2.NewWhere("shelf_status", model2.ShelfStatusForUp)); err != nil {
|
||||
if err = model2.Count(mTechnologyPatent.TechnologyPatent, &out.PatentCount); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//成果信息
|
||||
|
@ -72,8 +72,9 @@ func (m *TechnologyPatent) Distribution() ([]*DataAreaDistributionInfo, error) {
|
||||
Select("e.province", "e.city", "e.district", "GROUP_CONCAT(p_c.industry_detail SEPARATOR '&') AS industry").
|
||||
Joins(fmt.Sprintf("RIGHT JOIN %s AS p_c ON p.ipc_code = p_c.ipc AND p_c.is_deleted = %d",
|
||||
model.NewTechnologyPatentClassify().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS u_e ON p.uid = u_e.uid", model.NewUserExpert().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON u_e.expert_id = e.id", model.NewManageExpert().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS p_e ON p.id = p_e.patent_id AND p_e.is_deleted = %d",
|
||||
model.NewTechnologyPatentExpert().TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON p_e.expert_id = e.id", model.NewManageExpert().TableName())).
|
||||
Where("p.is_deleted = ?", model.DeleteStatusForNot).
|
||||
Group("e.province").Group("e.city").Group("e.district").
|
||||
Order("e.province " + model.OrderModeToAsc).Order("e.city " + model.OrderModeToAsc).Order("e.district " + model.OrderModeToAsc).
|
||||
|
@ -137,7 +137,7 @@ func (this *Instance) Handle() {
|
||||
&synchronized{iModel: model.NewTechnologyPaper()}, &synchronized{iModel: model.NewTechnologyProduct()},
|
||||
&synchronized{iModel: model.NewTechnologyProject()}, &synchronized{iModel: model.NewTechnologyTopic()},
|
||||
&synchronized{iModel: model.NewTechnologyDemandService()}, &synchronized{iModel: model.NewTechnologyDemandServiceProgress()},
|
||||
&synchronized{iModel: model.NewTechnologyPatent()}, &synchronized{iModel: model.NewTechnologyPatentClassify()},
|
||||
&synchronized{iModel: model.NewTechnologyPatent()}, &synchronized{iModel: model.NewTechnologyPatentExpert()}, &synchronized{iModel: model.NewTechnologyPatentClassify()},
|
||||
&synchronized{iModel: model.NewServiceDocking()},
|
||||
&synchronized{iModel: model.NewServiceMessage()}, &synchronized{iModel: model.NewServiceMessageLog()},
|
||||
&synchronized{iModel: model.NewServiceSolutionCase()}, &synchronized{iModel: model.NewServiceSolutionCaseKind()},
|
||||
|
@ -1,16 +1,23 @@
|
||||
package event
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/serve/logger"
|
||||
)
|
||||
|
||||
type ActivityJoin struct{}
|
||||
|
||||
// Handle 活动参与
|
||||
func (*ActivityJoin) Handle(arg ...interface{}) {
|
||||
_ = model.Create(&model.ActivityJoin{
|
||||
err := model.Create(&model.ActivityJoin{
|
||||
ActivityID: arg[0].(uint64),
|
||||
UID: arg[1].(uint64),
|
||||
Identity: arg[2].(int),
|
||||
Status: model.ActivityJoinStatusForSuccess,
|
||||
})
|
||||
if err != nil {
|
||||
logger.ErrorF("Event 用户【%v - %v】加入活动错误:%v", err, arg[1], arg[2])
|
||||
}
|
||||
}
|
||||
|
||||
func NewActivityJoin() *ActivityJoin {
|
||||
|
Reference in New Issue
Block a user