|
@@ -39,10 +39,6 @@ class Product extends Base |
|
@@ -39,10 +39,6 @@ class Product extends Base |
|
39
|
3=>'热销产品'
|
39
|
3=>'热销产品'
|
|
40
|
];
|
40
|
];
|
|
41
|
|
41
|
|
|
42
|
- public function setThumbAttribute($value){
|
|
|
|
43
|
- $value['url'] = str_replace_url($value['url']);
|
|
|
|
44
|
- $this->attributes['thumb'] = Arr::a2s($value);
|
|
|
|
45
|
- }
|
|
|
|
46
|
|
42
|
|
|
47
|
public function getThumbAttribute($value){
|
43
|
public function getThumbAttribute($value){
|
|
48
|
$value = json_decode($value,true);
|
44
|
$value = json_decode($value,true);
|
|
@@ -50,15 +46,6 @@ class Product extends Base |
|
@@ -50,15 +46,6 @@ class Product extends Base |
|
50
|
return $value;
|
46
|
return $value;
|
|
51
|
}
|
47
|
}
|
|
52
|
|
48
|
|
|
53
|
- public function setGalleryAttribute($value){
|
|
|
|
54
|
- if(!empty($value)){
|
|
|
|
55
|
- foreach ($value as $k => $v){
|
|
|
|
56
|
- $v['url'] = str_replace_url($v['url']);
|
|
|
|
57
|
- $value[$k] = $v;
|
|
|
|
58
|
- }
|
|
|
|
59
|
- }
|
|
|
|
60
|
- $this->attributes['gallery'] = Arr::a2s($value);
|
|
|
|
61
|
- }
|
|
|
|
62
|
|
49
|
|
|
63
|
public function getGalleryAttribute($value){
|
50
|
public function getGalleryAttribute($value){
|
|
64
|
$value = Arr::s2a($value);
|
51
|
$value = Arr::s2a($value);
|
|
@@ -76,21 +63,6 @@ class Product extends Base |
|
@@ -76,21 +63,6 @@ class Product extends Base |
|
76
|
* @method :post
|
63
|
* @method :post
|
|
77
|
* @time :2023/7/21 11:11
|
64
|
* @time :2023/7/21 11:11
|
|
78
|
*/
|
65
|
*/
|
|
79
|
- public function setIconAttribute($value){
|
|
|
|
80
|
- foreach ($value as $k => $v){
|
|
|
|
81
|
- $v = str_replace_url($v);
|
|
|
|
82
|
- $value[$k] = $v;
|
|
|
|
83
|
- }
|
|
|
|
84
|
- $this->attributes['icon'] = Arr::a2s($value);
|
|
|
|
85
|
- }
|
|
|
|
86
|
-
|
|
|
|
87
|
- /**
|
|
|
|
88
|
- * @remark :图标获取器
|
|
|
|
89
|
- * @name :getGalleryAttribute
|
|
|
|
90
|
- * @author :lyh
|
|
|
|
91
|
- * @method :post
|
|
|
|
92
|
- * @time :2023/7/21 11:11
|
|
|
|
93
|
- */
|
|
|
|
94
|
public function getIconAttribute($value){
|
66
|
public function getIconAttribute($value){
|
|
95
|
$value = Arr::s2a($value);
|
67
|
$value = Arr::s2a($value);
|
|
96
|
if(!empty($value)){
|
68
|
if(!empty($value)){
|
|
@@ -102,66 +74,42 @@ class Product extends Base |
|
@@ -102,66 +74,42 @@ class Product extends Base |
|
102
|
return $value;
|
74
|
return $value;
|
|
103
|
}
|
75
|
}
|
|
104
|
|
76
|
|
|
105
|
- public function setAttrsAttribute($value){
|
|
|
|
106
|
- $this->attributes['attrs'] = Arr::a2s($value);
|
|
|
|
107
|
- }
|
|
|
|
108
|
|
77
|
|
|
109
|
public function getAttrsAttribute($value){
|
78
|
public function getAttrsAttribute($value){
|
|
110
|
return Arr::s2a($value);
|
79
|
return Arr::s2a($value);
|
|
111
|
}
|
80
|
}
|
|
112
|
|
81
|
|
|
113
|
- public function setDescribeAttribute($value){
|
|
|
|
114
|
- $this->attributes['describe'] = Arr::a2s($value);
|
|
|
|
115
|
- }
|
|
|
|
116
|
-
|
|
|
|
117
|
public function getDescribeAttribute($value){
|
82
|
public function getDescribeAttribute($value){
|
|
118
|
return Arr::s2a($value);
|
83
|
return Arr::s2a($value);
|
|
119
|
}
|
84
|
}
|
|
120
|
|
85
|
|
|
121
|
- public function setSeoMateAttribute($value){
|
|
|
|
122
|
- $this->attributes['seo_mate'] = Arr::a2s($value);
|
|
|
|
123
|
- }
|
86
|
+
|
|
124
|
|
87
|
|
|
125
|
public function getSeoMateAttribute($value){
|
88
|
public function getSeoMateAttribute($value){
|
|
126
|
return Arr::s2a($value);
|
89
|
return Arr::s2a($value);
|
|
127
|
}
|
90
|
}
|
|
128
|
|
91
|
|
|
129
|
- public function setCategoryIdAttribute($value){
|
|
|
|
130
|
- $this->attributes['category_id'] = ','.Arr::arrToSet($value).',';
|
|
|
|
131
|
- }
|
92
|
+
|
|
132
|
|
93
|
|
|
133
|
public function getCategoryIdAttribute($value){
|
94
|
public function getCategoryIdAttribute($value){
|
|
134
|
return Arr::setToArr(trim($value,','));
|
95
|
return Arr::setToArr(trim($value,','));
|
|
135
|
}
|
96
|
}
|
|
136
|
|
97
|
|
|
137
|
- public function setAttrIdAttribute($value){
|
|
|
|
138
|
- $this->attributes['attr_id'] = Arr::arrToSet($value);
|
|
|
|
139
|
- }
|
|
|
|
140
|
|
98
|
|
|
141
|
public function getAttrIdAttribute($value){
|
99
|
public function getAttrIdAttribute($value){
|
|
142
|
return Arr::setToArr($value);
|
100
|
return Arr::setToArr($value);
|
|
143
|
}
|
101
|
}
|
|
144
|
|
102
|
|
|
145
|
- public function setDescribeIdAttribute($value){
|
|
|
|
146
|
- $this->attributes['describe_id'] = Arr::arrToSet($value);
|
|
|
|
147
|
- }
|
|
|
|
148
|
|
103
|
|
|
149
|
public function getDescribeIdAttribute($value){
|
104
|
public function getDescribeIdAttribute($value){
|
|
150
|
return Arr::setToArr($value);
|
105
|
return Arr::setToArr($value);
|
|
151
|
}
|
106
|
}
|
|
152
|
|
107
|
|
|
153
|
- public function setKeywordIdAttribute($value){
|
|
|
|
154
|
- $this->attributes['keyword_id'] = ','.Arr::arrToSet($value).',';
|
|
|
|
155
|
- }
|
|
|
|
156
|
|
108
|
|
|
157
|
public function getKeywordIdAttribute($value){
|
109
|
public function getKeywordIdAttribute($value){
|
|
158
|
return Arr::setToArr(trim($value,','));
|
110
|
return Arr::setToArr(trim($value,','));
|
|
159
|
}
|
111
|
}
|
|
160
|
|
112
|
|
|
161
|
- public function setRelatedProductIdAttribute($value){
|
|
|
|
162
|
- $this->attributes['related_product_id'] = Arr::arrToSet($value);
|
|
|
|
163
|
- }
|
|
|
|
164
|
-
|
|
|
|
165
|
public function getRelatedProductIdAttribute($value){
|
113
|
public function getRelatedProductIdAttribute($value){
|
|
166
|
return Arr::setToArr($value);
|
114
|
return Arr::setToArr($value);
|
|
167
|
}
|
115
|
}
|