API s cenikem je nyni komplexnejsi (a ma kratsi kod :-)
authorThomas Mudrunka <tomas@mudrunka.cz>
Thu, 1 Dec 2011 14:54:24 +0000 (15:54 +0100)
committerThomas Mudrunka <tomas@mudrunka.cz>
Thu, 1 Dec 2011 14:54:24 +0000 (15:54 +0100)
apis/price-list.inc.php

index cc80af20d9fc44597260c9a489a74ef9fa37b896..b0442e6607a8dee65c3c740b2a3c468fbc726ff8 100644 (file)
@@ -1,5 +1,6 @@
 <?php
-$sql = 'SELECT model_name,model_price_out FROM model WHERE model_price_out > 0 AND category_id > 0';
+$sql = 'SELECT model_name,model_price_out,producer_name'.
+       ' FROM model LEFT JOIN producer USING(producer_id)'.
+       ' WHERE model_price_out > 0 AND category_id > 0';
 $result = $this->db->safe_query_fetch($sql);
-foreach($result as $item) $items[$item['model_name']]=$item['model_price_out'];
-die(json_encode($items));
+die(json_encode($result));
This page took 0.108123 seconds and 4 git commands to generate.