Finance.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\finance;
  12. use app\services\user\UserBillServices;
  13. use think\facade\App;
  14. use app\adminapi\controller\AuthController;
  15. class Finance extends AuthController
  16. {
  17. /**
  18. * Finance constructor.
  19. * @param App $app
  20. * @param UserBillServices $services
  21. */
  22. public function __construct(App $app, UserBillServices $services)
  23. {
  24. parent::__construct($app);
  25. $this->services = $services;
  26. }
  27. /**
  28. * 筛选类型
  29. */
  30. public function bill_type()
  31. {
  32. return app('json')->success($this->services->bill_type());
  33. }
  34. /**
  35. * 资金记录
  36. */
  37. public function list()
  38. {
  39. $where = $this->request->getMore([
  40. ['start_time', ''],
  41. ['end_time', ''],
  42. ['nickname', ''],
  43. ['limit', 20],
  44. ['page', 1],
  45. ['type', ''],
  46. ]);
  47. return app('json')->success($this->services->getBillList($where));
  48. }
  49. /**
  50. * 佣金记录
  51. * @return mixed
  52. */
  53. public function get_commission_list()
  54. {
  55. $where = $this->request->getMore([
  56. ['nickname', ''],
  57. ['price_max', ''],
  58. ['price_min', ''],
  59. ['sum_number', 'normal'],
  60. ['brokerage_price', 'normal']
  61. ]);
  62. return app('json')->success($this->services->getCommissionList($where));
  63. }
  64. /**
  65. * 佣金详情用户信息
  66. * @param $id
  67. * @return mixed
  68. */
  69. public function user_info($id)
  70. {
  71. return app('json')->success($this->services->user_info((int)$id));
  72. }
  73. /**
  74. * 佣金提现记录个人列表
  75. */
  76. public function get_extract_list($id = '')
  77. {
  78. if ($id == '') return app('json')->fail('缺少参数');
  79. $where = $this->request->getMore([
  80. ['start_time', ''],
  81. ['end_time', ''],
  82. ['nickname', '']
  83. ]);
  84. $where['category'] = 'now_money';
  85. $where['type'] = 'brokerage';
  86. return app('json')->success($this->services->getBillOneList((int)$id, $where));
  87. }
  88. }