fix some bug

This commit is contained in:
2026-07-01 20:59:24 +03:30
parent e3a883d224
commit a69316e0de
10 changed files with 226 additions and 14 deletions
+11 -3
View File
@@ -89,12 +89,13 @@ class Withdraw extends Model
->where('note', 'like', '%برداشت%');
})
->orWhere(function ($deduct) {
$deduct->where('cash', '<', 0);
$deduct->where('cash', '<', 0)
->orWhere('gold', '<', 0);
});
});
}
/** واریز: ورود پول/طلا به کیف (درگاه، شارژ ادمین، پاداش) */
/** واریز: ورود پول/طلا به کیف (درگاه، شارژ ادمین، پاداش) — بدون کسر ادمین */
public static function scopeDeposits($query)
{
return $query->where(function ($q) {
@@ -105,7 +106,14 @@ class Withdraw extends Model
})->where(function ($excludeWithdrawNotes) {
$excludeWithdrawNotes->whereNull('note')
->orWhere('note', 'not like', '%برداشت%');
})->whereNotBetween('sts', [50, 52]);
})->whereNotBetween('sts', [50, 52])
->where(function ($positive) {
$positive->where(function ($cash) {
$cash->whereNull('cash')->orWhere('cash', '>=', 0);
})->where(function ($gold) {
$gold->whereNull('gold')->orWhere('gold', '>=', 0);
});
});
});
}
}