diff --git a/ground/classes/Model.php b/ground/classes/Model.php index 56683e7..c603017 100644 --- a/ground/classes/Model.php +++ b/ground/classes/Model.php @@ -154,7 +154,6 @@ abstract class Model $sql .= isset($params['where'])&&$params['where'] ? ' WHERE ' . $params['where'] : ''; $sql .= isset($params['order'])&&$params['order'] ? ' ORDER BY ' . $params['order'] : ''; $sql .= isset($params['limit'])&&$params['limit'] ? ' LIMIT ' . $params['limit'] : ''; - $res = App::DB()->query($sql); $ready = array(); @@ -176,12 +175,10 @@ abstract class Model */ function getOne($whereField, $whereValue) { - return array_shift( - $this->getAll(array( + return $this->getAll(array( 'where' => '`' . $whereField . '` = "' . $whereValue . '"', 'limit' => 1 - )) - ); + )); } /** diff --git a/ground/controllers/IndexController.php b/ground/controllers/IndexController.php index e95558f..f7dfaa1 100644 --- a/ground/controllers/IndexController.php +++ b/ground/controllers/IndexController.php @@ -117,7 +117,6 @@ class IndexController extends Controller { $source = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']); $uLoginUser = json_decode($source, true); - //var_dump($uLoginUser);die; $uLoginUser['identity'] = md5($uLoginUser['uid'] . $uLoginUser['network'] . '=P'); $user = User::model()->getByUID($uLoginUser['identity']); diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index fee7284..f94ca35 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -13,6 +13,7 @@
+ @@ -63,6 +64,18 @@ +