feat:优化项目信息

This commit is contained in:
henry
2022-03-05 15:31:22 +08:00
parent dcb5948e91
commit 4dc8deaadb
27 changed files with 401 additions and 138 deletions

View File

@ -52,7 +52,7 @@ func (m *TechnologyPatent) IsExistParams(params map[string]interface{}) (bool, e
if len(params) > 0 {
for k, v := range params {
db = db.Or(fmt.Sprintf("%s = %v AND is_deleted = %d", k, v, model.DeleteStatusForNot))
db = db.Or(fmt.Sprintf("'%s' = '%v' AND is_deleted = %d", k, v, model.DeleteStatusForNot))
}
}
err := db.Count(&count).Error

View File

@ -18,14 +18,15 @@ type TechnologyPatentExpertInfo struct {
ApplyCode string `json:"apply_code"`
ApplyName string `json:"apply_name"`
ApplyAt string `json:"apply_at"`
Inventor string `json:"inventor"`
Status model.TechnologyPatentStatus `json:"status"`
CreatedAt time.Time
CreatedAt time.Time `json:"created_at"`
}
// Patent 专利信息
func (m *TechnologyPatentExpert) Patent(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*TechnologyPatentExpertInfo, error) {
db := orm.GetDB().Table(m.TableName()+" AS u").
Select("p.id", "p.title", "p.apply_code", "p.apply_name", "p.apply_at", "p.status", "p.created_at").
Select("p.id", "p.title", "p.apply_code", "p.apply_name", "p.apply_at", "p.inventor", "p.status", "p.created_at").
Joins(fmt.Sprintf("LEFT JOIN %s AS p ON u.patent_id = p.id", model.NewTechnologyPatent().TableName())).
Where("u.is_deleted = ?", model.DeleteStatusForNot)

View File

@ -0,0 +1 @@
package model