Finance.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 think\facade\App;
  14. use app\adminapi\controller\AuthController;
  15. /**
  16. * Class Finance
  17. * @package app\adminapi\controller\v1\finance
  18. */
  19. class Finance extends AuthController
  20. {
  21. /**
  22. * Finance constructor.
  23. * @param App $app
  24. * @param UserBillServices $services
  25. */
  26. public function __construct(App $app, UserBillServices $services)
  27. {
  28. parent::__construct($app);
  29. $this->services = $services;
  30. }
  31. /**
  32. * 筛选类型
  33. */
  34. public function bill_type()
  35. {
  36. return app('json')->success($this->services->bill_type());
  37. }
  38. /**
  39. * 资金记录
  40. */
  41. public function list()
  42. {
  43. $where = $this->request->getMore([
  44. ['start_time', ''],
  45. ['end_time', ''],
  46. ['nickname', ''],
  47. ['limit', 20],
  48. ['page', 1],
  49. ['type', ''],
  50. ]);
  51. return app('json')->success($this->services->getBillList($where));
  52. }
  53. /**
  54. * 佣金记录
  55. * @return mixed
  56. */
  57. public function get_commission_list()
  58. {
  59. $where = $this->request->getMore([
  60. ['nickname', ''],
  61. ['price_max', ''],
  62. ['price_min', ''],
  63. ['sum_number', 'normal'],
  64. ['brokerage_price', 'normal'],
  65. ['time', '']
  66. ]);
  67. return app('json')->success($this->services->getCommissionList($where));
  68. }
  69. /**
  70. * 佣金详情用户信息
  71. * @param $id
  72. * @return mixed
  73. */
  74. public function user_info($id)
  75. {
  76. return app('json')->success($this->services->user_info((int)$id));
  77. }
  78. /**
  79. * 佣金提现记录个人列表
  80. */
  81. public function get_extract_list($id = '')
  82. {
  83. if ($id == '') return app('json')->fail(100100);
  84. $where = $this->request->getMore([
  85. ['start_time', ''],
  86. ['end_time', ''],
  87. ['nickname', '']
  88. ]);
  89. $where['category'] = 'now_money';
  90. $where['type'] = ['brokerage', 'brokerage_user'];
  91. return app('json')->success($this->services->getBillOneList((int)$id, $where));
  92. }
  93. }