| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\admin\controller\informational;
- use app\admin\logic\PaymentLogic;
- use app\admin\logic\UserLogic;
- use app\admin\logic\WithdrawLogic;
- use app\common\model\ShopCategory;
- use app\admin\traits\Curd;
- use app\common\controller\AdminController;
- use EasyAdmin\annotation\ControllerAnnotation;
- use EasyAdmin\annotation\NodeAnotation;
- use think\App;
- use think\facade\Db;
- use think\Model;
- /**
- * Class Admin
- * @package app\admin\controller\system
- * @ControllerAnnotation(title="昨日数据管理")
- */
- class Yesterdaydata extends AdminController
- {
- use Curd;
- public function __construct(App $app)
- {
- parent::__construct($app);
- }
- /**
- * @NodeAnotation(title="后台数据列表")
- */
- public function index(){
- $yesterdayDate = sr_getcurtime(time()-86400, 'Y-m-d');
- $day = sr_getcurtime(time(), 'Y-m-d');
- $res = [
- // 昨日数据
- 'yesterday'=>sr_getcurtime(time()-86400, 'Y年-m月-d日'),
- 'yesterday_register'=> UserLogic::getCountByTime($yesterdayDate),
- 'yesterday_recharge'=> PaymentLogic::getTotal([4,5], $yesterdayDate),
- 'yesterday_withdraw'=> WithdrawLogic::getTotal($yesterdayDate),
- // 今日数据
- 'today'=>sr_getcurtime(time(), 'Y年-m月-d日'),
- 'today_register'=> UserLogic::getCountByTime($day),
- 'today_recharge'=> PaymentLogic::getTotal([4,5], $day),
- 'today_withdraw'=> WithdrawLogic::getTotal($day),
- ];
- $this->assign('res', $res);
- return $this->fetch();
- }
- }
|