This commit is contained in:
root
2020-01-20 13:57:30 +08:00
parent f03dbd1dcb
commit 508961c4fb
5 changed files with 20 additions and 42 deletions

View File

@ -43,28 +43,5 @@ class V2boardCache extends Command
*/
public function handle()
{
$this->setMonthIncome();
$this->setMonthRegisterTotal();
}
private function setMonthIncome()
{
Cache::put(
'month_income',
Order::where('created_at', '>=', strtotime(date('Y-m-1')))
->where('created_at', '<', time())
->where('status', '3')
->sum('total_amount')
);
}
private function setMonthRegisterTotal()
{
Cache::put(
'month_register_total',
User::where('created_at', '>=', strtotime(date('Y-m-1')))
->where('created_at', '<', time())
->count()
);
}
}