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.

59 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. $page = $this->request->input('page',0);
  24. $pagesize = $this->request->input('pagesize',0);
  25. $startTime = $this->request->input('start_time','');
  26. $endTime = $this->request->input('end_time','');
  27. if(!empty($startTime)){
  28. $startTime = strtotime($startTime.' 00:00:00');
  29. }
  30. if(!empty($endTime)){
  31. $endTime = strtotime($endTime.' 23:59:59');
  32. }
  33. return $this->success($this->revenueListService->getListByUser($userId, $page, $pagesize ,$startTime,$endTime));
  34. }
  35. public function getWithdrawalListByStore()
  36. {
  37. $storeId = $this->request->input('store_id',0);
  38. $page = $this->request->input('page',0);
  39. $pagesize = $this->request->input('pagesize',0);
  40. $startTime = $this->request->input('start_time','');
  41. $endTime = $this->request->input('end_time','');
  42. if(!empty($startTime)){
  43. $startTime = strtotime(date($startTime.' 00:00:00'));
  44. }
  45. if(!empty($endTime)){
  46. $endTime = strtotime(date($endTime.' 23:59:59'));
  47. }
  48. $res = $this->withdrawalListService->getListByStore($storeId,$page,$pagesize,$startTime,$endTime);
  49. return $this->success($res);
  50. }
  51. }