UserBalance.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\adminapi\controller\v1\finance;
  3. use app\adminapi\controller\AuthController;
  4. use app\services\user\UserMoneyServices;
  5. use think\facade\App;
  6. class UserBalance extends AuthController
  7. {
  8. /**
  9. * UserBalance constructor.
  10. * @param App $app
  11. * @param UserMoneyServices $services
  12. */
  13. public function __construct(App $app, UserMoneyServices $services)
  14. {
  15. parent::__construct($app);
  16. $this->services = $services;
  17. }
  18. /**
  19. * 余额记录
  20. * @return mixed
  21. */
  22. public function balanceList()
  23. {
  24. $where = $this->request->getMore([
  25. ['time', ''],
  26. ['trading_type', 0, '', 'type']
  27. ]);
  28. $date = $this->services->balanceList($where);
  29. return app('json')->success($date);
  30. }
  31. /**
  32. * 余额记录备注
  33. * @return mixed
  34. */
  35. public function balanceRecordRemark($id = 0)
  36. {
  37. [$mark] = $this->request->postMore([
  38. ['mark', '']
  39. ], true);
  40. if (!$id) return app('json')->fail('参数错误');
  41. if ($mark === '') return app('json')->fail('备注不能为空');
  42. $this->services->recordRemark($id, $mark);
  43. return app('json')->success('备注成功');
  44. }
  45. }