Finance.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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 get_dividends_list()
  90. {
  91. $where = Util::getMore([
  92. ['start_time', ''],
  93. ['end_time', ''],
  94. ['nickname', ''],
  95. ['limit', 20],
  96. ['page', 1],
  97. // ['type', ''],
  98. ]);
  99. return Json::successlayui(FinanceModel::getDividendsList($where));
  100. }
  101. /**
  102. * 显示操作记录
  103. */
  104. public function index3()
  105. {
  106. }
  107. /**
  108. * 佣金详情
  109. */
  110. public function content_info($uid = '')
  111. {
  112. if ($uid == '') return $this->failed('缺少参数');
  113. $this->assign('userinfo', User::getUserinfo($uid));
  114. $this->assign('uid', $uid);
  115. return $this->fetch();
  116. }
  117. /**
  118. * 佣金提现记录个人列表
  119. */
  120. public function get_extract_list($uid = '')
  121. {
  122. if ($uid == '') return Json::fail('缺少参数');
  123. $where = Util::getMore([
  124. ['page', 1],
  125. ['limit', 20],
  126. ['start_time', ''],
  127. ['end_time', ''],
  128. ['nickname', '']
  129. ]);
  130. return Json::successlayui(UserBill::getExtrctOneList($where, $uid));
  131. }
  132. }