CMXX - First candidate
This commit is contained in:
@@ -90,7 +90,9 @@ elseif (isset($criterias['list']) && $criterias['list'] =='price'){
|
||||
$whereclause_2 = 'WHERE pat.item_status = 1';
|
||||
} else {
|
||||
$whereclause_1 = $whereclause .' AND p.salesflag = 1 AND p.status = 1 ';
|
||||
$whereclause_2 = $whereclause .' AND pat.item_status = 1';
|
||||
|
||||
list($whereclause_alt,$condition_alt) = getWhereclause('products_attributes_items',$permission,$partner,'get');
|
||||
$whereclause_2 = $whereclause_alt .' AND pat.item_status = 1';
|
||||
}
|
||||
|
||||
//GET ALL PRODUCTS AND PRODUCT ATTRIBUTES FOR PRICING
|
||||
@@ -104,11 +106,14 @@ elseif (isset($criterias['list']) && $criterias['list'] =='config'){
|
||||
$whereclause_2 = 'WHERE pag.group_status = 1';
|
||||
} else {
|
||||
$whereclause_1 = $whereclause .' AND p.salesflag = 1 AND p.status = 1 AND p.configurable = 0 ';
|
||||
$whereclause_2 = $whereclause .' AND pag.group_status = 1';
|
||||
|
||||
list($whereclause_alt2,$condition_alt2) = getWhereclause('products_attributes_groups',$permission,$partner,'get');
|
||||
|
||||
$whereclause_2 = $whereclause_alt2 .' AND pag.group_status = 1';
|
||||
}
|
||||
|
||||
//GET ALL PRODUCTS AND PRODUCT ATTRIBUTES FOR PRICING
|
||||
$sql = '(SELECT p.rowID as product_id, p.productname as product_name FROM products p '.$whereclause_1.' ) UNION (SELECT pag.group_id as product_id, pag.group_name as product_name FROM products_attributes_groups pag '.$whereclause_2.' )';
|
||||
$sql = '(SELECT p.rowID as product_id, p.productname as product_name FROM products p '.$whereclause_1.' ) UNION (SELECT pag.group_id as product_id, CONCAT(pag.group_name, " (", pag.group_name_internal,")") as product_name FROM products_attributes_groups pag '.$whereclause_2.' )';
|
||||
}
|
||||
else {
|
||||
//SQL for Paging
|
||||
@@ -121,6 +126,12 @@ $stmt = $pdo->prepare($sql);
|
||||
if (str_contains($whereclause, ':condition')){
|
||||
$stmt->bindValue('condition', $condition, PDO::PARAM_STR);
|
||||
}
|
||||
if (str_contains($whereclause_alt, ':condition')){
|
||||
$stmt->bindValue('condition', $condition_alt, PDO::PARAM_STR);
|
||||
}
|
||||
if (str_contains($whereclause_alt2, ':condition')){
|
||||
$stmt->bindValue('condition', $condition_alt2, PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
if (!empty($criterias)){
|
||||
foreach ($criterias as $key => $value){
|
||||
|
||||
Reference in New Issue
Block a user