Finance.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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\user\{User,UserBill};
  10. use app\admin\model\finance\FinanceModel;
  11. use crmeb\services\{UtilService as Util,JsonService as Json};
  12. /**
  13. * 微信充值记录
  14. * Class UserRecharge
  15. * @package app\admin\controller\user
  16. */
  17. class Finance extends AuthController
  18. {
  19. /**
  20. * 显示资金记录
  21. */
  22. public function bill()
  23. {
  24. $list = UserBill::where('type', 'not in', ['gain', 'system_sub', 'deduction', 'sign'])
  25. ->where('category', 'not in', 'integral')
  26. ->field(['title', 'type'])
  27. ->group('type')
  28. ->distinct(true)
  29. ->select()
  30. ->toArray();
  31. $this->assign('selectList', $list);
  32. return $this->fetch();
  33. }
  34. /**
  35. * 显示资金记录ajax列表
  36. */
  37. public function billlist()
  38. {
  39. $where = Util::getMore([
  40. ['start_time', ''],
  41. ['end_time', ''],
  42. ['nickname', ''],
  43. ['limit', 20],
  44. ['page', 1],
  45. ['type', ''],
  46. ]);
  47. return Json::successlayui(FinanceModel::getBillList($where));
  48. }
  49. /**
  50. *保存资金监控的excel表格
  51. */
  52. public function save_bell_export()
  53. {
  54. $where = Util::getMore([
  55. ['start_time', ''],
  56. ['end_time', ''],
  57. ['nickname', ''],
  58. ['type', ''],
  59. ]);
  60. FinanceModel::SaveExport($where);
  61. }
  62. /**
  63. * 显示佣金记录
  64. */
  65. public function commission_list()
  66. {
  67. $this->assign('is_layui', true);
  68. return $this->fetch();
  69. }
  70. /**
  71. * 佣金记录异步获取
  72. */
  73. public function get_commission_list()
  74. {
  75. $get = Util::getMore([
  76. ['page', 1],
  77. ['limit', 20],
  78. ['nickname', ''],
  79. ['price_max', ''],
  80. ['price_min', ''],
  81. ['order', ''],
  82. ['excel', ''],
  83. ]);
  84. return Json::successlayui(User::getCommissionList($get));
  85. }
  86. /**
  87. * 显示全网分红记录
  88. */
  89. public function dividends_list()
  90. {
  91. // 如果是AJAX请求,则返回数据(这是layuiTable的请求)
  92. if (request()->isAjax()) {
  93. return $this->get_dividends_list();
  94. }
  95. // 否则,返回视图
  96. return $this->fetch();
  97. }
  98. /**
  99. * 全网分红记录异步获取
  100. */
  101. public function get_dividends_list()
  102. {
  103. $where = Util::getMore([
  104. ['start_time', ''],
  105. ['end_time', ''],
  106. ['nickname', ''],
  107. ['limit', 20],
  108. ['page', 1],
  109. // ['type', ''],
  110. ]);
  111. return Json::successlayui(FinanceModel::getDividendsList($where));
  112. }
  113. /**
  114. * 显示操作记录
  115. */
  116. public function index3()
  117. {
  118. }
  119. /**
  120. * 佣金详情
  121. */
  122. public function content_info($uid = '')
  123. {
  124. if ($uid == '') return $this->failed('缺少参数');
  125. $this->assign('userinfo', User::getUserinfo($uid));
  126. $this->assign('uid', $uid);
  127. return $this->fetch();
  128. }
  129. /**
  130. * 佣金提现记录个人列表
  131. */
  132. public function get_extract_list($uid = '')
  133. {
  134. if ($uid == '') return Json::fail('缺少参数');
  135. $where = Util::getMore([
  136. ['page', 1],
  137. ['limit', 20],
  138. ['start_time', ''],
  139. ['end_time', ''],
  140. ['nickname', '']
  141. ]);
  142. return Json::successlayui(UserBill::getExtrctOneList($where, $uid));
  143. }
  144. }