Merge branch 'develop'
This commit is contained in:
@@ -28,23 +28,25 @@ class SysDictService
|
||||
|
||||
|
||||
|
||||
public static function pluckValuesByCode(string $dictCode): \Illuminate\Support\Collection
|
||||
public static function pluckValuesByCode(string $dictCode): array
|
||||
{
|
||||
return SysDict::where('dict_code', $dictCode)
|
||||
->where('status', 1)
|
||||
->first()?->items()
|
||||
->where('status', 1)
|
||||
->orderBy('sort')
|
||||
->pluck('item_value') ?? collect();
|
||||
->pluck('item_value')
|
||||
->toArray() ?? [];
|
||||
}
|
||||
|
||||
public static function pluckKeyValueByCode(string $dictCode): \Illuminate\Support\Collection
|
||||
public static function pluckKeyValueByCode(string $dictCode): array
|
||||
{
|
||||
return SysDict::where('dict_code', $dictCode)
|
||||
->where('status', 1)
|
||||
->first()?->items()
|
||||
->where('status', 1)
|
||||
->orderBy('sort')
|
||||
->pluck('item_value', 'item_label') ?? collect();
|
||||
->pluck('item_value', 'item_label')
|
||||
->toArray() ?? [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user