|
@@ -16,8 +16,13 @@ class Dashboard extends Backend
|
|
|
{
|
|
|
//首页统计页
|
|
|
public function index(){
|
|
|
+ //今日
|
|
|
$todaystatime = strtotime(date('Y-m-d'));
|
|
|
$todayendtime = $todaystatime + 86399;
|
|
|
+ //昨日
|
|
|
+ $yestodaystatime = $todaystatime - 86400;
|
|
|
+ $yestodayendtime = $todaystatime - 1;
|
|
|
+
|
|
|
//今日抽奖总产出(钻石总数)、
|
|
|
//开奖获得礼物的总钻石价值
|
|
|
$egg_do_gift_price = Db::name('egg_do')->where('createtime','BETWEEN',[$todaystatime,$todayendtime])->sum('price');
|
|
@@ -28,10 +33,11 @@ class Dashboard extends Backend
|
|
|
$register_num_today = Db::name('user')->where('createtime','BETWEEN',[$todaystatime,$todayendtime])->count();
|
|
|
$register_num = Db::name('user')->count();
|
|
|
$user_online = Db::name('user')->where('is_online',1)->count();
|
|
|
- //充值(总/今日充值数量、今日待支付)、
|
|
|
+ //充值(总/今日充值金额、今日待支付)、昨日支付
|
|
|
$recharge = Db::name('rechar_order')->where('status',1)->sum('money');
|
|
|
$recharge_today = Db::name('rechar_order')->where('createtime','BETWEEN',[$todaystatime,$todayendtime])->where('status',1)->sum('money');
|
|
|
$recharge_today_wait = Db::name('rechar_order')->where('createtime','BETWEEN',[$todaystatime,$todayendtime])->where('status',0)->sum('money');
|
|
|
+ $recharge_yestoday = Db::name('rechar_order')->where('createtime','BETWEEN',[$yestodaystatime,$yestodayendtime])->where('status',1)->sum('money');
|
|
|
//平台总资产余额、
|
|
|
$allmoney = Db::name('user')->sum('money');
|
|
|
//钻石(平台总数量/今日充值数量))
|
|
@@ -48,6 +54,7 @@ class Dashboard extends Backend
|
|
|
$this->assign('recharge',$recharge);
|
|
|
$this->assign('recharge_today',$recharge_today);
|
|
|
$this->assign('recharge_today_wait',$recharge_today_wait);
|
|
|
+ $this->assign('recharge_yestoday',$recharge_yestoday);
|
|
|
$this->assign('allmoney',$allmoney);
|
|
|
$this->assign('alljewel',$alljewel);
|
|
|
$this->assign('recharge_money_today',$recharge_money_today);
|