|
|
@@ -215,6 +215,7 @@ func GetMyIntroListByInviteId(inviteId, page, perPage int64, useCache bool) (lis
|
|
|
LEFT JOIN ( SELECT sum( count ) AS total, sum( amount ) AS amount, benefit_wx_uid AS wx_uid from invite_benefit_orders WHERE 1 group by benefit_wx_uid ) b ON a.id = b.wx_uid
|
|
|
WHERE
|
|
|
a.intro_user_id=%d or a.invite_id=%d
|
|
|
+ and a.openid!=""
|
|
|
ORDER BY
|
|
|
a.sale_group DESC
|
|
|
LIMIT %d,%d;
|
|
|
@@ -251,7 +252,7 @@ func GetMyIntroCountByInviteId(inviteId int64) int64 {
|
|
|
}
|
|
|
ret := &Ret{}
|
|
|
o := orm.NewOrm()
|
|
|
- sql := fmt.Sprintf("select count(DISTINCT id) as count from wx_users where intro_user_id=%d or invite_id=%d ;", inviteId, inviteId)
|
|
|
+ sql := fmt.Sprintf("select count(DISTINCT id) as count from wx_users where openid!='' and intro_user_id=%d or invite_id=%d ;", inviteId, inviteId)
|
|
|
err := o.Raw(sql).QueryRow(ret)
|
|
|
if err != nil {
|
|
|
beego.BeeLogger.Error("GetMyIntroCountByInviteId, inviteId:%d, err=[%s]", inviteId, err)
|
|
|
@@ -396,6 +397,7 @@ func GetMyMonthIntroListByInviteId(inviteId int64, page, perPage int64, createTi
|
|
|
LEFT JOIN ( SELECT sum( count ) AS total, sum( amount ) AS amount, benefit_wx_uid AS wx_uid FROM invite_benefit_orders WHERE date_format(date_add(created_at, interval 8 HOUR), '%s')= ? GROUP BY benefit_wx_uid ) b ON a.id = b.wx_uid
|
|
|
WHERE
|
|
|
a.intro_user_id=%d or a.invite_id=%d
|
|
|
+ and a.openid!=""
|
|
|
ORDER BY
|
|
|
a.sale_group DESC
|
|
|
LIMIT %d,%d;
|
|
|
@@ -431,7 +433,7 @@ func GetMyMonthIntroListCount(inviteId int64) int64 {
|
|
|
}
|
|
|
ret := &Ret{}
|
|
|
o := orm.NewOrm()
|
|
|
- sql := fmt.Sprintf("select count(DISTINCT id) as count from wx_users where intro_user_id=%d or invite_id=%d ;", inviteId, inviteId)
|
|
|
+ sql := fmt.Sprintf("select count(DISTINCT id) as count from wx_users where openid!='' and intro_user_id=%d or invite_id=%d ;", inviteId, inviteId)
|
|
|
err := o.Raw(sql).QueryRow(ret)
|
|
|
if err != nil {
|
|
|
beego.BeeLogger.Error("GetMyMonthIntroListCount, inviteId:%d, err=[%s]", inviteId, err)
|