where('status', 1) ->order('sort', 'asc') ->order('id', 'asc') ->select() ->toArray(); $list = []; foreach ($rows as $r) { $list[] = [ 'id' => (int) $r['id'], 'name' => $r['name'], 'lat' => (float) $r['lat'], 'lng' => (float) $r['lng'], 'photos' => (int) $r['photos_count'], 'thumbnail' => $r['thumbnail'], 'description' => $r['description'], 'pinLeftPct' => (float) $r['pin_left_pct'], 'pinTopPct' => (float) $r['pin_top_pct'], ]; } return json(['code' => 0, 'msg' => 'ok', 'data' => ['list' => $list]]); } }