Yesterdaydata.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace app\admin\controller\informational;
  3. use app\common\model\ShopCategory;
  4. use app\admin\traits\Curd;
  5. use app\common\controller\AdminController;
  6. use EasyAdmin\annotation\ControllerAnnotation;
  7. use EasyAdmin\annotation\NodeAnotation;
  8. use think\App;
  9. use think\facade\Db;
  10. use think\Model;
  11. /**
  12. * Class Admin
  13. * @package app\admin\controller\system
  14. * @ControllerAnnotation(title="昨日数据管理")
  15. */
  16. class Yesterdaydata extends AdminController
  17. {
  18. use Curd;
  19. public function __construct(App $app)
  20. {
  21. parent::__construct($app);
  22. $this->model = new ShopCategory();
  23. }
  24. /**
  25. * @NodeAnotation(title="昨日数据列表")
  26. */
  27. public function index(){
  28. // $score = Db::name('user')->where('id', 'not in', 7493267)->sum('score');
  29. // $this->assign('score', $score);
  30. //
  31. // $chizi = Db::name('coupon_plan')->where('state', 1)->sum('target_num');
  32. // $this->assign('chizi', $chizi);
  33. $total = Db::name('user')->whereDay('reg_time', 'yesterday')->count('id');
  34. // $total_shim = Db::name('user')->whereDay('reg_time', 'yesterday')->where('is_auth', 1)->count('id');
  35. $res = [
  36. 'date'=>sr_getcurtime(time()-86400, 'Y年-m月-d日'),
  37. // 'tz_sum'=>Db::name('user')->sum('tz_num'),
  38. // 'xz_more_10'=>Db::name('user')->where('xz_num', '>', 11.5)->where('user_type', 'not in', '4')->sum('xz_num'),
  39. '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'),
  40. 'yesterday_incomey'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'in', '3')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
  41. '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'),
  42. 'yesterday_usdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'in', '19')->where('state', 6)->whereDay('creat_at', 'yesterday')->sum('total_fee'),
  43. 'withdow_success'=>number_format(Db::name('withdraw_log')->whereDay('update_at', 'yesterday')->where('status', 1)->sum('practical_money'), '2', '.', ''),
  44. 'withdow_apply_today'=>number_format(Db::name('withdraw_log')->whereDay('create_at', 'today')->where('status', 0)->sum('practical_money'), '2', '.', ''),
  45. 'yesterday_incomeuser'=>$total,
  46. // 'yester_incomshiming'=>$total_shim,
  47. // 'yester_couponnum'=>Db::name('coupon_plan_log')->whereDay('create_time', 'yesterday')->count('id'),
  48. // 'yeseter_xznum'=>Db::name('xz_log')->where('type', 6)->whereDay('create_at', 'yesterday')->sum('score'),
  49. // 'yester_shouxu'=>Db::name('xz_log')->where('type', 5)->whereDay('create_at', 'yesterday')->sum('shouxu_num'),
  50. 'total_score'=>Db::name('user')->where('id', 'not in', [5344210,5344229])->sum('score'),
  51. 'total_money'=>Db::name('user')->where('id', 'not in', [5344210,5344229])->sum('money'),
  52. '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'),
  53. 'today_incomey'=>Db::name('payment')->where('order_type', 4)->where('pay_way', 'in', '3')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
  54. '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'),
  55. 'today_usdt'=>Db::name('payment')->where('order_type', 5)->where('pay_way', 'in', '19')->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee'),
  56. ];
  57. $this->assign('res', $res);
  58. // $today_income
  59. $today_income = Db::name('payment')->where('order_type', 4)->where('state', 6)->whereDay('creat_at', 'today')->sum('total_fee');
  60. $this->assign('today_income', $today_income);
  61. $chongzhi = Db::name('payment')->where('state', 6)->where('order_type', 4)->sum('total_fee');
  62. // $yuechongzhi = Db::name('payment')->where('state', 6)->where('order_type', 5)->sum('total_fee');
  63. $total_income = $chongzhi ;
  64. $this->assign('total_income', number_format($total_income, '2', '.', ''));
  65. return $this->fetch();
  66. }
  67. }