作者 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,7 +195,7 @@ type MySubmitChanceRequest struct {
ReviewStatus int8 `json:"reviewStatus"` //审核状态
}
type MySubmitChanceResponse struct {
List []ChanceItem `json:"list"`
List []CommonListItem `json:"list"`
Total int `json:"total"`
}
... ... @@ -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,6 +785,8 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.CommonListItem{}
{
item := protocol.ChanceItem{
Id: chance.Id,
Provider: provider,
... ... @@ -794,7 +796,12 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
jsonUnmarshal(chance.Images, &item.Pictures)
jsonUnmarshal(chance.Voices, &item.Speechs)
jsonUnmarshal(chance.Videos, &item.Videos)
rsp.List = append(rsp.List, item)
commItem.Chance = item
}
if request.ReviewStatus == protocol.ReviewStatusPass {
jsonUnmarshal(chance.ApproveData, &commItem.ApproveData)
}
rsp.List = append(rsp.List, commItem)
}
return
}
... ...