This commit is contained in:
iVampireSP.com 2022-10-03 10:38:29 +08:00
parent db328a022f
commit 497b483526
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -99,7 +99,7 @@ public function calcModule(Module $module)
// end of this month
$endOfMonth = now()->endOfMonth();
$this_month_balance_and_drops = Cache::remember('this_month_balance_and_drops_' . $module->id, 3600, function () use ($module, $beginOfMonth, $endOfMonth) {
$this_month_balance_and_drops = Cache::remember($module->id . '_this_month_balance_and_drops', 3600, function () use ($module, $beginOfMonth, $endOfMonth) {
$this_month = Transaction::where('module_id', $module->id)->whereBetween('created_at', [$beginOfMonth, $endOfMonth]);
// this month transactions
@ -109,7 +109,7 @@ public function calcModule(Module $module)
];
});
$last_month_balance_and_drops = Cache::remember('last_month_balance_and_drops_' . $module->id, 3600, function () use ($module, $beginOfMonth, $endOfMonth) {
$last_month_balance_and_drops = Cache::remember($module->id . '_last_month_balance_and_drops', 3600, function () use ($module, $beginOfMonth, $endOfMonth) {
// last month transactions
$last_moth = Transaction::where('module_id', $module->id)->whereBetween('created_at', [$beginOfMonth, $endOfMonth]);