<?php /** * Created by PhpStorm. * User: Administrator * Date: 2018/12/25 * Time: 19:49 */ namespace app\index\model; use think\Model; class PageHtmlModel extends Model { /** * thumbnail 自动转化 * @param $value * @return string */ public function getThumbnailAttr($value) { return cmf_get_image_url($value); } /** * content 自动转化 * @param $value * @return string */ public function getContentAttr($value) { return cmf_replace_content_file_url(htmlspecialchars_decode($value)); } public function findData($where){ $data = $this->where($where)->find(); return $data; } }