CMXX - First candidate
This commit is contained in:
@@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el
|
||||
//default whereclause
|
||||
$whereclause = '';
|
||||
|
||||
list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get');
|
||||
list($whereclause,$condition) = getWhereclauselvl2('transactions',$permission,$partner,'get');
|
||||
|
||||
//NEW ARRAY
|
||||
$criterias = [];
|
||||
@@ -37,6 +37,9 @@ if(isset($get_content) && $get_content!=''){
|
||||
//build up search
|
||||
$clause .= ' AND name like :'.$v[0];
|
||||
}
|
||||
elseif (($v[0] == 'account_id')){//create clause
|
||||
$clause .= ' AND tx.'.$v[0].' = :'.$v[0];
|
||||
}
|
||||
else {//create clause
|
||||
$clause .= ' AND tai.'.$v[0].' = :'.$v[0];
|
||||
}
|
||||
@@ -55,7 +58,8 @@ if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||
}
|
||||
else {
|
||||
//SQL for Paging
|
||||
$sql = 'SELECT ta.*, tai.* FROM transactions ta left join transactions_items tai ON ta.id = tai.txn_id '.$whereclause;
|
||||
//$sql = 'SELECT ta.*, tai.* FROM transactions ta left join transactions_items tai ON ta.id = tai.txn_id '.$whereclause;
|
||||
$sql ='SELECT tx.*, tai.*, p.productname as item_name, m.full_path FROM transactions tx left join transactions_items tai ON tx.id = tai.txn_id LEFT JOIN media m ON tai.item_id = m.rowID LEFT JOIN products p ON tai.item_id = p.rowID '.$whereclause;
|
||||
}
|
||||
$stmt = $pdo->prepare($sql);
|
||||
|
||||
@@ -94,6 +98,7 @@ else {
|
||||
$stmt->execute();
|
||||
//Get results
|
||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$messages = transformOrders($messages);
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user