分类
This commit is contained in:
parent
c1758443ca
commit
998b2a85f3
|
@ -92,6 +92,8 @@ func UpdateCategory(c *gin.Context) {
|
|||
Name: req.Name,
|
||||
Pid: req.Pid,
|
||||
}
|
||||
|
||||
//修改分类后需要同步修改编号
|
||||
if old.Pid != category.Pid {
|
||||
category.Number, err = models.GenerateNumber(old.CooperativeBusinessId, req.Pid)
|
||||
if err != nil {
|
||||
|
|
|
@ -123,8 +123,8 @@ func SupplierUpdate(c *gin.Context) {
|
|||
}
|
||||
|
||||
type SupplierListRequest struct {
|
||||
Number string `json:"number"`
|
||||
Name string `json:"name"`
|
||||
Number string `json:"number"` //供应商编号
|
||||
Name string `json:"name"` //供应商名称
|
||||
}
|
||||
|
||||
// SupplierList 供应商列表
|
||||
|
|
|
@ -68,6 +68,7 @@ func GenerateNumber(cid uint32, pid uint32) (string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// GetCategoryById 通过id获取分类
|
||||
func GetCategoryById(id uint32) (*Category, error) {
|
||||
var c *Category
|
||||
err := orm.Eloquent.Model(c).Where("id", id).First(c).Error
|
||||
|
|
Loading…
Reference in New Issue
Block a user