作者 lishaoshuai
1 个管道 的构建 通过 耗费 0 秒

红点漏洞修复

@@ -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 }