Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文档编辑标签数量加减错误 #16

Open
bay1 opened this issue Aug 14, 2018 · 0 comments
Open

文档编辑标签数量加减错误 #16

bay1 opened this issue Aug 14, 2018 · 0 comments

Comments

@bay1
Copy link

bay1 commented Aug 14, 2018

文档编辑函数中

//文档编辑
func (this *UserController) DocEdit() {

原分类-1操作应该放置在info的相关量重新赋值之前!相关代码如下:

// 原分类-1
models.Regulate(models.GetTableCategory(), "Cnt", -1, fmt.Sprintf("Id in(%v,%v,%v)", info.ChanelId, info.Cid, info.Pid))

doc.Title = params["Title"].(string)
doc.Keywords = ### params["Tags"].(string)
doc.Description = params["Intro"].(string)
info.Pid = params["Pid"].(int)
info.Cid = params["Cid"].(int)
info.ChanelId = params["Chanel"].(int)
info.Price = params["Price"].(int)
info.TimeUpdate = int(time.Now().Unix())
orm.NewOrm().Update(&doc, "Title", "Keywords", "Description")
orm.NewOrm().Update(&info, "Pid", "Cid", "ChanelId", "Price")


//新分类+1
models.Regulate(models.GetTableCategory(), "Cnt", 1, fmt.Sprintf("Id in(%v,%v,%v)", params["Chanel"], params["Cid"], params["Pid"]))
this.ResponseJson(true, "文档编辑成功")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant