|
...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Models\Template;
|
|
|
|
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Models\Base;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -13,4 +14,59 @@ use App\Models\Base; |
|
|
|
class TemplateModule extends Base
|
|
|
|
{
|
|
|
|
protected $table = 'gl_public_template_module';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :写入器image
|
|
|
|
* @name :setImageAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/3 16:17
|
|
|
|
*/
|
|
|
|
public function setImageAttribute($value){
|
|
|
|
$this->attributes['image'] = basename($value);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取器image
|
|
|
|
* @name :getImageAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/3 16:17
|
|
|
|
*/
|
|
|
|
public function getImageAttribute($value){
|
|
|
|
$value = getImageUrl($value);
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :写入器images
|
|
|
|
* @name :setImageAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/3 16:17
|
|
|
|
*/
|
|
|
|
public function setImagesAttribute($value){
|
|
|
|
$arr = explode(',',trim($value,','));
|
|
|
|
$arr_images = [];
|
|
|
|
foreach ($arr as $v){
|
|
|
|
$arr_images[] = basename($v);
|
|
|
|
}
|
|
|
|
$this->attributes['images'] = implode(',',$arr_images);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取器images
|
|
|
|
* @name :getImageAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/3 16:17
|
|
|
|
*/
|
|
|
|
public function getImagesAttribute($value){
|
|
|
|
$arr = explode(',',$value);
|
|
|
|
$value = [];
|
|
|
|
foreach ($arr as $v){
|
|
|
|
$value[] = getImageUrl($v);
|
|
|
|
}
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|