You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Controller\v3;
  3. use App\Controller\BaseController;
  4. use App\Request\v3\UserRequest;
  5. use Hyperf\Di\Annotation\Inject;
  6. use App\Service\v3\Interfaces\RevenueListServiceInterface;
  7. use App\Service\v3\Interfaces\WithdrawalListServiceInterface;
  8. class BalanceStatementController extends BaseController
  9. {
  10. /**
  11. * @Inject
  12. * @var RevenueListServiceInterface
  13. */
  14. protected $revenueListService;
  15. /**
  16. * @Inject
  17. * @var WithdrawalListServiceInterface
  18. */
  19. protected $withdrawalListService;
  20. public function getRevenueListByUser(UserRequest $request)
  21. {
  22. $userId = $this->request->input('user_id',0);
  23. $tab = $this->request->input('tab','');
  24. $page = $this->request->input('page',0);
  25. $pagesize = $this->request->input('pagesize',0);
  26. $startTime = $this->request->input('start_time','');
  27. $endTime = $this->request->input('end_time','');
  28. if(!empty($startTime)){
  29. $startTime = strtotime($startTime.' 00:00:00');
  30. }
  31. if(!empty($endTime)){
  32. $endTime = strtotime($endTime.' 23:59:59');
  33. }
  34. return $this->success($this->revenueListService->getListByUser($userId, $tab,$page, $pagesize ,$startTime,$endTime));
  35. }
  36. public function getWithdrawalListByStore()
  37. {
  38. $storeId = $this->request->input('store_id',0);
  39. $page = $this->request->input('page',0);
  40. $pagesize = $this->request->input('pagesize',0);
  41. $startTime = $this->request->input('start_time','');
  42. $endTime = $this->request->input('end_time','');
  43. if(!empty($startTime)){
  44. $startTime = strtotime(date($startTime.' 00:00:00'));
  45. }
  46. if(!empty($endTime)){
  47. $endTime = strtotime(date($endTime.' 23:59:59'));
  48. }
  49. $res = $this->withdrawalListService->getListByStore($storeId,$page,$pagesize,$startTime,$endTime);
  50. return $this->success($res);
  51. }
  52. }