IndexsAction.class.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Fanwe 方维直播系统
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: 云淡风轻(1956838968@qq.com)
  8. // +----------------------------------------------------------------------
  9. class IndexsAction extends AuthAction{
  10. /*
  11. * 网站数据统计
  12. */
  13. public function statistics(){
  14. $user_count=M("User")->where("is_robot=0")->count();
  15. $no_effect=M("User")->where("is_robot=0 and is_effect=0 or is_effect=2")->count(); //未审核
  16. $is_effect=M("User")->where("is_robot=0 and is_effect=1")->count(); //审核
  17. //认证
  18. $user_authentication=M("User")->where("is_authentication = 2 and user_type=0 and is_effect=1 and is_robot = 0")->count();
  19. $business_authentication=M("User")->where("is_authentication = 2 and user_type=1 and is_effect=1 and is_robot = 0")->count();
  20. $all_authentication=M("User")->where(" (user_type=0 or user_type=1) and is_authentication =2 and is_effect=1 and is_robot = 0")->count();
  21. if(defined('QK_TREE')&& QK_TREE == 1){
  22. //树苗订单
  23. $tree_order_count= M("QkTreeOrder")->count();
  24. $total_tree_order_money = M("QkTreeOrder")->sum('pay');
  25. $m_config = load_auto_cache('m_config');
  26. $diamonds_name = $m_config['diamonds_name'];
  27. $this->assign("diamonds_name",$diamonds_name);
  28. $this->assign("tree_order_count",$tree_order_count);
  29. $this->assign("total_tree_order_money",$total_tree_order_money);
  30. $this->assign("open_qk_tree",1);
  31. }
  32. //资金进出
  33. //线上充值
  34. $online_pay = floatval($GLOBALS['db']->getOne("SELECT sum(money) FROM ".DB_PREFIX."payment_notice where is_paid = 1 and payment_id>0 "));
  35. $this->assign("online_pay",$online_pay);
  36. //总计
  37. $total_usre_money = $online_pay;
  38. $this->assign("total_usre_money",$total_usre_money);
  39. $this->assign("diamonds_name",$diamonds_name);
  40. $this->assign("tree_order_count",$tree_order_count);
  41. $this->assign("total_tree_order_money",$total_tree_order_money);
  42. $this->assign("user_count",$user_count);
  43. $this->assign("no_effect",$no_effect);
  44. $this->assign("is_effect",$is_effect);
  45. $this->assign("user_authentication",$user_authentication);
  46. $this->assign("business_authentication",$business_authentication);
  47. $this->assign("all_authentication",$all_authentication);
  48. $this->display();
  49. }
  50. }
  51. ?>