From 5a72fcb503e521254d1c80317d7904bf39a889f8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 15 Feb 2017 10:05:43 +0800 Subject: [PATCH] * adjust for safe. --- module/bug/model.php | 2 +- module/task/model.php | 2 +- module/user/model.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 47f59d84b0..3e25bb1d8b 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1100,7 +1100,7 @@ class bugModel extends model if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->beginIF($type != 'all')->andWhere("$type")->eq($account)->fi() + ->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) diff --git a/module/task/model.php b/module/task/model.php index bc26fdf53c..adb278ee33 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -945,7 +945,7 @@ class taskModel extends model ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->leftjoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id') ->where('t1.deleted')->eq(0) - ->beginIF($type != 'all')->andWhere("t1.$type")->eq($account)->fi() + ->beginIF($type != 'all')->andWhere("t1.`$type`")->eq($account)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) diff --git a/module/user/model.php b/module/user/model.php index 234d985882..dcf336c640 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -173,7 +173,7 @@ class userModel extends model */ public function getById($userID, $field = 'account') { - $user = $this->dao->select('*')->from(TABLE_USER)->where($field)->eq($userID)->fetch(); + $user = $this->dao->select('*')->from(TABLE_USER)->where("`$field`")->eq($userID)->fetch(); if(!$user) return false; $user->last = date(DT_DATETIME1, $user->last); return $user;