|
@@ -2,33 +2,86 @@
|
|
|
|
|
|
namespace App\Admin\Controllers;
|
|
namespace App\Admin\Controllers;
|
|
|
|
|
|
|
|
+use App\Admin\Controllers\Chart\Order;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Controller;
|
|
use Encore\Admin\Controllers\Dashboard;
|
|
use Encore\Admin\Controllers\Dashboard;
|
|
use Encore\Admin\Layout\Column;
|
|
use Encore\Admin\Layout\Column;
|
|
use Encore\Admin\Layout\Content;
|
|
use Encore\Admin\Layout\Content;
|
|
use Encore\Admin\Layout\Row;
|
|
use Encore\Admin\Layout\Row;
|
|
|
|
+use Encore\Admin\Widgets\InfoBox;
|
|
|
|
|
|
class HomeController extends Controller
|
|
class HomeController extends Controller
|
|
{
|
|
{
|
|
public function index(Content $content)
|
|
public function index(Content $content)
|
|
{
|
|
{
|
|
return $content
|
|
return $content
|
|
- ->title('Dashboard')
|
|
|
|
- ->description('Description...')
|
|
|
|
- ->row(Dashboard::title())
|
|
|
|
|
|
+ ->title('欢迎进入后台管理系统')
|
|
|
|
+ ->description('后台数据中心')
|
|
|
|
+ ->row('<h1 text-align="center">订单概况</h1>')
|
|
->row(function (Row $row) {
|
|
->row(function (Row $row) {
|
|
-
|
|
|
|
- $row->column(4, function (Column $column) {
|
|
|
|
- $column->append(Dashboard::environment());
|
|
|
|
|
|
+ // 产品类型(1.电话咨询 2.图文咨询 3.门诊预约 4.疫苗接种预约 5.儿保预约 6.服务包 7.充值)
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(infoBox('新增电话咨询订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(1)));
|
|
|
|
+ });
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('新增图文咨询订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(2)));
|
|
});
|
|
});
|
|
|
|
|
|
- $row->column(4, function (Column $column) {
|
|
|
|
- $column->append(Dashboard::extensions());
|
|
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(infoBox('新增门诊预约订单', 'user-plus', '/admin/withdraw?status=0', 'green',Sta::getOrderCount(3)));
|
|
});
|
|
});
|
|
|
|
|
|
- $row->column(4, function (Column $column) {
|
|
|
|
- $column->append(Dashboard::dependencies());
|
|
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('新增计免预约订单', 'user-plus', '/admin/withdraw?status=0', 'green', Sta::getOrderCount(4)));
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ ->row(function (Row $row) {
|
|
|
|
+ //产品类型(1.电话咨询 2.图文咨询 3.门诊预约 4.疫苗接种预约 5.儿保预约 6.服务包 7.充值)
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('新增儿保订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(5)));
|
|
|
|
+ });
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('历史总订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(0)));
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ ->row('<h1 text-align="center">订单走势</h1>')
|
|
|
|
+ ->row(function (Row $row) {
|
|
|
|
+ //产品类型(1.电话咨询 2.图文咨询 3.门诊预约 4.疫苗接种预约 5.儿保预约 6.服务包 7.充值)
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('今日订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(7,1)));
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('昨日订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(7,-1)));
|
|
|
|
+ });
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('进七日订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(7,7)));
|
|
|
|
+ });
|
|
|
|
+ $row->column(3, function (Column $column) {
|
|
|
|
+ $column->append(\App\Admin\Controllers\infoBox('近三十日订单', 'dropbox', '/admin/deliver?status=1', 'green', Sta::getOrderCount(7,30)));
|
|
|
|
+ });
|
|
|
|
+// 1=>'今日订单总数(单)',
|
|
|
|
+// 1=>'昨日订单总数(单)',
|
|
|
|
+// 1=>'近七日订单总数(单)',
|
|
|
|
+// 1=>'订单总数(单)',
|
|
|
|
+ })
|
|
|
|
+ ->row(function (Row $row){
|
|
|
|
+ (new Order())->chart($row);
|
|
|
|
+ })
|
|
|
|
+ ;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+/**
|
|
|
|
+ * 消息框
|
|
|
|
+ * @param $name
|
|
|
|
+ * @param $icon
|
|
|
|
+ * @param $link
|
|
|
|
+ * @param $color
|
|
|
|
+ * @param $info
|
|
|
|
+ * @return string HTML
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+function infoBox($name, $icon, $link, $color, $info)
|
|
|
|
+{
|
|
|
|
+ return (new InfoBox($name, $icon, $color, $link, $info))->render();
|
|
}
|
|
}
|