Finance.php 3.0 KB

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