feature: keep sidebar and add service layer

This commit is contained in:
antv
2026-06-30 11:59:34 +07:00
parent 8a77324f89
commit c5016489ac
54 changed files with 1181 additions and 284 deletions
+10 -18
View File
@@ -2,32 +2,24 @@
namespace App\Console\Commands;
use App\Services\Admin\Contracts\AdminServiceInterface;
use Illuminate\Console\Command;
use App\Models\User;
class ResetCardsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'cards:reset';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset toàn bộ thẻ của hệ thống về 0 vào đầu tháng';
protected $description = 'Reset all system cards to 0 at the beginning of the month';
public function __construct(
private AdminServiceInterface $adminService
) {
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
User::where('status', User::STATUS_ACTIVE)->update(['card' => 0]);
$this->info('Đã reset toàn bộ số lượng thẻ của nhân viên đang hoạt động về 0 thành công!');
$this->adminService->resetAllCards();
$this->info('Successfully reset all cards for active members to 0!');
}
}