...
|
...
|
@@ -86,16 +86,16 @@ func DeleteChanceDraftById(id int64) (err error) { |
|
|
}
|
|
|
|
|
|
//草稿项机会列表
|
|
|
func GetDraftByChance(uid int64, offset int, pageSize int, v interface{}) (total int, err error) {
|
|
|
func GetDraftByChance(uid int64, lastId int, pageSize int, v interface{}) (total int, err error) {
|
|
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos
|
|
|
from (
|
|
|
select b.id chance_id,b.user_id chance_user_id,b.source_content,b.enable_status,b.audit_template_id,
|
|
|
b.chance_type_id,b.create_at,b.update_at,b.department_id,b.self_checks
|
|
|
from chance_draft b
|
|
|
where b.user_id=%v and enable_status=1
|
|
|
where b.user_id=%v and enable_status=1 and (?=0 or UNIX_TIMESTAMP(b.update_at)<?)
|
|
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
|
|
order by a.update_at desc
|
|
|
limit %v,%v`, uid, offset, pageSize)
|
|
|
limit %v`, uid, pageSize)
|
|
|
|
|
|
sqlCount := fmt.Sprintf(`select count(0)
|
|
|
from chance_draft b
|
...
|
...
|
@@ -105,7 +105,7 @@ limit %v,%v`, uid, offset, pageSize) |
|
|
return
|
|
|
}
|
|
|
if v != nil {
|
|
|
if err = utils.ExecuteQueryAll(v, sql); err != nil {
|
|
|
if err = utils.ExecuteQueryAll(v, sql, lastId, lastId); err != nil {
|
|
|
return
|
|
|
}
|
|
|
}
|
...
|
...
|
|