1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\admin\controller;
- use app\admin\attr\Permission;
- use app\common\model\Io;
- use app\common\model\Repo;
- use app\common\model\Stock;
- use app\common\model\Allocation;
- #[Permission('index')]
- class Index extends BaseAuthorized
- {
- public function statistics()
- {
- $ioCount = Io::count();
- $checkCount = Io::where('change_type', '=', Io::CHANGE_TYPE_CHECK)->count();
- $allcationCount = Allocation::count();
- $goodTotal = Stock::sum('num');
- $repoCount = Repo::count();
- return [
- 'ioCount' => $ioCount,
- 'checkCount' => $checkCount,
- 'allcationCount' => $allcationCount,
- 'goodTotal' => $goodTotal,
- 'repoCount' => $repoCount
- ];
- }
- }
|