Changeset 2448
- Timestamp:
- 11/05/20 15:19:17 (4 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Userstatus.pm
r1520 r2448 20 20 21 21 sub list { 22 my ($class, $base ) = @_;22 my ($class, $base, $Real) = @_; 23 23 24 24 my $sth = $base->db->prepare_cached( … … 27 27 join "user" on %s."user" = "user".name 28 28 where (%s.lastday is null or %s.lastday >= now() - '1 days'::interval) 29 %s %s 29 %s %s %s 30 30 order by %s.%s 31 31 }, … … 36 36 $base->db->quote_identifier($class->_object_table), 37 37 $base->db->quote_identifier($class->_object_table), 38 ($Real ? 'and oalias IS NULL' : ''), 38 39 ($base->{wexported} ? '' : 'and "user".exported = true'), 39 40 ($base->{wexported} ? '' : 'and ' . -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r2445 r2448 28 28 my ($class, $base) = @_; 29 29 30 $class->list( $base, 'True' ); 31 } 32 33 sub list { 34 my ($class, $base, $Real) = @_; 35 30 36 my $sth = $base->db->prepare_cached( 31 37 sprintf( 32 q{select %s as k from %s where internobject = false 33 and oalias IS NULL %s order by %s}, 38 q{select %s as k from %s where internobject = false %s %s order by %s}, 34 39 $base->db->quote_identifier($class->_key_field), 35 40 $base->db->quote_identifier($class->_object_table), 36 41 ($base->{wexported} ? '' : 'and exported = true'), 37 $base->db->quote_identifier($class->_key_field), 38 ) 39 ); 40 $sth->execute; 41 my @keys; 42 while(my $res = $sth->fetchrow_hashref) { 43 push(@keys, $res->{k}); 44 } 45 @keys 46 } 47 48 sub list { 49 my ($class, $base) = @_; 50 51 my $sth = $base->db->prepare_cached( 52 sprintf( 53 q{select %s as k from %s where internobject = false %s order by %s}, 54 $base->db->quote_identifier($class->_key_field), 55 $base->db->quote_identifier($class->_object_table), 56 ($base->{wexported} ? '' : 'and exported = true'), 42 ($Real ? 'and oalias IS NULL' : ''), 57 43 $base->db->quote_identifier($class->_key_field), 58 44 )
Note: See TracChangeset
for help on using the changeset viewer.