Skip to content

Commit

Permalink
shpala
Browse files Browse the repository at this point in the history
  • Loading branch information
127 committed Dec 4, 2018
1 parent 5be46bc commit e904e23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/shpala/base_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ class BaseController {

public $_db;
public $view; //= (object)[]; //view vars
public $params=null;

public function __construct(&$db, &$params=null) {
public function __construct(&$db) {
$this->view = [];
$this->_db = $db;
$this->params = $params;
$this->call_init();
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/shpala/base_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function count($where=false){
}

public function find(int $id, $where=false){
return $this->_db->query('SELECT * FROM '.$this->table.' WHERE id='.$id.' '.$where)->fetch();
return $this->_db->query('SELECT * FROM '.$this->table.' WHERE id='.$id.' '.$where)->fetchAll();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/shpala/resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function build(){
BaseJob::$_db_di = $this->connect;
new Queue();
//=========APP============//
$this->controller = new $this->_router->controllerClass($this->connect, $this->_router->params);
$this->controller = new $this->_router->controllerClass($this->connect);

}

Expand Down

0 comments on commit e904e23

Please sign in to comment.