$search, 'searchable' => DrugReportInfo::$searchable, ], $sort); $query = DrugReportInfo::query() ->applyFilters( $filters, $options, ); return $query->paginate($perPage); } /** * 获取生产企业选项 * @return array */ public function getProduceEntIdOption(): array { return DrugReportInfo::query() ->where('produce_ent_id', '!=', '') ->pluck('produce_ent_name', 'produce_ent_id') ->unique() ->toArray(); } /** * 获取发货企业选项 * @return array */ public function getFromRefEntIdOption(): array { return DrugReportInfo::query() ->where('from_ref_ent_id', '!=', '') ->pluck('from_ent_name', 'from_ref_ent_id') ->unique() ->toArray(); } }