This commit is contained in:
root 2020-01-27 15:49:44 +08:00
parent dad9e43114
commit a60d68a13f

View File

@ -23,9 +23,12 @@ class OrderController extends Controller
{ {
public function fetch(Request $request) public function fetch(Request $request)
{ {
$order = Order::where('user_id', $request->session()->get('id')) $model = Order::where('user_id', $request->session()->get('id'))
->orderBy('created_at', 'DESC') ->orderBy('created_at', 'DESC');
->get(); if ($request->input('status')) {
$model->where('status', $request->input('status'));
}
$order = $model->get();
$plan = Plan::get(); $plan = Plan::get();
for ($i = 0; $i < count($order); $i++) { for ($i = 0; $i < count($order); $i++) {
for ($x = 0; $x < count($plan); $x++) { for ($x = 0; $x < count($plan); $x++) {