|
|
@ -125,10 +125,10 @@ sub register { |
|
|
|
my ($c, $pid, $cm) = @_; |
|
|
|
my ($c, $pid, $cm) = @_; |
|
|
|
my $table = 'comments'; |
|
|
|
my $table = 'comments'; |
|
|
|
$c->app->db->begin; |
|
|
|
$c->app->db->begin; |
|
|
|
my $seq = $c->app->db->select($table, 'max(seq)', {pid => $pid})->list; |
|
|
|
my $seq = $c->app->db->select($table, 'max(seq)', {pid => $pid})->list || 0; |
|
|
|
$c->app->db->insert($table, { |
|
|
|
$c->app->db->insert($table, { |
|
|
|
pid => $pid, |
|
|
|
pid => $pid, |
|
|
|
seq => $seq, |
|
|
|
seq => $seq + 1, |
|
|
|
date => time(), |
|
|
|
date => time(), |
|
|
|
name => $cm->{name}, |
|
|
|
name => $cm->{name}, |
|
|
|
reply => $cm->{reply}, |
|
|
|
reply => $cm->{reply}, |
|
|
|