Finance.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xurongyao <763569752@qq.com>
  5. * Date: 2018/6/14 下午5:25
  6. */
  7. namespace app\admin\controller\finance;
  8. use app\admin\controller\AuthController;
  9. use app\admin\model\order\StoreOrder;
  10. use app\admin\model\user\{User,UserBill};
  11. use app\admin\model\finance\FinanceModel;
  12. use crmeb\services\{UtilService as Util,JsonService as Json};
  13. /**
  14. * 微信充值记录
  15. * Class UserRecharge
  16. * @package app\admin\controller\user
  17. */
  18. class Finance extends AuthController
  19. {
  20. /**
  21. * 显示资金记录
  22. */
  23. public function bill()
  24. {
  25. $list = UserBill::where('type', 'not in', ['gain', 'system_sub', 'deduction', 'sign'])
  26. ->where('category', 'not in', 'integral')
  27. ->field(['title', 'type'])
  28. ->group('type')
  29. ->distinct(true)
  30. ->select()
  31. ->toArray();
  32. $data['order_number'] = StoreOrder::where('paid', 1)->sum('pay_price');//订单总数
  33. $data['today_number'] = StoreOrder::where('paid', 1)->whereBetweenTime('add_time', strtotime('today'), strtotime('tomorrow'))->sum('pay_price');//今天订单
  34. $data['yu_number'] = StoreOrder::where('paid', 1)->where('pay_type', 'yue')->sum('pay_price');//余额订单
  35. $data['ali_number'] = StoreOrder::where('paid', 1)->where('pay_type', 'alipay_wap')->sum('pay_price');//支付宝订单
  36. $this->assign('data', $data);
  37. $this->assign('selectList', $list);
  38. return $this->fetch();
  39. }
  40. /**
  41. * 显示资金记录ajax列表
  42. */
  43. public function billlist()
  44. {
  45. $where = Util::getMore([
  46. ['start_time', ''],
  47. ['end_time', ''],
  48. ['nickname', ''],
  49. ['limit', 20],
  50. ['page', 1],
  51. ['type', ''],
  52. ]);
  53. return Json::successlayui(FinanceModel::getBillList($where));
  54. }
  55. /**
  56. *保存资金监控的excel表格
  57. */
  58. public function save_bell_export()
  59. {
  60. $where = Util::getMore([
  61. ['start_time', ''],
  62. ['end_time', ''],
  63. ['nickname', ''],
  64. ['type', ''],
  65. ]);
  66. FinanceModel::SaveExport($where);
  67. }
  68. /**
  69. * 显示佣金记录
  70. */
  71. public function commission_list()
  72. {
  73. $this->assign('is_layui', true);
  74. return $this->fetch();
  75. }
  76. /**
  77. * 佣金记录异步获取
  78. */
  79. public function get_commission_list()
  80. {
  81. $get = Util::getMore([
  82. ['page', 1],
  83. ['limit', 20],
  84. ['nickname', ''],
  85. ['price_max', ''],
  86. ['price_min', ''],
  87. ['order', ''],
  88. ['excel', ''],
  89. ]);
  90. return Json::successlayui(User::getCommissionList($get));
  91. }
  92. /**
  93. * 显示操作记录
  94. */
  95. public function index3()
  96. {
  97. }
  98. /**
  99. * 佣金详情
  100. */
  101. public function content_info($uid = '')
  102. {
  103. if ($uid == '') return $this->failed('缺少参数');
  104. $this->assign('userinfo', User::getUserinfo($uid));
  105. $this->assign('uid', $uid);
  106. return $this->fetch();
  107. }
  108. /**
  109. * 佣金提现记录个人列表
  110. */
  111. public function get_extract_list($uid = '')
  112. {
  113. if ($uid == '') return Json::fail('缺少参数');
  114. $where = Util::getMore([
  115. ['page', 1],
  116. ['limit', 20],
  117. ['start_time', ''],
  118. ['end_time', ''],
  119. ['nickname', '']
  120. ]);
  121. return Json::successlayui(UserBill::getExtrctOneList($where, $uid));
  122. }
  123. }