request = $request; } /** * @inheritDoc */ public function apply($model, RepositoryInterface $repository) { if ($this->request->filled('shop_id')) { $shop_id = $this->request->get('shop_id'); $model = $model->where('shop_id', 'in', [$shop_id, 0]); } if ($this->request->filled('status')) { $model = $model->where('status', $this->request->get('status')); } if (login_user_id()) { $model = $model->where('valid_time', '>=', now())->where('status', ModelStatusEnum::OK); } $model = $model->orderBy("id", 'desc'); return parent::apply($model, $repository); } }