diff --git a/README.md b/README.md index 240f2a4c..b1b611f6 100755 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ git clone -b 4.0 https://gitee.com/sentcms/sentcms.git sentcms cd sentcms ``` -如果是直接下载压缩包则直接进入解压文件夹,然后执行下面的代码 -把根目录下的.example.env文件复制一份并命名为.env +> 如果是直接下载压缩包则直接进入解压文件夹,然后执行下面的代码 + +> 把根目录下的.example.env文件复制一份并命名为.env ``` composer install @@ -81,6 +82,10 @@ composer install ## 版本列表 +> …… + +> 4.0 正在路上 + > 3.0.170127: https://git.oschina.net/sentcms/sentcms/repository/archive/3.0.170127 > 3.0.161201:https://git.oschina.net/sentcms/sentcms/repository/archive/3.0.161201 @@ -88,7 +93,3 @@ composer install > 3.0.1611:https://git.oschina.net/sentcms/sentcms/repository/archive/3.0.1611 > 3.0.1609:https://git.oschina.net/sentcms/sentcms/repository/archive/3.0.1609 - -> 4.0 正在路上 - -> …… \ No newline at end of file diff --git a/app/controller/admin/Ad.php b/app/controller/admin/Ad.php index 42d6e5e7..261a3f66 100644 --- a/app/controller/admin/Ad.php +++ b/app/controller/admin/Ad.php @@ -6,8 +6,9 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- - namespace app\controller\admin; + +use app\model\AdPlace; use app\controller\Admin; /** @@ -16,31 +17,19 @@ use app\controller\Admin; */ class Ad extends Admin { - protected $ad; - protected $adplace; - - public function _initialize() { - parent::_initialize(); - $this->ad = db('Ad'); - $this->adplace = db('AdPlace'); - } - /** * @title 广告位管理 */ public function index() { - $map = array(); + $map = []; $order = "id desc"; - $list = db('AdPlace')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param(), - )); - $data = array( + $list = AdPlace::where($map)->order($order)->paginate($this->request->pageConfig); + + $this->data = array( 'list' => $list, 'page' => $list->render(), ); - $this->assign($data); - $this->setMeta("广告管理"); return $this->fetch(); } diff --git a/app/controller/admin/Group.php b/app/controller/admin/Group.php index aecfc65c..58568260 100644 --- a/app/controller/admin/Group.php +++ b/app/controller/admin/Group.php @@ -6,9 +6,11 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- - namespace app\controller\admin; + use app\controller\Admin; +use app\model\AuthGroup; +use app\model\AuthRule; /** * @title 用户组管理 @@ -16,32 +18,21 @@ use app\controller\Admin; */ class Group extends Admin { - protected $model; - protected $rule; - - public function _initialize() { - parent::_initialize(); - $this->group = model('AuthGroup'); - $this->rule = model('AuthRule'); - } - /** * @title 用户组列表 */ public function index($type = 'admin') { - $map['module'] = $type; + $map = []; - $list = db('AuthGroup')->where($map)->order('id desc')->paginate(10, false, array( - 'query' => $this->request->param(), - )); + $map[] = ['module', '=', $type]; - $data = array( + $list = AuthGroup::where($map)->order('id desc')->paginate($this->request->pageConfig); + + $this->data = array( 'list' => $list, 'page' => $list->render(), 'type' => $type, ); - $this->assign($data); - $this->setMeta('用户组管理'); return $this->fetch(); } @@ -128,19 +119,17 @@ class Group extends Admin { * @title 权限节点 */ public function access($type = 'admin') { - $map['module'] = $type; + $map = []; - $list = db('AuthRule')->where($map)->order('id desc')->paginate(15, false, array( - 'query' => $this->request->param(), - )); + $map[] = ['module', '=', $type]; - $data = array( + $list = AuthRule::where($map)->order('id desc')->paginate($this->request->pageConfig); + + $this->data = array( 'list' => $list, 'page' => $list->render(), 'type' => $type, ); - $this->assign($data); - $this->setMeta('权限节点'); return $this->fetch(); } diff --git a/app/model/AdPlace.php b/app/model/AdPlace.php index d2754b83..c58af563 100644 --- a/app/model/AdPlace.php +++ b/app/model/AdPlace.php @@ -12,7 +12,7 @@ namespace app\model; /** * 分类模型 */ -class AdPlace { +class AdPlace extends \think\Model{ protected $auto = array('update_time'); protected $insert = array('create_time'); diff --git a/app/model/AuthGroup.php b/app/model/AuthGroup.php new file mode 100644 index 00000000..774a632c --- /dev/null +++ b/app/model/AuthGroup.php @@ -0,0 +1,19 @@ + +// +---------------------------------------------------------------------- + +namespace app\model; + +use think\Model; + +/** +* 设置模型 +*/ +class AuthGroup extends Model{ + +} \ No newline at end of file diff --git a/view/admin/ad/index.html b/view/admin/ad/index.html index c9b54bfd..8857ec84 100644 --- a/view/admin/ad/index.html +++ b/view/admin/ad/index.html @@ -34,8 +34,8 @@ {$item['id']} {$item['title']} {$item['name']} - {$item['create_time']|date='Y-m-d H:i',###} - {$item['update_time']|date='Y-m-d H:i',###} + {$item['create_time']} + {$item['update_time']} 广告列表 编辑