feat:优化项目信息
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
1
app/api/enterprise/model/user_patent.go
Normal file
1
app/api/enterprise/model/user_patent.go
Normal file
@ -0,0 +1 @@
|
||||
package model
|
Reference in New Issue
Block a user