Changeset 1776 for trunk/LATMOS-Accounts
- Timestamp:
- 05/31/16 09:34:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r1764 r1776 786 786 push(@{$attrbind{$attr}}, $mode eq '~' ? '%' . $val . '%' : $val) unless($mode eq '=' && ($val eq '*' || $val eq 'NULL')); 787 787 } else { 788 $sql = sprintf( 789 q{select okey from %s where attr = ? %s}, 790 $base->db->quote_identifier( 791 $class->_object_table . '_attributes' 792 ), 793 $val eq '*' 794 ? '' 795 : $mode eq '~' 796 ? q{and value::text ILIKE ?} 797 : qq{and value $mode ?} 798 799 ); 800 push(@{$attrbind{$attr}}, $attribute->iname); 801 push(@{$attrbind{$attr}}, $mode eq '~' ? '%' . $val . '%' : $val) unless($val eq '*'); 788 if ($mode eq '=' && $val eq 'NULL') { 789 $sql = sprintf(q{ select ikey from %s where ikey 790 not in (select okey from %s where attr = ? and value is not NULL) }, 791 $base->db->quote_identifier($class->_object_table), 792 $base->db->quote_identifier( 793 $class->_object_table . '_attributes' 794 ), 795 ); 796 push(@{$attrbind{$attr}}, $attribute->iname); 797 } else { 798 $sql = sprintf( 799 q{select okey from %s where attr = ? %s}, 800 $base->db->quote_identifier( 801 $class->_object_table . '_attributes' 802 ), 803 $val eq '*' 804 ? '' 805 : $mode eq '~' 806 ? q{and value::text ILIKE ?} 807 : qq{and value $mode ?} 808 809 ); 810 push(@{$attrbind{$attr}}, $attribute->iname); 811 push(@{$attrbind{$attr}}, $mode eq '~' ? '%' . $val . '%' : $val) unless($val eq '*'); 812 } 802 813 } 803 814
Note: See TracChangeset
for help on using the changeset viewer.