feat:增加专利模型数据
This commit is contained in:
@ -120,7 +120,7 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
func (c *Instance) Shelf(id uint64, status int) error {
|
||||
mTechnologyInstance := model.NewTechnologyInstance()
|
||||
mTechnologyInstance.ID = id
|
||||
isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "m_uid", "shelf_status", "status"})
|
||||
isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "m_uid", "shelf", "status"})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@ -130,11 +130,11 @@ func (c *Instance) Shelf(id uint64, status int) error {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree {
|
||||
return errors.New("操作错误,当前状态不允许处理上下架")
|
||||
} else if mTechnologyInstance.ShelfStatus.ShelfStatus == model2.ShelfStatusKind(status) {
|
||||
} else if mTechnologyInstance.ShelfStatus.Shelf == model2.ShelfStatusKind(status) {
|
||||
return errors.New("操作错误,状态异常")
|
||||
}
|
||||
if err = model2.Updates(mTechnologyInstance.TechnologyInstance, map[string]interface{}{
|
||||
"shelf_status": status, "updated_at": time.Now(),
|
||||
"shelf": status, "updated_at": time.Now(),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -158,11 +158,11 @@ func (c *Product) Shelf(id uint64, status int) error {
|
||||
return errors.New("操作错误,产品信息不存在或已被删除")
|
||||
} else if mTechnologyProduct.MUid != c.ManageUID {
|
||||
return errors.New("无权限操作")
|
||||
} else if mTechnologyProduct.ShelfStatus.ShelfStatus == model2.ShelfStatusKind(status) {
|
||||
} else if mTechnologyProduct.ShelfStatus.Shelf == model2.ShelfStatusKind(status) {
|
||||
return errors.New("操作错误,无需变更上下架状态")
|
||||
}
|
||||
return model2.Updates(mTechnologyProduct.TechnologyProduct, map[string]interface{}{
|
||||
"shelf_status": status, "updated_at": time.Now(),
|
||||
"shelf": status, "updated_at": time.Now(),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user