- $inbox = new Notice_inbox();
-
- $inbox->user_id = $user_id;
-
- if ($since_id != 0) {
- $inbox->whereAdd('notice_id > ' . $since_id);
- }
-
- if ($before_id != 0) {
- $inbox->whereAdd('notice_id < ' . $before_id);
- }
-
- if (!is_null($since)) {
- $inbox->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
- }
-
- $inbox->orderBy('notice_id DESC');