Changeset 628 for trunk/includes/global.php
- Timestamp:
- Dec 6, 2013, 7:07:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r621 r628 538 538 foreach($TablesColumn as $Table => $Column) 539 539 { 540 $sql = 'SELECT `ID`, `'.$Column.'` AS Orig, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '.540 $sql = 'SELECT `ID`, (SELECT CONCAT( \''.GetIDbyName($Table).'\' )) AS `GoupId`,`'.$Column.'` AS Orig, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '. 541 541 '(`O`.`Entry` = `T`.`Entry`) AND (`Language` <> '.$Config['OriginalLanguage'].') LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE '; 542 542 $groupby = ' GROUP BY `'.$Column.'` '; 543 // ORDER BY LENGTH('.$Column.') DESC543 $orderby = ' ORDER BY LENGTH(Orig) DESC '; 544 544 545 545 $where = '(`Language` = '.$Config['OriginalLanguage'].') '; … … 563 563 $where .= ')'; 564 564 } 565 if ($SqlOK) { 566 $DbResult = $System->Database->query($sql.$where.$groupby.' ORDER BY LENGTH(Orig) DESC'); 565 if ($SqlOK) { 566 //$sql.$where.$groupby.$orderby 567 // $buff[] = array($Line['ID'], GetIDbyName($Table), $Line['Orig'], $Line['Tran']); 568 if ($sqlall <> '') { $sqlall .= ' UNION ALL ( '.$sql.$where.$groupby.' )';} 569 else {$sqlall .= ' ( '.$sql.$where.$groupby.' )'; } 570 } 571 572 } 573 $DbResult = $System->Database->query($sqlall.$orderby); 567 574 // echo ($sql.'|'.$where.'|'.$groupby); 568 575 while($Line = $DbResult->fetch_assoc()) 569 576 { 570 $buff[] = array($Line['ID'], GetIDbyName($Table), $Line['Orig'], $Line['Tran']);577 $buff[] = array($Line['ID'], $Line['GoupId'], $Line['Orig'], $Line['Tran']); 571 578 } 572 } 573 574 // if ($sqlall <> '') { $sqlall .= ' UNION ALL ( '.$sql.$where.$groupby.' )';} 575 // else {$sqlall .= ' ( '.$sql.$where.$groupby.' )'; } 576 } 579 577 580 return $buff; 578 581 }
Note:
See TracChangeset
for help on using the changeset viewer.