Changeset 2028 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases
- Timestamp:
- 05/09/17 15:13:29 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r1992 r2028 1300 1300 my $self = $attr->object; 1301 1301 1302 my $now = DateTime->now()->iso8610 . 'Z'; 1303 1302 1304 my $sth = $self->base->db->prepare_cached( 1303 1305 q{ 1304 select name from employment where firstday <= now()and1305 (lastday is null or lastday >= now()- '1 days'::interval) and "user" = ?1306 select name from employment where firstday <= ?::timestamp and 1307 (lastday is null or lastday >= ?::timestamp - '1 days'::interval) and "user" = ? 1306 1308 limit 1 1307 1309 } 1308 1310 ); 1309 $sth->execute($ self->id);1311 $sth->execute($now, $now, $self->id); 1310 1312 my $res = $sth->fetchrow_hashref; 1311 1313 $sth->finish; … … 1325 1327 my $self = $attr->object; 1326 1328 1329 my $now = DateTime->now()->iso8610 . 'Z'; 1330 1327 1331 my $sth = $self->base->db->prepare_cached( 1328 1332 q{ 1329 select name from employment where firstday > now()and "user" = ?1333 select name from employment where firstday > ? and "user" = ? 1330 1334 order by firstday asc 1331 1335 limit 1 1332 1336 } 1333 1337 ); 1334 $sth->execute($ self->id);1338 $sth->execute($now, $self->id); 1335 1339 my $res = $sth->fetchrow_hashref; 1336 1340 $sth->finish; … … 1350 1354 my $self = $attr->object; 1351 1355 1356 my $now = DateTime->now()->iso8610 . 'Z'; 1357 1352 1358 my $sth = $self->base->db->prepare_cached( 1353 1359 q{ 1354 1360 select name from employment where 1355 (lastday is not null and lastday <= now()- '1 days'::interval) and "user" = ?1361 (lastday is not null and lastday <= ? - '1 days'::interval) and "user" = ? 1356 1362 order by firstday desc 1357 1363 limit 1 1358 1364 } 1359 1365 ); 1360 $sth->execute($ self->id);1366 $sth->execute($now, $self->id); 1361 1367 my $res = $sth->fetchrow_hashref; 1362 1368 $sth->finish;
Note: See TracChangeset
for help on using the changeset viewer.