Commit | Line | Data |
---|---|---|
049a7400 TM |
1 | <?php |
2 | $queries += array( | |
bfb8a227 TM |
3 | "Nakoupit: Došlo úplně (Urgent WishList)" |
4 | => 'SELECT model_id,model_name,model_barcode,model_reserve,model_reserve as item_quantity_to_buy'. | |
5 | ' FROM model'. | |
6 | ' WHERE model_reserve>0 AND NOT EXISTS'. | |
4da324b2 | 7 | ' (SELECT item_id FROM item WHERE model.model_id=item.model_id AND status_id=1 AND item_quantity>0 AND item_valid_till=0)', |
bfb8a227 | 8 | "Nakoupit: Dochází (WishList)" |
efb88362 | 9 | => 'SELECT model_id,model_name,model_barcode,model_reserve,'. |
049a7400 | 10 | ' COUNT(item_id),SUM(item_quantity),model_reserve-SUM(item_quantity) as item_quantity_to_buy'. |
efb88362 | 11 | ' FROM item LEFT JOIN model USING(model_id)'. |
049a7400 | 12 | ' WHERE item_valid_till=0 AND status_id=1'. |
efb88362 | 13 | ' GROUP BY model_id'. |
049a7400 | 14 | ' HAVING SUM(item_quantity)<model_reserve'. |
efb88362 | 15 | ' ORDER BY model_id;', |
049a7400 | 16 | ); |