作者 yangfu

机会点赞

@@ -152,7 +152,7 @@ from audit_flow_process where uid=? and enable_status =1 and review_status in (% @@ -152,7 +152,7 @@ from audit_flow_process where uid=? and enable_status =1 and review_status in (%
152 func GetChanceCollect(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) { 152 func GetChanceCollect(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
153 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 153 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
154 select a.*,b.user_id,b.id,b.create_at,b.source_content,b.enable_status,b.review_status,b.audit_template_id,b.chance_type_id,comment_total,zan_total,view_total,b.publish_status from ( 154 select a.*,b.user_id,b.id,b.create_at,b.source_content,b.enable_status,b.review_status,b.audit_template_id,b.chance_type_id,comment_total,zan_total,view_total,b.publish_status from (
155 -select id collect_id,source_id,create_at collect_time,chance_id from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1 155 +select id collect_id,source_id,update_at collect_time,chance_id from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
156 and source_type=1 156 and source_type=1
157 and (mark_flag&2)>0 157 and (mark_flag&2)>0
158 )a left outer join chance b on a.source_id = b.id 158 )a left outer join chance b on a.source_id = b.id
@@ -175,7 +175,7 @@ limit ?`) @@ -175,7 +175,7 @@ limit ?`)
175 func GetChanceThumbUp(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) { 175 func GetChanceThumbUp(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
176 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 176 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
177 select a.*,b.user_id,b.id,b.create_at,b.source_content,b.enable_status,b.review_status,b.audit_template_id,b.chance_type_id,comment_total,zan_total,view_total,b.publish_status from ( 177 select a.*,b.user_id,b.id,b.create_at,b.source_content,b.enable_status,b.review_status,b.audit_template_id,b.chance_type_id,comment_total,zan_total,view_total,b.publish_status from (
178 -select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1 178 +select id collect_id,source_id,update_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
179 and source_type=1 179 and source_type=1
180 and (mark_flag&1)>0 180 and (mark_flag&1)>0
181 )a left outer join chance b on a.source_id = b.id 181 )a left outer join chance b on a.source_id = b.id
@@ -125,7 +125,7 @@ func ExitsChanceFavorite(userId, companyId int64, sourceId int64, markFlag int) @@ -125,7 +125,7 @@ func ExitsChanceFavorite(userId, companyId int64, sourceId int64, markFlag int)
125 //更新机会点赞/收藏状态 125 //更新机会点赞/收藏状态
126 func UpdateChanceFavorite(userId, companyId int64, sourceId int64, markFlag int) (err error) { 126 func UpdateChanceFavorite(userId, companyId int64, sourceId int64, markFlag int) (err error) {
127 o := orm.NewOrm() 127 o := orm.NewOrm()
128 - sql := `update chance_favorite set mark_flag = mark_flag ^ ? 128 + sql := `update chance_favorite set mark_flag = mark_flag ^ ? ,update=now()
129 where user_id =? and company_id =? and source_id=? ` // 129 where user_id =? and company_id =? and source_id=? ` //
130 if _, err = o.Raw(sql, markFlag, userId, companyId, sourceId).Exec(); err == nil { 130 if _, err = o.Raw(sql, markFlag, userId, companyId, sourceId).Exec(); err == nil {
131 return 131 return
@@ -145,6 +145,7 @@ func SympathyAction(header *protocol.RequestHeader, request *protocol.SympathyAc @@ -145,6 +145,7 @@ func SympathyAction(header *protocol.RequestHeader, request *protocol.SympathyAc
145 SourceId: request.Id, 145 SourceId: request.Id,
146 ChanceType: chanceType, 146 ChanceType: chanceType,
147 CreateAt: time.Now(), 147 CreateAt: time.Now(),
  148 + UpdateAt: time.Now(),
148 EnableStatus: 1, 149 EnableStatus: 1,
149 ChanceId: request.ChanceId, 150 ChanceId: request.ChanceId,
150 } 151 }