MemberDailyReport.php 1.1 KB

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Http\Controllers\admin;
  3. use App\Http\Controllers\AgentApiController;
  4. use App\Services\MemberDailyReportService;
  5. use Illuminate\Http\Request;
  6. /** 会员每日盈亏报表(总后台看全部会员,可按代理、代理类型筛选)。 */
  7. class MemberDailyReport extends AgentApiController
  8. {
  9. public function index(Request $request, MemberDailyReportService $reports)
  10. {
  11. return $this->execute(function () use ($request, $reports) {
  12. $data = $request->validate([
  13. 'page' => ['nullable', 'integer', 'min:1'], 'limit' => ['nullable', 'integer', 'min:1', 'max:100'],
  14. 'start_date' => ['nullable', 'date_format:Y-m-d'], 'end_date' => ['nullable', 'date_format:Y-m-d', 'after_or_equal:start_date'],
  15. 'member_id' => ['nullable', 'string', 'max:64'], 'username' => ['nullable', 'string', 'max:128'],
  16. 'agent_id' => ['nullable', 'integer'], 'agent_type' => ['nullable', 'integer', 'in:1,2'],
  17. ]);
  18. return $reports->paginate($data);
  19. });
  20. }
  21. }