1、更新内核

2、修复模型bug
3、修复后台部分操作的bug
4、清除多余文件
This commit is contained in:
2016-07-07 08:58:01 +08:00
parent f3fff63632
commit 2d3e41037d
43 changed files with 499 additions and 752 deletions

View File

@@ -964,8 +964,7 @@ class Query
* fragment:url锚点,
* var_page:分页变量,
* list_rows:每页数量
* type:分页类名,
* namespace:分页类命名空间
* type:分页类名
* @return \think\paginator\Collection
* @throws DbException
*/
@@ -1717,8 +1716,8 @@ class Query
* @param array|string|Query|\Closure $data
* @return Collection|false|\PDOStatement|string
* @throws DbException
* @throws Exception
* @throws PDOException
* @throws ModelNotFoundException
* @throws DataNotFoundException
*/
public function select($data = null)
{
@@ -1789,11 +1788,7 @@ class Query
}
}
} elseif (!empty($options['fail'])) {
if (!empty($this->model)) {
throw new ModelNotFoundException('model data Not Found:' . $this->model, $this->model, $options);
} else {
throw new DataNotFoundException('table data not Found:' . $options['table'], $options['table'], $options);
}
$this->throwNotFound($options);
}
return $resultSet;
}
@@ -1804,8 +1799,8 @@ class Query
* @param array|string|Query|\Closure $data
* @return array|false|\PDOStatement|string|Model
* @throws DbException
* @throws Exception
* @throws PDOException
* @throws ModelNotFoundException
* @throws DataNotFoundException
*/
public function find($data = null)
{
@@ -1874,25 +1869,37 @@ class Query
}
}
} elseif (!empty($options['fail'])) {
if (!empty($this->model)) {
throw new ModelNotFoundException('model data Not Found:' . $this->model, $this->model, $options);
} else {
throw new DataNotFoundException('table data not Found:' . $options['table'], $options['table'], $options);
}
$this->throwNotFound($options);
} else {
$data = null;
}
return $data;
}
/**
* 查询失败 抛出异常
* @access public
* @param array $options 查询参数
* @throws ModelNotFoundException
* @throws DataNotFoundException
*/
protected function throwNotFound($options = [])
{
if (!empty($this->model)) {
throw new ModelNotFoundException('model data Not Found:' . $this->model, $this->model, $options);
} else {
throw new DataNotFoundException('table data not Found:' . $options['table'], $options['table'], $options);
}
}
/**
* 查找多条记录 如果不存在则抛出异常
* @access public
* @param array|string|Query|\Closure $data
* @return array|\PDOStatement|string|Model
* @throws DbException
* @throws Exception
* @throws PDOException
* @throws ModelNotFoundException
* @throws DataNotFoundException
*/
public function selectOrFail($data = null)
{
@@ -1905,8 +1912,8 @@ class Query
* @param array|string|Query|\Closure $data
* @return array|\PDOStatement|string|Model
* @throws DbException
* @throws Exception
* @throws PDOException
* @throws ModelNotFoundException
* @throws DataNotFoundException
*/
public function findOrFail($data = null)
{