Persist specialstate.
This commit is contained in:
parent
87163f5d0f
commit
81a937d90a
2 changed files with 35 additions and 0 deletions
|
|
@ -22,6 +22,17 @@ sub addSpecialState {
|
|||
my $self = shift;
|
||||
my $state = shift || croak 'state is required';
|
||||
my $id = shift;
|
||||
my $db = $self->session->db;
|
||||
|
||||
$db->write( 'delete from users_specialState where userId=? and specialState=?', [
|
||||
$self->getId,
|
||||
$state,
|
||||
] );
|
||||
|
||||
$db->write( 'insert into users_specialState (userId, specialState) values (?,?)', [
|
||||
$self->getId,
|
||||
$state,
|
||||
] );
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -40,7 +51,13 @@ sub removeSpecialState {
|
|||
my $self = shift;
|
||||
my $state = shift || croak 'state is required';
|
||||
my $id = shift;
|
||||
my $db = $self->session->db;
|
||||
|
||||
$db->write( 'delete from users_specialState where userId=? and specialState=?', [
|
||||
$self->getId,
|
||||
$state,
|
||||
] );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue