You've already forked guangan
64 lines
2.8 KiB
PHP
64 lines
2.8 KiB
PHP
<?php
|
|
|
|
// +----------------------------------------------------------------------
|
|
// | Static Plugin for ThinkAdmin
|
|
// +----------------------------------------------------------------------
|
|
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网站: https://thinkadmin.top
|
|
// +----------------------------------------------------------------------
|
|
// | 开源协议 ( https://mit-license.org )
|
|
// | 免责声明 ( https://thinkadmin.top/disclaimer )
|
|
// +----------------------------------------------------------------------
|
|
// | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-static
|
|
// | github 代码仓库:https://github.com/zoujingli/think-plugs-static
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\index\controller;
|
|
|
|
use plugin\cms\model\CmsArticle;
|
|
use plugin\cms\model\CmsThumb;
|
|
use plugin\points_mall\model\PointsMallGoods;
|
|
use plugin\points_mall\model\PointsMallOrder;
|
|
use plugin\ticket\model\TicketTicket;
|
|
use plugin\ticket\model\TicketTicketInter;
|
|
use plugin\ticket\model\TicketTicketOuter;
|
|
use think\admin\Controller;
|
|
use think\db\Raw;
|
|
|
|
class Index extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$this->redirect(sysuri('admin/login/index'));
|
|
}
|
|
|
|
public function dashboard() {
|
|
$this->t_0_0_0 = PointsMallGoods::query()->where('status', '=', 1)->where('deleted', '=', 0)->count();
|
|
$this->t_0_0_1 = PointsMallGoods::query()->where('status', '=', 1)->where('deleted', '=', 0)->sum(new Raw("`stock_total` - `stock_sales`"));
|
|
|
|
$this->t_0_1_0 = PointsMallGoods::query()->where('deleted', '=', 0)->count();
|
|
$this->t_0_1_1 = PointsMallGoods::query()->where('deleted', '=', 0)->sum(new Raw("`stock_total` - `stock_sales`"));
|
|
|
|
$this->t_1_0 = PointsMallOrder::query()->count();
|
|
$this->t_1_1 = PointsMallOrder::query()->where('status', '=', 2)->count();
|
|
$this->t_1_2 = PointsMallOrder::query()->where('status', '=', 4)->count();
|
|
$this->t_1_3 = PointsMallOrder::query()->where('status', '=', 6)->count();
|
|
|
|
$this->t_2_0_0 = TicketTicket::query()->count();
|
|
$this->t_2_0_1 = TicketTicket::query()->where('status', '=', -1)->count();
|
|
|
|
$this->t_2_1_0 = TicketTicketInter::query()->where('status', '=', 0)->count();
|
|
$this->t_2_1_1 = TicketTicketInter::query()->where('status', '=', 0)->count();
|
|
|
|
$this->t_2_2_0 = TicketTicketOuter::query()->where('status', '=', 0)->count();
|
|
$this->t_2_2_1 = TicketTicketOuter::query()->where('status', '=', 0)->count();
|
|
|
|
$this->t_3_0 = CmsArticle::query()->count();
|
|
$this->t_3_1 = CmsThumb::query()->where('is_audit', '=', 0)->count();
|
|
$this->t_3_2 = CmsThumb::query()->where('is_audit', '=', 1)->count();
|
|
|
|
$this->fetch();
|
|
}
|
|
}
|