...
|
...
|
@@ -6,19 +6,21 @@ import ( |
|
|
"oppmg/protocol"
|
|
|
"oppmg/utils"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type SqlData struct {
|
|
|
UserId int64 `orm:"column(user_id)"`
|
|
|
DepartmentId int64 `orm:"column(department_id)"`
|
|
|
AuditTemplateId int64 `orm:"column(audit_template_id)"`
|
|
|
ChanceTypeId int `orm:"column(chance_type_id)"`
|
|
|
PublishStatus int `orm:"column(publish_status)"`
|
|
|
CreateAt string `orm:"column(create_at);type(timestamp)"`
|
|
|
ReviewStatus int `orm:"column(review_status)"`
|
|
|
EnableStatus int `orm:"column(enable_status)"`
|
|
|
DiscoveryScore string `orm:"column(discovery_score)"`
|
|
|
CommentTotal string `orm:"column(comment_total)"`
|
|
|
Id int64 `orm:"column(id)"`
|
|
|
UserId int64 `orm:"column(user_id)"`
|
|
|
DepartmentId int64 `orm:"column(department_id)"`
|
|
|
AuditTemplateId int64 `orm:"column(audit_template_id)"`
|
|
|
ChanceTypeId int `orm:"column(chance_type_id)"`
|
|
|
PublishStatus int `orm:"column(publish_status)"`
|
|
|
CreateAt time.Time `orm:"column(create_at);type(timestamp)"`
|
|
|
ReviewStatus int `orm:"column(review_status)"`
|
|
|
EnableStatus int `orm:"column(enable_status)"`
|
|
|
DiscoveryScore string `orm:"column(discovery_score)"`
|
|
|
CommentTotal string `orm:"column(comment_total)"`
|
|
|
}
|
|
|
|
|
|
func GetAuditList(param protocol.RequestAuditList, companyid int64) (protocol.ResponseAuditList, error) {
|
...
|
...
|
@@ -39,7 +41,7 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64) (protocol.Re |
|
|
List: make([]protocol.RspAuditList, 0),
|
|
|
}
|
|
|
dataStart := (param.PageIndex - 1) * param.PageSize
|
|
|
datasql.WriteString(`SELECT user_id,department_id,audit_template_id,chance_type_id
|
|
|
datasql.WriteString(`SELECT id,user_id,department_id,audit_template_id,chance_type_id
|
|
|
,publish_status,create_at,review_status,enable_status
|
|
|
,discovery_score,comment_total
|
|
|
FROM chance
|
...
|
...
|
@@ -60,7 +62,17 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64) (protocol.Re |
|
|
return returnData, nil
|
|
|
}
|
|
|
for _, v := range data {
|
|
|
item := protocol.RspAuditList{}
|
|
|
t := v.CreateAt.Unix()
|
|
|
item := protocol.RspAuditList{
|
|
|
Id: v.Id,
|
|
|
EnableStatus: v.EnableStatus,
|
|
|
PublishStatus: v.PublishStatus,
|
|
|
}
|
|
|
if t < 0 {
|
|
|
item.CreateTime = 0
|
|
|
} else {
|
|
|
item.CreateTime = t
|
|
|
}
|
|
|
if u, err := models.GetUserById(v.UserId); err == nil {
|
|
|
item.UserName = u.NickName
|
|
|
}
|
...
|
...
|
@@ -71,7 +83,6 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64) (protocol.Re |
|
|
item.TemplateName = at.Name
|
|
|
item.Code = at.Code
|
|
|
}
|
|
|
|
|
|
if ct, err := models.GetChanceTypeById(v.ChanceTypeId); err == nil {
|
|
|
item.ChanceType = ct.Name
|
|
|
}
|
...
|
...
|
|