...
|
...
|
@@ -151,7 +151,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 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
|
|
|
and source_type=1
|
|
|
and (mark_flag&2)>0
|
...
|
...
|
@@ -174,7 +174,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 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
|
|
|
and source_type=1
|
|
|
and (mark_flag&1)>0
|
...
|
...
|
@@ -209,7 +209,7 @@ func GetChanceComment(uid int64, lastId int64, pageSize int, v interface{}) (tot |
|
|
sql := fmt.Sprintf(`select a.*,b.content commented_content,b.create_at commented_time,b.user_id commented_user_id
|
|
|
from (
|
|
|
select a.*,b.images,b.speechs,b.videos from (
|
|
|
select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data from (
|
|
|
select a.*,b.source_content,b.enable_status,b.user_id chance_user_id,b.create_at,b.review_status,b.approve_data,b.publish_status from (
|
|
|
select id,content,view_total,zan_total,comment_total,source_type,source_id,create_at comment_time from comment
|
|
|
where user_id =? and (?=0 or id<?)
|
|
|
)a left outer join chance b on a.source_id = b.id and source_type=1
|
...
|
...
|
@@ -599,3 +599,36 @@ select count(0) from ( |
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//是否存在按发布机会部门编号查询
|
|
|
func ExitsChanceByDeparmentIds(chanceId int64, departmentIds []int64) (v *Chance, err error) {
|
|
|
sql := fmt.Sprintf(`select id from chance where id=%v and department_id in (%v)`,
|
|
|
chanceId, utils.JoinInt64s(departmentIds, ","))
|
|
|
o := orm.NewOrm()
|
|
|
if err = o.Raw(sql).QueryRow(&v); err != nil {
|
|
|
return
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//是否存在发布机会的部门编号查询
|
|
|
func ExitsChanceByPublicDeparmentIds(chanceId int64, departmentIds []int64) (v *Chance, err error) {
|
|
|
sql := fmt.Sprintf(`select chance_id from chance_department where chance_id=%v and department_id in (%v)`,
|
|
|
chanceId, utils.JoinInt64s(departmentIds, ","))
|
|
|
o := orm.NewOrm()
|
|
|
if err = o.Raw(sql).QueryRow(&v); err != nil {
|
|
|
return
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//是否存在机会 - 审核人
|
|
|
func ExitsChanceByAuditUser(chanceId int64, auditUserId int64) (v *Chance, err error) {
|
|
|
sql := fmt.Sprintf(`select * from audit_flow_process where chance_id =%v and uid =%v and enable_status=1 limit 1`,
|
|
|
chanceId, auditUserId)
|
|
|
o := orm.NewOrm()
|
|
|
if err = o.Raw(sql).QueryRow(&v); err != nil {
|
|
|
return
|
|
|
}
|
|
|
return
|
|
|
} |
...
|
...
|
|