| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace app\admin\controller\informational;
- 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);
- $this->model = new ShopCategory();
- }
- /**
- * @NodeAnotation(title="昨日数据列表")
- */
- public function index(){
- // $score = Db::name('user')->where('id', 'not in', 7493267)->sum('score');
- // $this->assign('score', $score);
- //
- // $chizi = Db::name('coupon_plan')->where('state', 1)->sum('target_num');
- // $this->assign('chizi', $chizi);
- $total = Db::name('user')->whereDay('reg_time', 'yesterday')->count('id');
- // $total_shim = Db::name('user')->whereDay('reg_time', 'yesterday')->where('is_auth', 1)->count('id');
- $res = [
- 'date'=>sr_getcurtime(time()-86400, 'Y年-m月-d日'),
- // 'tz_sum'=>Db::name('user')->sum('tz_num'),
- // 'xz_more_10'=>Db::name('user')->where('xz_num', '>', 11.5)->where('user_type', 'not in', '4')->sum('xz_num'),
- 'yesterday_income'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'not in', '3')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
- 'yesterday_incomey'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'in', '3')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
- 'yesterday_unusdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'not in', '19')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
- 'yesterday_usdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'in', '19')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
- 'withdow_success'=>number_format(Db::name('withdraw_log')->whereDay('update_at', 'yesterday')->where('status', 1)->sum('practical_money'), '2', '.', ''),
- 'withdow_apply_today'=>number_format(Db::name('withdraw_log')->whereDay('create_at', 'today')->where('status', 0)->sum('practical_money'), '2', '.', ''),
- 'yesterday_incomeuser'=>$total,
- // 'yester_incomshiming'=>$total_shim,
- // 'yester_couponnum'=>Db::name('coupon_plan_log')->whereDay('create_time', 'yesterday')->count('id'),
- // 'yeseter_xznum'=>Db::name('xz_log')->where('type', 6)->whereDay('create_at', 'yesterday')->sum('score'),
- // 'yester_shouxu'=>Db::name('xz_log')->where('type', 5)->whereDay('create_at', 'yesterday')->sum('shouxu_num'),
- 'total_score'=>Db::name('user')->where('id', 'not in', [5344210,5344229])->sum('score'),
- 'total_money'=>Db::name('user')->where('id', 'not in', [5344210,5344229])->sum('money'),
- 'today_income'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'not in', '3')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
- 'today_incomey'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'in', '3')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
- 'today_unusdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'not in', '19')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
- 'today_usdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'in', '19')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
- ];
- $this->assign('res', $res);
- // $today_income
- $today_income = Db::name('payment')->where('order_type', 4)->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee');
- $this->assign('today_income', $today_income);
- $chongzhi = Db::name('payment')->where('state', 6)->where('order_type', 4)->sum('total_fee');
- // $yuechongzhi = Db::name('payment')->where('state', 6)->where('order_type', 5)->sum('total_fee');
- $total_income = $chongzhi ;
- $this->assign('total_income', number_format($total_income, '2', '.', ''));
- return $this->fetch();
- }
- }
|