Changeset 238
- Timestamp:
- 12/30/10 18:02:30 (13 years ago)
- Location:
- server/trunk/web/lib/Sophie/Controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat.pm
r191 r238 49 49 } 50 50 } 51 52 53 sub update_statistic : Private { 54 my ($self, $c, $cmd) = @_; 55 56 $c->model('Base::ChatStat')->search( 57 { 58 -nest => \[ 59 "day < now() - ?::interval", 60 [ plain_text => "365 days" ], 61 ], 62 } 63 )->delete; 64 my $stat = $c->model('Base::ChatStat')->find_or_create({ 65 cmd => $cmd, 66 day => 'now()', 67 }); 68 $stat->update({ count => ($stat->count || 0) + 1 }); 69 $c->model('Base')->storage->dbh->commit; 70 } 71 51 72 52 73 sub message : XMLRPC { -
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r237 r238 29 29 sub end : Private { 30 30 my ($self, $c ) = @_; 31 32 $c->forward('/chat/update_statistic', [ ($c->action =~ /([^\/]+)$/)[0] ]); 33 31 34 my $reqspec = $c->req->arguments->[0]; 32 35 $reqspec->{max_line} ||= 4;
Note: See TracChangeset
for help on using the changeset viewer.