Finance.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 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 app\services\user\UserBrokerageServices;
  14. use think\facade\App;
  15. use app\adminapi\controller\AuthController;
  16. /**
  17. * Class Finance
  18. * @package app\adminapi\controller\v1\finance
  19. */
  20. class Finance extends AuthController
  21. {
  22. /**
  23. * Finance constructor.
  24. * @param App $app
  25. * @param UserBillServices $services
  26. */
  27. public function __construct(App $app, UserBillServices $services)
  28. {
  29. parent::__construct($app);
  30. $this->services = $services;
  31. }
  32. /**
  33. * 筛选类型
  34. */
  35. public function bill_type()
  36. {
  37. return app('json')->success($this->services->bill_type());
  38. }
  39. /**
  40. * 资金记录
  41. */
  42. public function list()
  43. {
  44. $where = $this->request->getMore([
  45. ['start_time', ''],
  46. ['end_time', ''],
  47. ['nickname', ''],
  48. ['limit', 20],
  49. ['page', 1],
  50. ['type', ''],
  51. ]);
  52. return app('json')->success($this->services->getBillList($where));
  53. }
  54. /**
  55. * 佣金记录
  56. * @return mixed
  57. */
  58. public function get_commission_list()
  59. {
  60. $where = $this->request->getMore([
  61. ['nickname', ''],
  62. ['price_max', ''],
  63. ['price_min', ''],
  64. ['sum_number', 'normal'],
  65. ['brokerage_price', 'normal'],
  66. ['time', '']
  67. ]);
  68. return app('json')->success($this->services->getCommissionList($where));
  69. }
  70. /**
  71. * 佣金详情用户信息
  72. * @param $id
  73. * @return mixed
  74. */
  75. public function user_info($id)
  76. {
  77. return app('json')->success($this->services->user_info((int)$id));
  78. }
  79. // /**
  80. // * 佣金提现记录个人列表
  81. // */
  82. // public function get_extract_list($id = '')
  83. // {
  84. // if ($id == '') return app('json')->fail(100100);
  85. // $where = $this->request->getMore([
  86. // ['start_time', ''],
  87. // ['end_time', ''],
  88. // ['nickname', '']
  89. // ]);
  90. // $where['category'] = 'now_money';
  91. // $where['type'] = ['brokerage', 'brokerage_user'];
  92. // return app('json')->success($this->services->getBillOneList((int)$id, $where));
  93. // }
  94. /**
  95. * 佣金提现记录个人列表
  96. */
  97. public function get_extract_list($id = '')
  98. {
  99. if ($id == '') return app('json')->fail(100100);
  100. $where = $this->request->getMore([
  101. ['start_time', ''],
  102. ['end_time', ''],
  103. ['nickname', ''],
  104. ['limit', 20],
  105. ['page', 1]
  106. ]);
  107. /** @var UserBrokerageServices $userBrokerageServices */
  108. $userBrokerageServices = app()->make(UserBrokerageServices::class);
  109. return app('json')->success($userBrokerageServices->getBrokerageOneList((int)$id, $where));
  110. }
  111. }