Changeset 2156 for trunk/LATMOS-Accounts/lib/LATMOS
- Timestamp:
- 11/30/18 23:21:16 (6 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r2041 r2156 105 105 106 106 sub config { 107 my ($self, $opt ) = @_;108 return $self->{_options}{$opt};107 my ($self, $opt, $default) = @_; 108 return defined($self->{_options}{$opt}) ? $self->{_options}{$opt} : $default; 109 109 } 110 110 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r2155 r2156 964 964 my $sth = $obj->db->prepare_cached( 965 965 sprintf( 966 q{select extract(epoch from COALESCE(endcircuit, expire)) + 11644474161 as expire966 q{select extract(epoch from %s) + 11644474161 as expire 967 967 from %s where %s = ?}, 968 $base->config('endCircuitdontExpire') ? 'expire' : 'COALESCE(endcircuit, expire)', 968 969 $obj->db->quote_identifier($obj->_object_table), 969 970 $obj->db->quote_identifier($obj->_key_field), … … 984 985 my $sth = $obj->db->prepare_cached( 985 986 sprintf( 986 q{select justify_hours( COALESCE(endcircuit, expire)- '1/1/1970'::timestamp) as expire987 q{select justify_hours(%s - '1/1/1970'::timestamp) as expire 987 988 from %s where %s = ?}, 989 $base->config('endCircuitdontExpire') ? 'expire' : 'COALESCE(endcircuit, expire)', 988 990 $obj->db->quote_identifier($obj->_object_table), 989 991 $obj->db->quote_identifier($obj->_key_field), … … 1122 1124 my $sth = $obj->db->prepare_cached( 1123 1125 sprintf( 1124 q{select to_char( COALESCE(endcircuit, expire), 'YYYY/MM/DD') as expire1126 q{select to_char(%s, 'YYYY/MM/DD') as expire 1125 1127 from %s where %s = ?}, 1128 $base->config('endCircuitdontExpire') ? 'expire' : 'COALESCE(endcircuit, expire)', 1126 1129 $obj->db->quote_identifier($obj->_object_table), 1127 1130 $obj->db->quote_identifier($obj->_key_field), … … 1207 1210 my $sth = $obj->db->prepare_cached( 1208 1211 sprintf( 1209 q{select to_char( COALESCE(endcircuit, expire)AT TIME ZONE 'Z', 'YYYYMMDDHH24MISSZ') as expire1212 q{select to_char(%s AT TIME ZONE 'Z', 'YYYYMMDDHH24MISSZ') as expire 1210 1213 from %s where %s = ? and expire < now()}, 1214 $base->config('endCircuitdontExpire') ? 'expire' : 'COALESCE(endcircuit, expire)', 1211 1215 $obj->db->quote_identifier($obj->_object_table), 1212 1216 $obj->db->quote_identifier($obj->_key_field),
Note: See TracChangeset
for help on using the changeset viewer.