zhangchangchun 5 年之前
父節點
當前提交
5e142ba22c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Transformers/ShopsTransformer.php

+ 2 - 2
app/Transformers/ShopsTransformer.php

@@ -34,12 +34,12 @@ class ShopsTransformer extends  TransformerAbstract{
             'license_img'    => $shop['license_img'],
             'food_trans_license'    => $shop['food_trans_license'],
             'other_license'    => $shop['other_license'],
-            'proportion'    => $shop['proportion'],
+            'proportion'    => floatval($shop['proportion']),
             'verify_type'    => $shop['verify_type'],
             'star'    => $shop['star'],
             'created_at' => Carbon::parse($shop['created_at'])->format('Y-m-d H:i:s'),
             'updated_at' => Carbon::parse($shop['updated_at'])->format('Y-m-d H:i:s'),
-            'shop_account' => $shop->account->toArray(),
+            'shop_account' => !empty($shop->account) ? $shop->account->toArray() : "",
         ];
     }
 }