Ignore:
Timestamp:
Feb 4, 2016, 3:42:03 PM (9 years ago)
Author:
chronos
Message:
  • Modified: In module IS use slow HAVING in SQL query for user filter. To show subtables use faster WHERE.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/IS/IS.php

    r774 r795  
    414414      else $SourceTable = '`'.$FormClass['Table'].'` AS `TX`';
    415415
     416    $WhereFilter = $Filter;
     417    $HavingFilter = '';
     418
    416419    // Build form type filter
    417420    $TypeFilter = '';
     
    427430    if($TypeFilter != '')
    428431    {
    429       if($Filter != '') $Filter = ' AND';
    430       $Filter .= ' '.$TypeFilter;
     432      if($HavingFilter != '') $HavingFilter = ' AND';
     433      $HavingFilter .= ' '.$TypeFilter;
    431434    }
    432435
     
    465468    if($UserFilter != '')
    466469    {
    467       if($Filter != '') $Filter .= ' AND';
    468       $Filter .= ' '.$UserFilter;
    469     }
    470     if($Filter != '') $Filter = ' HAVING '.$Filter;
     470      if($HavingFilter != '') $Havingilter .= ' AND';
     471      $HavingFilter .= ' '.$UserFilter;
     472    }
     473    if($WhereFilter != '') $Filter = ' WHERE '.$WhereFilter;
     474    if($HavingFilter != '') $Filter = ' HAVING '.$HavingFilter;
     475
    471476
    472477    foreach($FormClass['Items'] as $ItemIndex => $FormItem)
Note: See TracChangeset for help on using the changeset viewer.