...
|
...
|
@@ -90,26 +90,25 @@ func DeleteChance(id int64) (err error) { |
|
|
return
|
|
|
}
|
|
|
|
|
|
//我的机会列表
|
|
|
func GetChanceMyChance(uid, cid int64, reviewStatus int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
|
|
func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
|
|
sql := `select a.*,b.images,speechs,videos
|
|
|
from (
|
|
|
select id,user_id,create_at,source_content from chance
|
|
|
where user_id=? and company_id=? and review_status =? and (?=0 or id>?)
|
|
|
where user_id=? and company_id=? and review_status in (?) and (?=0 or id>?)
|
|
|
order by create_at desc
|
|
|
limit ?
|
|
|
) a left JOIN chance_data b on a.id =b.chance_id`
|
|
|
|
|
|
sqlCount := `select count(0) from (
|
|
|
select id,user_id,create_at,source_content from chance
|
|
|
where user_id=? and company_id=? and review_status =?
|
|
|
where user_id=? and company_id=? and review_status in (?)
|
|
|
order by create_at desc
|
|
|
) a left JOIN chance_data b on a.id =b.chance_id`
|
|
|
if err = utils.ExecuteQueryOne(&total, sqlCount, uid, cid, reviewStatus); err != nil {
|
|
|
if err = utils.ExecuteQueryOne(&total, sqlCount, uid, cid, utils.JoinInt8s(reviewStatus, ",")); err != nil {
|
|
|
return
|
|
|
}
|
|
|
if v != nil {
|
|
|
if err = utils.ExecuteQueryAll(v, sql, uid, cid, reviewStatus, lastId, lastId, pageSize); err != nil {
|
|
|
if err = utils.ExecuteQueryAll(v, sql, uid, cid, utils.JoinInt8s(reviewStatus, ","), lastId, lastId, pageSize); err != nil {
|
|
|
return
|
|
|
}
|
|
|
}
|
...
|
...
|
|