作者 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 from chance 106 +select id,user_id,create_at,source_content,approve_data 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 ?
@@ -195,8 +195,8 @@ type MySubmitChanceRequest struct { @@ -195,8 +195,8 @@ type MySubmitChanceRequest struct {
195 ReviewStatus int8 `json:"reviewStatus"` //审核状态 195 ReviewStatus int8 `json:"reviewStatus"` //审核状态
196 } 196 }
197 type MySubmitChanceResponse struct { 197 type MySubmitChanceResponse struct {
198 - List []ChanceItem `json:"list"`  
199 - Total int `json:"total"` 198 + List []CommonListItem `json:"list"`
  199 + Total int `json:"total"`
200 } 200 }
201 201
202 /*MyApproveChance 我审核的机会*/ 202 /*MyApproveChance 我审核的机会*/
@@ -233,6 +233,8 @@ type ChanceItemOrm struct { @@ -233,6 +233,8 @@ type ChanceItemOrm struct {
233 Images string `orm:"column(images)"` 233 Images string `orm:"column(images)"`
234 Voices string `orm:"column(speechs)"` 234 Voices string `orm:"column(speechs)"`
235 Videos string `orm:"column(videos)"` 235 Videos string `orm:"column(videos)"`
  236 +
  237 + ApproveData string `json:"approveData"` //审核数据
236 } 238 }
237 type ChanceItem struct { 239 type ChanceItem struct {
238 Id int64 `json:"id"` 240 Id int64 `json:"id"`
@@ -785,16 +785,23 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh @@ -785,16 +785,23 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
785 785
786 for i := 0; i < len(myChances); i++ { 786 for i := 0; i < len(myChances); i++ {
787 chance := myChances[i] 787 chance := myChances[i]
788 - item := protocol.ChanceItem{  
789 - Id: chance.Id,  
790 - Provider: provider,  
791 - CreateTime: chance.CreateTime.Unix() * 1000,  
792 - }  
793 - jsonUnmarshal(chance.SourceContent, &item.FormList)  
794 - jsonUnmarshal(chance.Images, &item.Pictures)  
795 - jsonUnmarshal(chance.Voices, &item.Speechs)  
796 - jsonUnmarshal(chance.Videos, &item.Videos)  
797 - rsp.List = append(rsp.List, item) 788 + commItem := protocol.CommonListItem{}
  789 + {
  790 + item := protocol.ChanceItem{
  791 + Id: chance.Id,
  792 + Provider: provider,
  793 + CreateTime: chance.CreateTime.Unix() * 1000,
  794 + }
  795 + jsonUnmarshal(chance.SourceContent, &item.FormList)
  796 + jsonUnmarshal(chance.Images, &item.Pictures)
  797 + jsonUnmarshal(chance.Voices, &item.Speechs)
  798 + jsonUnmarshal(chance.Videos, &item.Videos)
  799 + commItem.Chance = item
  800 + }
  801 + if request.ReviewStatus == protocol.ReviewStatusPass {
  802 + jsonUnmarshal(chance.ApproveData, &commItem.ApproveData)
  803 + }
  804 + rsp.List = append(rsp.List, commItem)
798 } 805 }
799 return 806 return
800 } 807 }