Avoid useless SQL query when viewing item
This commit is contained in:
parent
e4c4240317
commit
f80878422d
@ -40,8 +40,10 @@ Router\get_action('show', function () {
|
|||||||
$feed = Model\Feed\get_feed($user_id, $item['feed_id']);
|
$feed = Model\Feed\get_feed($user_id, $item['feed_id']);
|
||||||
$group_id = Request\int_param('group_id', null);
|
$group_id = Request\int_param('group_id', null);
|
||||||
|
|
||||||
|
if ($item['status'] !== Model\Item\STATUS_READ) {
|
||||||
Model\Item\change_item_status($user_id, $item_id, Model\Item\STATUS_READ);
|
Model\Item\change_item_status($user_id, $item_id, Model\Item\STATUS_READ);
|
||||||
$item['status'] = 'read';
|
$item['status'] = Model\Item\STATUS_READ;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($menu) {
|
switch ($menu) {
|
||||||
case 'unread':
|
case 'unread':
|
||||||
|
Loading…
Reference in New Issue
Block a user