diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index ef856f0..82373ad 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -36,7 +36,7 @@ class Article extends BaseController $param = get_params(); $where = []; if (!empty($param['keywords'])) { - $where[] = ['a.id|a.title|a.keywords|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%']; + $where[] = ['a.id|a.title|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%']; } if (!empty($param['cate_id'])) { $where[] = ['a.cate_id', '=', $param['cate_id']]; diff --git a/app/admin/controller/Gallery.php b/app/admin/controller/Gallery.php index 7fe5a39..e708acd 100644 --- a/app/admin/controller/Gallery.php +++ b/app/admin/controller/Gallery.php @@ -36,7 +36,7 @@ class Gallery extends BaseController $param = get_params(); $where = []; if (!empty($param['keywords'])) { - $where[] = ['a.id|a.title|a.keywords|a.desc|c.title', 'like', '%' . $param['keywords'] . '%']; + $where[] = ['a.id|a.title|a.desc|c.title', 'like', '%' . $param['keywords'] . '%']; } if (!empty($param['cate_id'])) { $where[] = ['a.cate_id', '=', $param['cate_id']]; diff --git a/app/admin/controller/Goods.php b/app/admin/controller/Goods.php index cd880f9..6f1aa06 100644 --- a/app/admin/controller/Goods.php +++ b/app/admin/controller/Goods.php @@ -36,7 +36,7 @@ class Goods extends BaseController $param = get_params(); $where = []; if (!empty($param['keywords'])) { - $where[] = ['a.id|a.title|a.keywords|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%']; + $where[] = ['a.id|a.title|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%']; } if (!empty($param['cate_id'])) { $where[] = ['a.cate_id', '=', $param['cate_id']]; diff --git a/app/admin/model/Article.php b/app/admin/model/Article.php index c9f165a..9b4cf0f 100644 --- a/app/admin/model/Article.php +++ b/app/admin/model/Article.php @@ -39,7 +39,7 @@ class Article extends Model { $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $order = empty($param['order']) ? 'a.id desc' : $param['order']; - $list = $this->where($where) + $list = self::where($where) ->field('a.*,c.id as cate_id,c.title as cate_title,u.nickname as admin_name') ->alias('a') ->join('ArticleCate c', 'a.cate_id = c.id') diff --git a/app/admin/model/Gallery.php b/app/admin/model/Gallery.php index 87cfc39..25e1e29 100644 --- a/app/admin/model/Gallery.php +++ b/app/admin/model/Gallery.php @@ -38,7 +38,7 @@ class Gallery extends Model { $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $order = empty($param['order']) ? 'a.id desc' : $param['order']; - $list = $this->where($where) + $list = self::where($where) ->field('a.*,c.title as cate_title,u.nickname as admin_name') ->alias('a') ->join('ArticleCate c', 'a.cate_id = c.id') diff --git a/app/admin/model/Goods.php b/app/admin/model/Goods.php index b15f17b..4a9d5fd 100644 --- a/app/admin/model/Goods.php +++ b/app/admin/model/Goods.php @@ -37,7 +37,7 @@ class Goods extends Model { $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $order = empty($param['order']) ? 'a.id desc' : $param['order']; - $list = $this->where($where) + $list = self::where($where) ->field('a.*,c.title as cate_title,u.nickname as admin_name') ->alias('a') ->join('GoodsCate c', 'a.cate_id = c.id') diff --git a/app/crud/tpl/model.tpl b/app/crud/tpl/model.tpl index 8bc66d9..7a48092 100644 --- a/app/crud/tpl/model.tpl +++ b/app/crud/tpl/model.tpl @@ -17,7 +17,7 @@ class extends Model { $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $order = empty($param['order']) ? ' desc' : $param['order']; - $list = $this->where($where)->field('')->order($order)->paginate($rows, false, ['query' => $param]); + $list = self::where($where)->field('')->order($order)->paginate($rows, false, ['query' => $param]); return $list; } @@ -30,7 +30,7 @@ class extends Model $insertId = 0; try { $param['create_time'] = time(); - $insertId = $this->strict(false)->field(true)->insertGetId($param); + $insertId = self::strict(false)->field(true)->insertGetId($param); add_log('add', $insertId, $param); } catch(\Exception $e) { return to_assign(1, '操作失败,原因:'.$e->getMessage()); @@ -46,7 +46,7 @@ class extends Model { try { $param['update_time'] = time(); - $this->where('', $param[''])->strict(false)->field(true)->update($param); + self::where('', $param[''])->strict(false)->field(true)->update($param); add_log('edit', $param['id'], $param); } catch(\Exception $e) { return to_assign(1, '操作失败,原因:'.$e->getMessage()); @@ -61,7 +61,7 @@ class extends Model */ public function getById($id) { - $info = $this->where('', $id)->find(); + $info = self::where('', $id)->find(); return $info; } @@ -76,7 +76,7 @@ class extends Model //逻辑删除 try { $param['delete_time'] = time(); - $this->where('', $id)->update(['delete_time'=>time()]); + self::where('', $id)->update(['delete_time'=>time()]); add_log('delete', $id); } catch(\Exception $e) { return to_assign(1, '操作失败,原因:'.$e->getMessage()); @@ -85,7 +85,7 @@ class extends Model else{ //物理删除 try { - $this->where('', $id)->delete(); + self::where('', $id)->delete(); add_log('delete', $id); } catch(\Exception $e) { return to_assign(1, '操作失败,原因:'.$e->getMessage());