feat:优化项目信息

This commit is contained in:
henry
2022-02-09 11:06:59 +08:00
parent 1cec70ebee
commit 2d8be509b7
15 changed files with 217 additions and 285 deletions

View File

@ -97,20 +97,20 @@ func (c *Project) Form(params *ProjectParams) error {
// Shelf 上下架操作
func (c *Project) Shelf(id uint64, status int) error {
mTechnologyPatent := model.NewTechnologyPatent()
mTechnologyPatent.ID = id
mTechnologyProject := model.NewTechnologyProject()
mTechnologyProject.ID = id
isExist, err := model2.FirstField(mTechnologyPatent.TechnologyPatent, []string{"id", "uid"})
isExist, err := model2.FirstField(mTechnologyProject.TechnologyProject, []string{"id", "uid"})
if err != nil {
return err
} else if !isExist {
return errors.New("操作错误,项目信息不存在或已被删除")
} else if mTechnologyPatent.UID != c.UID {
} else if mTechnologyProject.UID != c.UID {
return errors.New("操作错误,无权限操作")
}
return model2.Updates(mTechnologyPatent.TechnologyPatent, map[string]interface{}{
return model2.Updates(mTechnologyProject.TechnologyProject, map[string]interface{}{
"shelf_status": status, "updated_at": time.Now(),
})
}