Finance.php 3.6 KB

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