作者 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 from chance
select id,user_id,create_at,source_content,approve_data from chance
where user_id=? and company_id=? and review_status in (?) and (?=0 or id>?)
order by create_at desc
limit ?
... ...
... ... @@ -195,8 +195,8 @@ type MySubmitChanceRequest struct {
ReviewStatus int8 `json:"reviewStatus"` //审核状态
}
type MySubmitChanceResponse struct {
List []ChanceItem `json:"list"`
Total int `json:"total"`
List []CommonListItem `json:"list"`
Total int `json:"total"`
}
/*MyApproveChance 我审核的机会*/
... ... @@ -233,6 +233,8 @@ type ChanceItemOrm struct {
Images string `orm:"column(images)"`
Voices string `orm:"column(speechs)"`
Videos string `orm:"column(videos)"`
ApproveData string `json:"approveData"` //审核数据
}
type ChanceItem struct {
Id int64 `json:"id"`
... ...
... ... @@ -785,16 +785,23 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
item := protocol.ChanceItem{
Id: chance.Id,
Provider: provider,
CreateTime: chance.CreateTime.Unix() * 1000,
}
jsonUnmarshal(chance.SourceContent, &item.FormList)
jsonUnmarshal(chance.Images, &item.Pictures)
jsonUnmarshal(chance.Voices, &item.Speechs)
jsonUnmarshal(chance.Videos, &item.Videos)
rsp.List = append(rsp.List, item)
commItem := protocol.CommonListItem{}
{
item := protocol.ChanceItem{
Id: chance.Id,
Provider: provider,
CreateTime: chance.CreateTime.Unix() * 1000,
}
jsonUnmarshal(chance.SourceContent, &item.FormList)
jsonUnmarshal(chance.Images, &item.Pictures)
jsonUnmarshal(chance.Voices, &item.Speechs)
jsonUnmarshal(chance.Videos, &item.Videos)
commItem.Chance = item
}
if request.ReviewStatus == protocol.ReviewStatusPass {
jsonUnmarshal(chance.ApproveData, &commItem.ApproveData)
}
rsp.List = append(rsp.List, commItem)
}
return
}
... ...