fix(order): 修复分销收号商品在主站租用后报订单不存在的问题
This commit is contained in:
@@ -51,11 +51,11 @@ func (r *Repository) ListConversations(ctx context.Context, principal Principal,
|
||||
|
||||
if principal.Type == "user" {
|
||||
if site != nil {
|
||||
siteFilter := "(c.distribution_site_id = ? OR (c.order_id IS NOT NULL AND c.order_id IN (SELECT ro.id FROM rental_orders ro WHERE ro.distribution_site_id = ?)))"
|
||||
siteFilter := "(c.distribution_site_id = ? OR (c.order_id IS NOT NULL AND c.order_id IN (SELECT ro.id FROM rental_orders ro WHERE ro.distribution_site_id = ? AND ro.distribution_mode != 'two_party_distributor_receive')))"
|
||||
countDB = countDB.Where(siteFilter, site.ID, site.ID)
|
||||
dataQuery = dataQuery.Where(siteFilter, site.ID, site.ID)
|
||||
} else {
|
||||
mainFilter := "(c.distribution_site_id IS NULL OR c.distribution_site_id = 0) AND (c.order_id IS NULL OR c.order_id NOT IN (SELECT ro.id FROM rental_orders ro WHERE ro.distribution_site_id IS NOT NULL AND ro.distribution_site_id > 0))"
|
||||
mainFilter := "(c.distribution_site_id IS NULL OR c.distribution_site_id = 0) AND (c.order_id IS NULL OR c.order_id NOT IN (SELECT ro.id FROM rental_orders ro WHERE ro.distribution_site_id IS NOT NULL AND ro.distribution_site_id > 0 AND ro.distribution_mode != 'two_party_distributor_receive'))"
|
||||
countDB = countDB.Where(mainFilter)
|
||||
dataQuery = dataQuery.Where(mainFilter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user