AboutModel.php
694 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/1/3
* Time: 19:06
*/
namespace api\index\model;
use think\Model;
class AboutModel extends Model
{
/**
* thumbnail 自动转化
* @param $value
* @return array
*/
public function getThumbnailAttr($value)
{
return cmf_get_image_url($value);
}
/**
* content 自动转化
* @param $value
* @return array
*/
public function getContentAttr($value)
{
return cmf_replace_content_file_url(htmlspecialchars_decode($value));
}
public function findData($where){
$data = $this->where($where)->find();
return $data;
}
}