fixed log_last_modified trigger and getlogs sql

This commit is contained in:
following
2013-04-30 15:57:39 +02:00
parent 40488ad754
commit 13c5df34e0
2 changed files with 4 additions and 1 deletions

View File

@ -915,6 +915,9 @@
IF NEW.`picture`!=OLD.`picture` THEN
SET NEW.`log_last_modified`=NOW();
END IF;
IF NEW.`last_modified` > NEW.`log_last_modified` THEN
SET NEW.`log_last_modified`=NEW.`last_modified`;
END IF;
END IF;
END;");

View File

@ -323,7 +323,7 @@ class cache
INNER JOIN `user` ON `user`.`user_id` = `cache_logs`.`user_id`
LEFT JOIN `cache_rating` ON `cache_logs`.`cache_id`=`cache_rating`.`cache_id` AND `cache_logs`.`user_id`=`cache_rating`.`user_id`
".$addjoin."
WHERE `cache_logs`.`cache_id`='&1'".$addwhere."
WHERE `cache_logs`.`cache_id`='&1'
ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`Id` DESC LIMIT &2, &3", $cacheid, $start+0, $count+0);
$logs = array();