作者 yangfu

机会点赞

... ... @@ -152,7 +152,7 @@ from audit_flow_process where uid=? and enable_status =1 and review_status in (%
func GetChanceCollect(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
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 (
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
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
and source_type=1
and (mark_flag&2)>0
)a left outer join chance b on a.source_id = b.id
... ... @@ -175,7 +175,7 @@ limit ?`)
func GetChanceThumbUp(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
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 (
select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
select id collect_id,source_id,update_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
and source_type=1
and (mark_flag&1)>0
)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)
//更新机会点赞/收藏状态
func UpdateChanceFavorite(userId, companyId int64, sourceId int64, markFlag int) (err error) {
o := orm.NewOrm()
sql := `update chance_favorite set mark_flag = mark_flag ^ ?
sql := `update chance_favorite set mark_flag = mark_flag ^ ? ,update=now()
where user_id =? and company_id =? and source_id=? ` //
if _, err = o.Raw(sql, markFlag, userId, companyId, sourceId).Exec(); err == nil {
return
... ...
... ... @@ -145,6 +145,7 @@ func SympathyAction(header *protocol.RequestHeader, request *protocol.SympathyAc
SourceId: request.Id,
ChanceType: chanceType,
CreateAt: time.Now(),
UpdateAt: time.Now(),
EnableStatus: 1,
ChanceId: request.ChanceId,
}
... ...