where('id', $id)->first(Promote::$levelColumns); $levelIds = []; foreach (Promote::$levelColumns as $column) { if ($promote->{$column} > 0) { $levelIds[] = $promote->{$column}; } } return Promote::query()->whereIn('id', $levelIds)->get($columns); } }