- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
$query = "
SELECT `ord`.*,`cus`.`existing_phone_number`,`cus`.`nova_jednotka`,
`cus`.`order_phone`,`cus`.`custom_delivery_date`, `cus`.`delivery_address`,
`cus`.`invoice_address`, `cus`.`invoice_street`, `cus`.`invoice_street_number`,
`cus`.`invoice_city`, `cus`.`invoice_zip`
FROM ".(!empty($_GET["copy_view"]) && $_GET["copy_view"] == 1 ? "`orders`" : "`".$this->table."`")." AS `ord`,
`products`, `navigace`, `customers` AS `cus`
WHERE `ord`.`order_id` = ".$order_id."
AND `ord`.`id_produktu_db` = `products`.`id`
AND `products`.`navigace_polozka_id` = `navigace`.`id`
AND `cus`.`id` = `ord`.`customers_id`
union all
select
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null,
'', tp.description, tp.product_id, tp.activation_price, tp.activation_price_EUR,
0, tor.pocet_kusu, tp.name, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null
from tarifs_prop tp
inner join tarifs_orders tor on tp.id = tor.tarif_prop_id
where tor.order_id = ".$order_id."
union all
select
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, '', b.description, b.product_id, b.activation_price, b.activation_price_EUR,
0, tor.pocet_kusu, b.name, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null,
null, null, null, null, null, null
from balicky b
inner join tarifs_orders tor on b.id = tor.tarif_balicek_id
where tor.order_id = ".$order_id."
ORDER BY `user_id` desc";
а филе нам кабанам, надо продукты из разных таблиц объединить в одну, ну и фто што таблицы разного размера. Зато когда добавляешь новый столбец в таблицу, нужно вручную считать сколько раз нужно добавить null :D
ArtFeel 29.11.2011 14:39 # 0
guest 29.11.2011 15:39 # −1
Lure Of Chaos 29.11.2011 16:09 # 0
eth0 29.11.2011 19:02 # +2
guest 29.11.2011 19:15 # −4
roman-kashitsyn 30.11.2011 08:59 # 0
bugmenot 30.11.2011 13:36 # 0
roman-kashitsyn 30.11.2011 13:43 # +1
defecate-plusplus 29.11.2011 20:13 # 0
после пары литров пива и фернета не такое удумают
nethak 30.11.2011 08:48 # 0
Nemoden 01.12.2011 14:19 # 0
guest8 09.04.2019 12:15 # −999