|
@@ -30,7 +30,10 @@ class Feedback extends Model
|
|
|
|
|
|
public function setImagesAttr($value)
|
|
|
{
|
|
|
- return json_encode($value);
|
|
|
+ if (is_array($value)) {
|
|
|
+ return implode(',', $value);
|
|
|
+ }
|
|
|
+ return $value;
|
|
|
}
|
|
|
|
|
|
public function user()
|
|
@@ -46,6 +49,14 @@ class Feedback extends Model
|
|
|
public function getImageTextAttr($value, $data){
|
|
|
return json_decode($data['images'], true);
|
|
|
}
|
|
|
+
|
|
|
+ public function getImagesAttr($value)
|
|
|
+ {
|
|
|
+ if ($value === '' || $value === null) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ return explode(',', $value);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|