HomeModel.php 811 字节
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/28
 * Time: 10:05
 */

namespace api\index\model;


use think\Model;

class HomeModel extends Model
{
    public function getContentAttr($value){
        return cmf_replace_content_file_url(htmlspecialchars_decode($value));;
    }
    public function getThumbnailAttr($value){
        return cmf_get_image_preview_url($value);
    }
    public function getImagesAttr($value){
        if(!empty($value)){
            $data = explode(',',$value);
            foreach($data as $key => $vo){
                $data[$key] = cmf_get_image_url($vo);
            }
            return $data;
        }
    }
    public function findData($where){
        $data = $this
            ->where($where)
            ->find();
        return $data;
    }
}