Browse Source

fix:意见反馈

super-yimizi 1 month ago
parent
commit
3890f65e6a
1 changed files with 12 additions and 1 deletions
  1. 12 1
      application/common/model/Feedback.php

+ 12 - 1
application/common/model/Feedback.php

@@ -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);
+    }