作者 yangfu

机会修改

... ... @@ -87,7 +87,7 @@ func DeleteAuditTemplate(id int64) (err error) {
//获取审核模板列表
func GetAuditTemplates(companyId int64, chanceTypeId int) (v []*AuditTemplate, err error) {
o := orm.NewOrm()
sql := "select * from audit_template where company_id=? and chance_type_id=? and enable_status=1"
sql := "select * from audit_template where company_id=? and chance_type_id=? and enable_status=1 order by sort_num"
if _, err = o.Raw(sql, companyId, chanceTypeId).QueryRows(&v); err == nil {
return
}
... ...
... ... @@ -539,11 +539,11 @@ func ChanceUpdate(header *protocol.RequestHeader, request *protocol.ChanceUpdate
log.Info(fmt.Sprintf("机会编辑 is_publish:%v chance.review_status:%v 是否是本人:%v", request.IsPublish, chance.ReviewStatus, chance.UserId == header.UserId))
}
//1.需要验证角色权限 2是否是审核人 3.是否是本人
if chance.ReviewStatus != protocol.ReviewStatusPass && chance.UserId != header.UserId { //chance.UserId != header.UserId
err = protocol.NewErrWithMessage(5206)
log.Error(fmt.Sprintf("user:%v 无权限操作机会 chance:%v", header.UserId, chance.Id))
return
}
//if chance.ReviewStatus != protocol.ReviewStatusPass && chance.UserId != header.UserId { //chance.UserId != header.UserId
// err = protocol.NewErrWithMessage(5206)
// log.Error(fmt.Sprintf("user:%v 无权限操作机会 chance:%v", header.UserId, chance.Id))
// return
//}
//1.模板是否存在
if template, err = models.GetAuditTemplateById(chance.AuditTemplateId); err != nil {
log.Error("模板不存在:", chance.AuditTemplateId, err)
... ...