Przeglądaj źródła

wesmiler ECY 画画交易平台

APPLE 3 lat temu
rodzic
commit
18a825f7d6
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      application/api/model/taxi/User.php

+ 7 - 4
application/api/model/taxi/User.php

@@ -16,11 +16,14 @@ class User extends BaseModel
         if (isset($data['id_card_img']) && $data['id_card_img']) {
             $array = [];
             $idCardImg = json_decode($data['id_card_img'], true);
-            foreach ($idCardImg as $item) {
-                $array[] = [
-                    'url' => $item
-                ];
+            if($idCardImg){
+                foreach ($idCardImg as $item) {
+                    $array[] = [
+                        'url' => $item
+                    ];
+                }
             }
+
             return $array;
         }
         return [];