- 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
public function selectItems( $id, $withStrictment = 'no' /* $withStrictment = no, retail, discount */ ) {
if( $withStrictment == 'discount' ) $onlyWithRetailPriceSql = " and items.articul in ( select articul from items_discount ) ";
if( $withStrictment == 'retail' ) $onlyWithRetailPriceSql = " and items.articul in ( select articul from retailPrice ) ";
$a = database::select(" SELECT items.* FROM items WHERE items.id = '$id' and items.deleted = 'no' ");
$a = $a[0];
$this->data = database::select("SELECT items.*,
IF(DATEDIFF(now(),created) <= 30, 'Новинка! ', '') as fresh,
( items.quantity - coalesce(view_pendeditemsquantity.sum,0) ) as quantity,
items_comments.comment as dopDescr, items_comments.comment as comment, items_discount.priceAsUSD as discountPrice,
items_packing.packing,
concat(items.name, ' - ', items.quantity) as name
FROM items
LEFT JOIN view_pendeditemsquantity ON items.articul = view_pendeditemsquantity.articul
LEFT JOIN items_comments ON items.articul = items_comments.articul
left join items_discount on items.articul = items_discount.articul
left join items_packing on items.articul = items_packing.articul
WHERE items.group_id in ( select articul from items where is_group = '1' and name = '{$a['name']}' and group_id = '' )
and items.deleted = 'no'
$onlyWithRetailPriceSql
order by items.quantity desc, items.name asc
");
}
sectus 30.11.2011 07:19 # +2
nethak 30.11.2011 08:44 # 0
Lure Of Chaos 30.11.2011 16:29 # 0
roman-kashitsyn 30.11.2011 16:34 # +2
> не пью
не верю
Lure Of Chaos 30.11.2011 16:42 # 0
bugmenot 30.11.2011 17:29 # +2
Lure Of Chaos 30.11.2011 17:31 # 0
Nemoden 01.12.2011 14:06 # +4
Lure Of Chaos 01.12.2011 21:53 # +3
guest8 09.04.2019 12:16 # −999