UserBalance.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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\adminapi\controller\AuthController;
  13. use app\services\user\UserMoneyServices;
  14. use think\facade\App;
  15. class UserBalance extends AuthController
  16. {
  17. /**
  18. * UserBalance constructor.
  19. * @param App $app
  20. * @param UserMoneyServices $services
  21. */
  22. public function __construct(App $app, UserMoneyServices $services)
  23. {
  24. parent::__construct($app);
  25. $this->services = $services;
  26. }
  27. /**
  28. * 余额记录
  29. * @return mixed
  30. */
  31. public function balanceList()
  32. {
  33. $where = $this->request->getMore([
  34. ['time', ''],
  35. ['trading_type', 0, '', 'type']
  36. ]);
  37. $date = $this->services->balanceList($where);
  38. return app('json')->success($date);
  39. }
  40. /**
  41. * 余额记录备注
  42. * @return mixed
  43. */
  44. public function balanceRecordRemark($id = 0)
  45. {
  46. [$mark] = $this->request->postMore([
  47. ['mark', '']
  48. ], true);
  49. if (!$id) return app('json')->fail(100100);
  50. if ($mark === '') return app('json')->fail(400106);
  51. $this->services->recordRemark($id, $mark);
  52. return app('json')->success(100024);
  53. }
  54. }