|
@@ -32,10 +32,9 @@ class Product extends Base |
|
@@ -32,10 +32,9 @@ class Product extends Base |
|
32
|
];
|
32
|
];
|
|
33
|
}
|
33
|
}
|
|
34
|
|
34
|
|
|
35
|
-// public function setThumbAttribute($value){
|
|
|
|
36
|
-// $value['url'] = Upload::url2path($value['url']);
|
|
|
|
37
|
-// $this->attributes['thumb'] = Arr::a2s($value);
|
|
|
|
38
|
-// }
|
35
|
+ public function setThumbAttribute($value){
|
|
|
|
36
|
+ $this->attributes['thumb'] = Arr::a2s($value);
|
|
|
|
37
|
+ }
|
|
39
|
|
38
|
|
|
40
|
public function getThumbAttribute($value){
|
39
|
public function getThumbAttribute($value){
|
|
41
|
$value = Arr::s2a($value);
|
40
|
$value = Arr::s2a($value);
|
|
@@ -43,12 +42,9 @@ class Product extends Base |
|
@@ -43,12 +42,9 @@ class Product extends Base |
|
43
|
return $value;
|
42
|
return $value;
|
|
44
|
}
|
43
|
}
|
|
45
|
|
44
|
|
|
46
|
-// public function setGalleryAttribute($value){
|
|
|
|
47
|
-// foreach ($value as &$v){
|
|
|
|
48
|
-// $v['url'] = Upload::url2path($v['url']);
|
|
|
|
49
|
-// }
|
|
|
|
50
|
-// $this->attributes['gallery'] = Arr::a2s($value);
|
|
|
|
51
|
-// }
|
45
|
+ public function setGalleryAttribute($value){
|
|
|
|
46
|
+ $this->attributes['gallery'] = Arr::a2s($value);
|
|
|
|
47
|
+ }
|
|
52
|
|
48
|
|
|
53
|
public function getGalleryAttribute($value){
|
49
|
public function getGalleryAttribute($value){
|
|
54
|
$value = Arr::s2a($value);
|
50
|
$value = Arr::s2a($value);
|
|
@@ -65,10 +61,22 @@ class Product extends Base |
|
@@ -65,10 +61,22 @@ class Product extends Base |
|
65
|
* @method :post
|
61
|
* @method :post
|
|
66
|
* @time :2023/7/21 11:11
|
62
|
* @time :2023/7/21 11:11
|
|
67
|
*/
|
63
|
*/
|
|
|
|
64
|
+ public function setIconAttribute($value){
|
|
|
|
65
|
+ $this->attributes['gallery'] = Arr::a2s($value);
|
|
|
|
66
|
+ }
|
|
|
|
67
|
+
|
|
|
|
68
|
+ /**
|
|
|
|
69
|
+ * @remark :图标获取器
|
|
|
|
70
|
+ * @name :getGalleryAttribute
|
|
|
|
71
|
+ * @author :lyh
|
|
|
|
72
|
+ * @method :post
|
|
|
|
73
|
+ * @time :2023/7/21 11:11
|
|
|
|
74
|
+ */
|
|
68
|
public function getIconAttribute($value){
|
75
|
public function getIconAttribute($value){
|
|
69
|
$value = $this->getImageUrl($value);
|
76
|
$value = $this->getImageUrl($value);
|
|
70
|
return $value;
|
77
|
return $value;
|
|
71
|
}
|
78
|
}
|
|
|
|
79
|
+
|
|
72
|
public function setAttrsAttribute($value){
|
80
|
public function setAttrsAttribute($value){
|
|
73
|
$this->attributes['attrs'] = Arr::a2s($value);
|
81
|
$this->attributes['attrs'] = Arr::a2s($value);
|
|
74
|
}
|
82
|
}
|