超管后台 - 仪表盘显示设备总数

This commit is contained in:
柳清爽
2025-04-29 11:22:10 +08:00
parent 319437cc2b
commit 12e5b93a38
4 changed files with 68 additions and 66 deletions

View File

@@ -4,6 +4,7 @@ namespace app\superadmin\controller\dashboard;
use app\common\model\Administrator as AdministratorModel;
use app\common\model\Company as CompanyModel;
use app\common\model\Device as DeviceModel;
use library\ResponseHelper;
use think\Controller;
@@ -33,13 +34,13 @@ class GetBasestatisticsController extends Controller
}
/**
* 客户总数
* 设备总数
*
* @return int
*/
protected function getCustomerCount(): int
protected function getDeviceCount(): int
{
return $this->getCompanyCount();
return DeviceModel::count('*');
}
/**
@@ -53,7 +54,7 @@ class GetBasestatisticsController extends Controller
[
'companyCount' => $this->getCompanyCount(),
'adminCount' => $this->getAdminCount(),
'customerCount' => $this->getCustomerCount(),
'customerCount' => $this->getDeviceCount(),
]
);
}