fly 4 年 前
コミット
e2173c43f4

+ 1 - 0
src/Requests/QueryReportRequest.php

@@ -24,6 +24,7 @@ class QueryReportRequest extends Request
                 'percent_filter',
                 'protected_eligible',
             ])],
+            'status' => ['integer', Rule::in([0, 1])],
         ];
     }
 }

+ 8 - 0
src/Services/LandingPage/LandingPageLinkService.php

@@ -225,6 +225,14 @@ class LandingPageLinkService
                     ->where('report_user_charge_records.type', $params['type']);
             });
         }
+        if (isset($params['status'])) {
+            $sql->whereExists(function ($query) use ($params) {
+                $query->select(DB::raw(1))
+                    ->from('report_user_charge_records')
+                    ->whereRaw('report_user_charge_records.order_no = orders.trade_no')
+                    ->where('report_user_charge_records.status', $params['status']);
+            });
+        }
         if ($is_page) {
             return $sql->paginate();
         } else {