作者 yangfu

我的审核修改

... ... @@ -103,7 +103,7 @@ func DeleteChance(id int64) (err error) {
func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
sql := `select a.*,b.images,speechs,videos
from (
select id,user_id,create_at,source_content,approve_data from chance
select id,user_id,create_at,source_content,approve_data,review_status from chance
where user_id=? and company_id=? and review_status in (?) and (?=0 or id>?)
order by create_at desc
limit ?
... ... @@ -127,7 +127,7 @@ order by create_at desc
func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
select a.*,b.user_id,b.source_content,b.enable_status from (
select a.*,b.user_id,b.source_content,b.enable_status,b.review_status from (
select id,approve_time,approve_data,uid,chance_id,approve_message,create_at process_create_time
from audit_flow_process where uid=? and enable_status =1 and review_status in (%v) and (?=0 or id>?)
)a left outer join chance b on a.chance_id = b.id
... ...
... ... @@ -141,6 +141,7 @@ type ChanceItemOrm struct {
Images string `orm:"column(images)"`
Voices string `orm:"column(speechs)"`
Videos string `orm:"column(videos)"`
ReviewStatus int `orm:"column(review_status)"` //审核状态 1:待审核 2:被退回 3:已通过
ApproveData string `json:"approveData"` //审核数据
}
... ... @@ -164,6 +165,7 @@ type ChanceApproveItemOrm struct {
Images string `orm:"column(images)"`
Voices string `orm:"column(speechs)"`
Videos string `orm:"column(videos)"`
ReviewStatus int `orm:"column(review_status)"`
Id int64 `orm:"column(id)"` //审核id
ApproveTime time.Time `orm:"column(approve_time)"`
... ... @@ -183,7 +185,8 @@ type ChanceDetailResponse struct {
ChanceData interface{} `json:"chanceData,omitempty"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData
ApproveData *ApproveData `json:"approveData"`
ApproveProcess []*ProcessItem `json:"approveProcess"`
ApproveAccess *ApproveAccess `json:"approveAccess"` //
ApproveAccess *ApproveAccess `json:"approveAccess"` //
ReviewStatus int `orm:"column(review_status)"` //审核状态 1:待审核 2:被退回 3:已通过
}
/*ChanceChangePublish 修改公开状态*/
... ... @@ -301,6 +304,7 @@ type CommonListItem struct {
Message interface{} `json:"message,omitempty"` //消息
Comment interface{} `json:"comment,omitempty"` //评论
ChanceStatus int `json:"chanceStatus"` //0:正常 1.删除 2.关闭
ReviewStatus int `json:"reviewStatus"` //审核状态
//我审核的-通过
Score interface{} `json:"score,omitempty"`
... ...
... ... @@ -800,6 +800,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
jsonUnmarshal(chance.Videos, &item.Videos)
commItem.Chance = item
}
commItem.ReviewStatus = chance.ReviewStatus
if request.ReviewStatus == protocol.ReviewStatusPass {
jsonUnmarshal(chance.ApproveData, &commItem.ApproveData)
}
... ... @@ -828,6 +829,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.CommonListItem{}
commItem.ReviewStatus = chance.ReviewStatus
if len(chance.SourceContent) == 0 { //机会删除
commItem.ChanceStatus = protocol.ChanceStatusDelete
} else if chance.ChanceEnableStatus == 0 { //机会关闭
... ... @@ -839,7 +841,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
//return
} else {
item := protocol.ChanceItem{
Id: chance.Id,
Id: chance.ChanceId,
Provider: provider,
//CreateTime: chance.CreateTime.Unix() * 1000,
}
... ... @@ -868,7 +870,9 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
if request.ReviewStatus == protocol.ReviewStatusPass {
var approveData *protocol.ApproveData
jsonUnmarshal(chance.ApproveData, &approveData)
commItem.Score = approveData.Score
if approveData != nil {
commItem.Score = approveData.Score
}
}
rsp.List = append(rsp.List, commItem)
}
... ... @@ -938,6 +942,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail
}
jsonUnmarshal(chance.ApproveData, &rsp.ApproveData)
rsp.ChanceDetail = item
rsp.ReviewStatus = int(chance.ReviewStatus)
if approveProcess, err = ChanceApproveProcess(header, chance); err != nil {
log.Error(err)
return
... ...