正在显示
1 个修改的文件
包含
9 行增加
和
4 行删除
@@ -127,11 +127,16 @@ class LeaveController extends RestBaseController | @@ -127,11 +127,16 @@ class LeaveController extends RestBaseController | ||
127 | */ | 127 | */ |
128 | public function getUnread() { | 128 | public function getUnread() { |
129 | $condition['parent_id'] = 0; | 129 | $condition['parent_id'] = 0; |
130 | - $condition['is_read'] = 0; | ||
131 | $condition['to_uid|from_uid'] = $this->userId; | 130 | $condition['to_uid|from_uid'] = $this->userId; |
132 | - $result = Db::name('leave')->where($condition)->field('is_read')->find(); | ||
133 | - if($result) { | ||
134 | - $is_unread = 1; | 131 | + $check = Db::name('leave')->where($condition)->field('is_read')->find(); |
132 | + if($check) { | ||
133 | + $condition['is_read'] = 0; | ||
134 | + $result = Db::name('leave')->where($condition)->field('is_read')->find(); | ||
135 | + if($result) { | ||
136 | + $is_unread = 1; | ||
137 | + } else { | ||
138 | + $is_unread = 0; | ||
139 | + } | ||
135 | } else { | 140 | } else { |
136 | $is_unread = 0; | 141 | $is_unread = 0; |
137 | } | 142 | } |
-
请 注册 或 登录 后发表评论