2021-01-30 20:59:12 +08:00

30 lines
609 B
PHP

<?php
namespace app\admin\model;
use think\Model;
class Sitemap extends Model
{
protected $append = ['pc_img_url', 'mobile_img_url'];
protected $resultSetType = 'collection';
/**
* 获取pc图片链接
* @param string $pc_img_url 转换pc图片链接
*/
public function getPcImgUrlAttr($value, $data)
{
return get_file($data['pc_img']);
}
/**
* 获mobile图片链接
* @param string mobile_img_url 转mobile图片链接
*/
public function getMobileImgUrlAttr($value, $data)
{
return get_file($data['mobile_img']);
}
}