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.

50 lines
1.8 KiB

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