fix(tenant): 收紧双站后台边界并补齐货架管理

This commit is contained in:
yml
2026-11-15 22:28:40 +08:00
parent a68eb815a9
commit 0cb385d84f
42 changed files with 831 additions and 97 deletions
@@ -166,8 +166,10 @@ func (r *Repository) AdminLedger(ctx context.Context, query AdminLedgerQuery) (*
countDB := r.db.WithContext(ctx).Model(&model.WalletLedger{})
if tenantID > 0 {
db = db.Where("wl.tenant_id = ?", tenantID)
countDB = countDB.Where("tenant_id = ?", tenantID)
db = db.Where("wl.tenant_id = ?", tenantID).
Where("(wl.distribution_site_id = 0 OR wl.distribution_site_id IS NULL)")
countDB = countDB.Where("tenant_id = ?", tenantID).
Where("(distribution_site_id = 0 OR distribution_site_id IS NULL)")
}
if query.UserID > 0 {
db = db.Where("wl.user_id = ?", query.UserID)