正在显示
1 个修改的文件
包含
32 行增加
和
0 行删除
| @@ -71,4 +71,36 @@ class TemplateModule extends Base | @@ -71,4 +71,36 @@ class TemplateModule extends Base | ||
| 71 | } | 71 | } |
| 72 | return $value; | 72 | return $value; |
| 73 | } | 73 | } |
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * @remark :写入器images | ||
| 77 | + * @name :setImageAttribute | ||
| 78 | + * @author :lyh | ||
| 79 | + * @method :post | ||
| 80 | + * @time :2023/8/3 16:17 | ||
| 81 | + */ | ||
| 82 | + public function setVideoAttribute($value){ | ||
| 83 | + $arr = explode(',',trim($value,',')); | ||
| 84 | + $arr_images = []; | ||
| 85 | + foreach ($arr as $v){ | ||
| 86 | + $arr_images[] = basename($v); | ||
| 87 | + } | ||
| 88 | + $this->attributes['video'] = implode(',',$arr_images); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * @remark :获取器images | ||
| 93 | + * @name :getImageAttribute | ||
| 94 | + * @author :lyh | ||
| 95 | + * @method :post | ||
| 96 | + * @time :2023/8/3 16:17 | ||
| 97 | + */ | ||
| 98 | + public function getVideoAttribute($value){ | ||
| 99 | + $arr = explode(',',$value); | ||
| 100 | + $value = []; | ||
| 101 | + foreach ($arr as $v){ | ||
| 102 | + $value[] = getImageUrl($v); | ||
| 103 | + } | ||
| 104 | + return $value; | ||
| 105 | + } | ||
| 74 | } | 106 | } |
-
请 注册 或 登录 后发表评论