You've already forked guangan
菜单,首页数据
This commit is contained in:
@ -16,7 +16,15 @@
|
||||
|
||||
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
|
||||
{
|
||||
@ -24,4 +32,32 @@ class Index extends Controller
|
||||
{
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user