// +---------------------------------------------------------------------- namespace App\Models; /** * 配置管理-模型 * @author laravel开发员 * @since 2020/11/11 * Class ConfigModel * @package App\Models */ class ConfigModel extends BaseModel { // 设置数据表 protected $table = 'config'; public function getInfo($id) { $info = parent::getInfo($id); // TODO: Change the autogenerated stub if($info){ $type = isset($info['type'])? $info['type'] : 'text'; if(isset($info['value']) && $type=='image'){ $info['value'] = get_image_url($info['value']); } if(isset($info['value']) && $type=='daterange'){ $info['value'] = json_decode($info['value'], true); } } return $info; } }