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

红点漏洞修复

... ... @@ -127,11 +127,16 @@ class LeaveController extends RestBaseController
*/
public function getUnread() {
$condition['parent_id'] = 0;
$condition['is_read'] = 0;
$condition['to_uid|from_uid'] = $this->userId;
$result = Db::name('leave')->where($condition)->field('is_read')->find();
if($result) {
$is_unread = 1;
$check = Db::name('leave')->where($condition)->field('is_read')->find();
if($check) {
$condition['is_read'] = 0;
$result = Db::name('leave')->where($condition)->field('is_read')->find();
if($result) {
$is_unread = 1;
} else {
$is_unread = 0;
}
} else {
$is_unread = 0;
}
... ...