catchSearch() ->select() ->toArray(); foreach ($list as $val) { $group_data[$val['type']][$val['field']] = $val['fieldValue']; } return $group_data; } /** * 获取离线配置值 */ public static function getOfflineConfigValue(String $field) { if (Cache::has($field)) { return Cache::get($field); } return SysConfig::where('type', 'offline_config') ->where('field', $field) ->cache($field, 60) ->value('fieldValue'); } public function getConfigListByType($type) { $list = $this->catchSearch() ->where('type','in',$type) ->select() ->toArray(); return $list; } /** * 根据字段和类型获取配置值 */ public static function getConfigValueBy(String $field,String $type) { return SysConfig::where('type', $type) ->where('field', $field) ->cache($type.'_'.$field, 60) ->value('fieldValue'); } }