作者 yangfu

我的审核修改

@@ -103,7 +103,7 @@ func DeleteChance(id int64) (err error) { @@ -103,7 +103,7 @@ func DeleteChance(id int64) (err error) {
103 func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) { 103 func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
104 sql := `select a.*,b.images,speechs,videos 104 sql := `select a.*,b.images,speechs,videos
105 from ( 105 from (
106 -select id,user_id,create_at,source_content,approve_data from chance 106 +select id,user_id,create_at,source_content,approve_data,review_status from chance
107 where user_id=? and company_id=? and review_status in (?) and (?=0 or id>?) 107 where user_id=? and company_id=? and review_status in (?) and (?=0 or id>?)
108 order by create_at desc 108 order by create_at desc
109 limit ? 109 limit ?
@@ -127,7 +127,7 @@ order by create_at desc @@ -127,7 +127,7 @@ order by create_at desc
127 127
128 func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) { 128 func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
129 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 129 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
130 -select a.*,b.user_id,b.source_content,b.enable_status from ( 130 +select a.*,b.user_id,b.source_content,b.enable_status,b.review_status from (
131 select id,approve_time,approve_data,uid,chance_id,approve_message,create_at process_create_time 131 select id,approve_time,approve_data,uid,chance_id,approve_message,create_at process_create_time
132 from audit_flow_process where uid=? and enable_status =1 and review_status in (%v) and (?=0 or id>?) 132 from audit_flow_process where uid=? and enable_status =1 and review_status in (%v) and (?=0 or id>?)
133 )a left outer join chance b on a.chance_id = b.id 133 )a left outer join chance b on a.chance_id = b.id
@@ -141,6 +141,7 @@ type ChanceItemOrm struct { @@ -141,6 +141,7 @@ type ChanceItemOrm struct {
141 Images string `orm:"column(images)"` 141 Images string `orm:"column(images)"`
142 Voices string `orm:"column(speechs)"` 142 Voices string `orm:"column(speechs)"`
143 Videos string `orm:"column(videos)"` 143 Videos string `orm:"column(videos)"`
  144 + ReviewStatus int `orm:"column(review_status)"` //审核状态 1:待审核 2:被退回 3:已通过
144 145
145 ApproveData string `json:"approveData"` //审核数据 146 ApproveData string `json:"approveData"` //审核数据
146 } 147 }
@@ -164,6 +165,7 @@ type ChanceApproveItemOrm struct { @@ -164,6 +165,7 @@ type ChanceApproveItemOrm struct {
164 Images string `orm:"column(images)"` 165 Images string `orm:"column(images)"`
165 Voices string `orm:"column(speechs)"` 166 Voices string `orm:"column(speechs)"`
166 Videos string `orm:"column(videos)"` 167 Videos string `orm:"column(videos)"`
  168 + ReviewStatus int `orm:"column(review_status)"`
167 169
168 Id int64 `orm:"column(id)"` //审核id 170 Id int64 `orm:"column(id)"` //审核id
169 ApproveTime time.Time `orm:"column(approve_time)"` 171 ApproveTime time.Time `orm:"column(approve_time)"`
@@ -183,7 +185,8 @@ type ChanceDetailResponse struct { @@ -183,7 +185,8 @@ type ChanceDetailResponse struct {
183 ChanceData interface{} `json:"chanceData,omitempty"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData 185 ChanceData interface{} `json:"chanceData,omitempty"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData
184 ApproveData *ApproveData `json:"approveData"` 186 ApproveData *ApproveData `json:"approveData"`
185 ApproveProcess []*ProcessItem `json:"approveProcess"` 187 ApproveProcess []*ProcessItem `json:"approveProcess"`
186 - ApproveAccess *ApproveAccess `json:"approveAccess"` // 188 + ApproveAccess *ApproveAccess `json:"approveAccess"` //
  189 + ReviewStatus int `orm:"column(review_status)"` //审核状态 1:待审核 2:被退回 3:已通过
187 } 190 }
188 191
189 /*ChanceChangePublish 修改公开状态*/ 192 /*ChanceChangePublish 修改公开状态*/
@@ -301,6 +304,7 @@ type CommonListItem struct { @@ -301,6 +304,7 @@ type CommonListItem struct {
301 Message interface{} `json:"message,omitempty"` //消息 304 Message interface{} `json:"message,omitempty"` //消息
302 Comment interface{} `json:"comment,omitempty"` //评论 305 Comment interface{} `json:"comment,omitempty"` //评论
303 ChanceStatus int `json:"chanceStatus"` //0:正常 1.删除 2.关闭 306 ChanceStatus int `json:"chanceStatus"` //0:正常 1.删除 2.关闭
  307 + ReviewStatus int `json:"reviewStatus"` //审核状态
304 308
305 //我审核的-通过 309 //我审核的-通过
306 Score interface{} `json:"score,omitempty"` 310 Score interface{} `json:"score,omitempty"`
@@ -800,6 +800,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh @@ -800,6 +800,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
800 jsonUnmarshal(chance.Videos, &item.Videos) 800 jsonUnmarshal(chance.Videos, &item.Videos)
801 commItem.Chance = item 801 commItem.Chance = item
802 } 802 }
  803 + commItem.ReviewStatus = chance.ReviewStatus
803 if request.ReviewStatus == protocol.ReviewStatusPass { 804 if request.ReviewStatus == protocol.ReviewStatusPass {
804 jsonUnmarshal(chance.ApproveData, &commItem.ApproveData) 805 jsonUnmarshal(chance.ApproveData, &commItem.ApproveData)
805 } 806 }
@@ -828,6 +829,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove @@ -828,6 +829,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
828 for i := 0; i < len(myChances); i++ { 829 for i := 0; i < len(myChances); i++ {
829 chance := myChances[i] 830 chance := myChances[i]
830 commItem := protocol.CommonListItem{} 831 commItem := protocol.CommonListItem{}
  832 + commItem.ReviewStatus = chance.ReviewStatus
831 if len(chance.SourceContent) == 0 { //机会删除 833 if len(chance.SourceContent) == 0 { //机会删除
832 commItem.ChanceStatus = protocol.ChanceStatusDelete 834 commItem.ChanceStatus = protocol.ChanceStatusDelete
833 } else if chance.ChanceEnableStatus == 0 { //机会关闭 835 } else if chance.ChanceEnableStatus == 0 { //机会关闭
@@ -839,7 +841,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove @@ -839,7 +841,7 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
839 //return 841 //return
840 } else { 842 } else {
841 item := protocol.ChanceItem{ 843 item := protocol.ChanceItem{
842 - Id: chance.Id, 844 + Id: chance.ChanceId,
843 Provider: provider, 845 Provider: provider,
844 //CreateTime: chance.CreateTime.Unix() * 1000, 846 //CreateTime: chance.CreateTime.Unix() * 1000,
845 } 847 }
@@ -868,7 +870,9 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove @@ -868,7 +870,9 @@ func MyApproveChance(header *protocol.RequestHeader, request *protocol.MyApprove
868 if request.ReviewStatus == protocol.ReviewStatusPass { 870 if request.ReviewStatus == protocol.ReviewStatusPass {
869 var approveData *protocol.ApproveData 871 var approveData *protocol.ApproveData
870 jsonUnmarshal(chance.ApproveData, &approveData) 872 jsonUnmarshal(chance.ApproveData, &approveData)
871 - commItem.Score = approveData.Score 873 + if approveData != nil {
  874 + commItem.Score = approveData.Score
  875 + }
872 } 876 }
873 rsp.List = append(rsp.List, commItem) 877 rsp.List = append(rsp.List, commItem)
874 } 878 }
@@ -938,6 +942,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail @@ -938,6 +942,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail
938 } 942 }
939 jsonUnmarshal(chance.ApproveData, &rsp.ApproveData) 943 jsonUnmarshal(chance.ApproveData, &rsp.ApproveData)
940 rsp.ChanceDetail = item 944 rsp.ChanceDetail = item
  945 + rsp.ReviewStatus = int(chance.ReviewStatus)
941 if approveProcess, err = ChanceApproveProcess(header, chance); err != nil { 946 if approveProcess, err = ChanceApproveProcess(header, chance); err != nil {
942 log.Error(err) 947 log.Error(err)
943 return 948 return