Revision 0d3d9d8e
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
2035 | 2035 |
} |
2036 | 2036 |
|
2037 | 2037 |
my $query = |
2038 |
qq|SELECT |
|
2038 |
qq|SELECT |
|
2039 |
0 as pricegroup_id, |
|
2040 |
sellprice AS default_sellprice, |
|
2041 |
'' AS pricegroup, |
|
2042 |
sellprice AS price, |
|
2043 |
'selected' AS selected |
|
2044 |
FROM parts |
|
2045 |
WHERE id = ? |
|
2046 |
UNION ALL |
|
2047 |
SELECT |
|
2039 | 2048 |
pricegroup_id, |
2040 |
(SELECT p.sellprice FROM parts p WHERE p.id = ?) AS default_sellprice,
|
|
2041 |
(SELECT pg.pricegroup FROM pricegroup pg WHERE id = pricegroup_id) AS pricegroup,
|
|
2049 |
parts.sellprice AS default_sellprice,
|
|
2050 |
pricegroup.pricegroup,
|
|
2042 | 2051 |
price, |
2043 | 2052 |
'' AS selected |
2044 | 2053 |
FROM prices |
2054 |
LEFT JOIN parts ON parts.id = parts_id |
|
2055 |
LEFT JOIN pricegroup ON pricegroup.id = pricegroup_id |
|
2045 | 2056 |
WHERE parts_id = ? |
2046 |
|
|
2047 |
UNION |
|
2048 |
|
|
2049 |
SELECT |
|
2050 |
0 as pricegroup_id, |
|
2051 |
(SELECT sellprice FROM parts WHERE id = ?) AS default_sellprice, |
|
2052 |
'' AS pricegroup, |
|
2053 |
(SELECT DISTINCT sellprice FROM parts where id = ?) AS price, |
|
2054 |
'selected' AS selected |
|
2055 |
FROM prices |
|
2056 |
|
|
2057 | 2057 |
ORDER BY pricegroup|; |
2058 |
my @values = (conv_i($id), conv_i($id), conv_i($id), conv_i($id));
|
|
2058 |
my @values = (conv_i($id), conv_i($id)); |
|
2059 | 2059 |
my $pkq = prepare_execute_query($form, $dbh, $query, @values); |
2060 | 2060 |
|
2061 | 2061 |
while (my $pkr = $pkq->fetchrow_hashref('NAME_lc')) { |
Auch abrufbar als: Unified diff
Ein Query in IS->pricegroup_for_part aufgeräumt.