作者 yangfu

计数

@@ -104,7 +104,7 @@ func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSi @@ -104,7 +104,7 @@ func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSi
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,approve_data,review_status from chance 106 select id,user_id,create_at,source_content,approve_data,review_status 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 ?
110 ) a left JOIN chance_data b on a.id =b.chance_id` 110 ) a left JOIN chance_data b on a.id =b.chance_id`
@@ -129,7 +129,7 @@ func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, @@ -129,7 +129,7 @@ func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64,
129 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 129 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
130 select a.*,b.user_id,b.source_content,b.enable_status,b.review_status from ( 130 select a.*,b.user_id,b.source_content,b.enable_status,b.review_status from (
131 select id,approve_time,approve_data,uid,chance_id,approve_message,create_at process_create_time 131 select id,approve_time,approve_data,uid,chance_id,approve_message,create_at process_create_time
132 -from audit_flow_process where uid=? and enable_status =1 and review_status in (%v) and (?=0 or id>?) 132 +from audit_flow_process where uid=? and enable_status =1 and review_status in (%v) and (?=0 or id<?)
133 )a left outer join chance b on a.chance_id = b.id 133 )a left outer join chance b on a.chance_id = b.id
134 )a left outer join chance_data b on a.chance_id =b.chance_id 134 )a left outer join chance_data b on a.chance_id =b.chance_id
135 order by process_create_time desc 135 order by process_create_time desc
@@ -152,7 +152,7 @@ func GetChancePool(uid, cid int64, chanceTypeId int, lastId int64, pageSize int, @@ -152,7 +152,7 @@ func GetChancePool(uid, cid int64, chanceTypeId int, lastId int64, pageSize int,
152 sql := `select a.*,b.images,speechs,videos 152 sql := `select a.*,b.images,speechs,videos
153 from ( 153 from (
154 select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total from chance 154 select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total from chance
155 -where company_id=? and review_status=3 and (?=0 or chance_type_id =?) and (?=0 or id>?) and enable_status=1 155 +where company_id=? and review_status=3 and (?=0 or chance_type_id =?) and (?=0 or id<?) and enable_status=1
156 order by create_at desc 156 order by create_at desc
157 limit ? 157 limit ?
158 ) a left JOIN chance_data b on a.id =b.chance_id` 158 ) a left JOIN chance_data b on a.id =b.chance_id`
@@ -177,7 +177,7 @@ order by create_at desc @@ -177,7 +177,7 @@ order by create_at desc
177 func GetChanceCollect(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) { 177 func GetChanceCollect(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
178 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 178 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
179 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 from ( 179 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 from (
180 -select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id>?) and user_id =? and enable_status=1 180 +select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
181 and source_type=1 181 and source_type=1
182 and (mark_flag&2)>0 182 and (mark_flag&2)>0
183 )a left outer join chance b on a.source_id = b.id 183 )a left outer join chance b on a.source_id = b.id
@@ -200,7 +200,7 @@ limit ?`) @@ -200,7 +200,7 @@ limit ?`)
200 func GetChanceThumbUp(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) { 200 func GetChanceThumbUp(uid int64, lastId int64, pageSize int, v interface{}) (total int, err error) {
201 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from ( 201 sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
202 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 from ( 202 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 from (
203 -select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id>?) and user_id =? and enable_status=1 203 +select id collect_id,source_id,create_at collect_time from chance_favorite where (0=? or id<?) and user_id =? and enable_status=1
204 and source_type=1 204 and source_type=1
205 and (mark_flag&1)>0 205 and (mark_flag&1)>0
206 )a left outer join chance b on a.source_id = b.id 206 )a left outer join chance b on a.source_id = b.id
@@ -227,7 +227,7 @@ from ( @@ -227,7 +227,7 @@ from (
227 select a.*,b.images,b.speechs,b.videos from ( 227 select a.*,b.images,b.speechs,b.videos from (
228 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data from ( 228 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data from (
229 select id,content,view_total,zan_total,comment_total,source_type,source_id,create_at comment_time from comment 229 select id,content,view_total,zan_total,comment_total,source_type,source_id,create_at comment_time from comment
230 -where user_id =? and (?=0 or id>?) 230 +where user_id =? and (?=0 or id<?)
231 )a left outer join chance b on a.source_id = b.id and source_type=1 231 )a left outer join chance b on a.source_id = b.id and source_type=1
232 )a left outer join chance_data b on a.source_id = b.chance_id and source_type = 1 232 )a left outer join chance_data b on a.source_id = b.chance_id and source_type = 1
233 )a left outer join comment b on a.source_id = b.id and a.source_type=2 233 )a left outer join comment b on a.source_id = b.id and a.source_type=2
@@ -181,7 +181,7 @@ func GetChanceMsg(uid, lastId int64, pageSize int, msgType int, v interface{}) ( @@ -181,7 +181,7 @@ func GetChanceMsg(uid, lastId int64, pageSize int, msgType int, v interface{}) (
181 sql := `select a.*,b.images,b.speechs,b.videos from ( 181 sql := `select a.*,b.images,b.speechs,b.videos from (
182 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data from ( 182 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data from (
183 select id,company_id,receive_user_id,message,source_id,is_read 183 select id,company_id,receive_user_id,message,source_id,is_read
184 -from user_msg where receive_user_id=? and source_type=1 and (?=0 or id>?) and msg_type=? 184 +from user_msg where receive_user_id=? and source_type=1 and (?=0 or id<?) and msg_type=?
185 )a left outer join chance b on a.source_id = b.id 185 )a left outer join chance b on a.source_id = b.id
186 )a left outer join chance_data b on a.source_id =b.chance_id 186 )a left outer join chance_data b on a.source_id =b.chance_id
187 order by a.create_at desc 187 order by a.create_at desc
@@ -206,7 +206,7 @@ func GetChanceCommentMsg(uid, lastId int64, pageSize int, msgType int, v interfa @@ -206,7 +206,7 @@ func GetChanceCommentMsg(uid, lastId int64, pageSize int, msgType int, v interfa
206 select a.*,b.images,b.speechs,b.videos from ( 206 select a.*,b.images,b.speechs,b.videos from (
207 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status from ( 207 select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status from (
208 select id,message content,source_type,source_id,create_at comment_time from user_msg 208 select id,message content,source_type,source_id,create_at comment_time from user_msg
209 -where receive_user_id =? and (?=0 or id>?) and msg_type=? 209 +where receive_user_id =? and (?=0 or id<?) and msg_type=?
210 )a left outer join chance b on a.source_id = b.id and source_type=1 210 )a left outer join chance b on a.source_id = b.id and source_type=1
211 )a left outer join chance_data b on a.source_id = b.chance_id and source_type = 1 211 )a left outer join chance_data b on a.source_id = b.chance_id and source_type = 1
212 )a left outer join comment b on a.source_id = b.id and a.source_type=2 212 )a left outer join comment b on a.source_id = b.id and a.source_type=2