41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace App\Admin\Controllers;
|
||
|
||
use App\Admin\Metrics\Examples;
|
||
use App\Http\Controllers\Controller;
|
||
use Dcat\Admin\Http\Controllers\Dashboard;
|
||
use Dcat\Admin\Layout\Column;
|
||
use Dcat\Admin\Layout\Content;
|
||
use Dcat\Admin\Layout\Row;
|
||
use App\Admin\Metrics\{TotalUsers,NewUsers,TotalOrders,NewOrders,ProductOrders,OrderDevices};
|
||
|
||
class HomeController extends Controller
|
||
{
|
||
public function index(Content $content)
|
||
{
|
||
// $a = new OrderDevices();
|
||
// $a->fill();
|
||
return $content
|
||
->header('首页')
|
||
->description('数据统计')
|
||
// ->body(function (Row $row) {
|
||
// $row->column(4, new TotalUsers());//用户总数
|
||
// // 新用户数量,趋势,6
|
||
// $row->column(7, new NewUsers());
|
||
// })
|
||
->body(function (Row $row){
|
||
// 订单总数 3
|
||
$row->column(4, new TotalOrders());//订单总数
|
||
// 每日订单数量趋势,按天,按周,按月 6
|
||
$row->column(7, new NewOrders());
|
||
})->body(function (Row $row){
|
||
// 线上线下订单比例 6
|
||
// 小程序订单完成比例 6
|
||
$row->column(7, new ProductOrders());
|
||
// $row->column(4, new OrderDevices());
|
||
|
||
});
|
||
}
|
||
}
|