Finance.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 index3()
  90. {
  91. }
  92. /**
  93. * 佣金详情
  94. */
  95. public function content_info($uid = '')
  96. {
  97. if ($uid == '') return $this->failed('缺少参数');
  98. $this->assign('userinfo', User::getUserinfo($uid));
  99. $this->assign('uid', $uid);
  100. return $this->fetch();
  101. }
  102. /**
  103. * 佣金提现记录个人列表
  104. */
  105. public function get_extract_list($uid = '')
  106. {
  107. if ($uid == '') return Json::fail('缺少参数');
  108. $where = Util::getMore([
  109. ['page', 1],
  110. ['limit', 20],
  111. ['start_time', ''],
  112. ['end_time', ''],
  113. ['nickname', '']
  114. ]);
  115. return Json::successlayui(UserBill::getExtrctOneList($where, $uid));
  116. }
  117. }