diff --git a/app/admin/controller/AdminAuth.php b/app/admin/controller/AdminAuth.php index 1308f86..17008fd 100644 --- a/app/admin/controller/AdminAuth.php +++ b/app/admin/controller/AdminAuth.php @@ -53,7 +53,7 @@ class AdminAuth extends AuthController $form = array(); $form[] = Elm::select('pid','上级权限',(int)$pid)->options(aModel::returnOptions())->col(10); $form[] = Elm::input('name','权限名称')->col(10); - $form[] = Elm::frameInput('icon','图标',Url::buildUrl('admin/widget.icon/index',array('fodder'=>'icon')))->icon("ios-ionic")->width('96%')->height('390px')->col(10); + $form[] = Elm::frameInput('icon','图标',Url::buildUrl('admin/icon/index',array('fodder'=>'icon')))->icon("ios-ionic")->width('96%')->height('390px')->col(10); $form[] = Elm::input('module','模块名')->col(10); $form[] = Elm::input('controller','控制器名')->col(10); $form[] = Elm::input('action','方法名')->col(10); diff --git a/app/admin/controller/Advert.php b/app/admin/controller/Advert.php new file mode 100644 index 0000000..3dd702d --- /dev/null +++ b/app/admin/controller/Advert.php @@ -0,0 +1,149 @@ +model = new aModel(); + } + + /** + * 广告管理 + * @return string + * @throws \Exception + * @author 李玉坤 + * @date 2021-02-19 11:53 + */ + public function index() + { + return $this->fetch(); + } + + /** + * 文章列表 + * @param Request $request + * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author 李玉坤 + * @date 2021-02-15 23:26 + */ + public function lst(Request $request) + { + $where = Util::postMore([ + ['title',''], + ['start_time',''], + ['end_time',''], + ['status',''], + ['page',1], + ['limit',20], + ]); + return app("json")->layui(aModel::systemPage($where)); + } + + /** + * 添加广告 + * @param Request $request + * @return string + * @throws \FormBuilder\Exception\FormBuilderException + */ + public function add(Request $request) + { + $form = array(); + $form[] = Elm::input('title','广告名称')->col(10); + $form[] = Elm::input('url','链接地址')->col(10); + $form[] = Elm::frameImage('image','广告图片',Url::buildUrl('admin/images/index',array('fodder'=>'image','limit'=>1)))->icon("ios-image")->width('96%')->height('440px')->col(10); + $form[] = Elm::input('sort','排序')->col(10); + $form[] = Elm::select('position', '位置')->options(function(){ + $options = []; + foreach(['首页', '首页右侧','文章页面'] as $k=>$v){ + $options[] = Elm::option($k, $v); + } + return $options; + })->col(10); + $form[] = Elm::radio('status','状态',1)->options([['label'=>'启用','value'=>1],['label'=>'冻结','value'=>0]])->col(10); + $form = Form::make_post_form($form, url('save')->build()); + $this->assign(compact('form')); + return $this->fetch("public/form-builder"); + } + + /** + * 修改banner + * @return string + * @throws \FormBuilder\Exception\FormBuilderException + */ + public function edit($id="") + { + if (!$id) return app("json")->fail("数据id不能为空"); + $ainfo = aModel::get($id); + if (!$ainfo) return app("json")->fail("没有该数据"); + $form = array(); + $form[] = Elm::input('title','广告名称',$ainfo['title'])->col(10); + $form[] = Elm::input('url','链接地址',$ainfo['url'])->col(10); + $form[] = Elm::frameImage('image','广告图片',Url::buildUrl('admin/images/index',array('fodder'=>'image','limit'=>1)),$ainfo['image'])->icon("ios-image")->width('96%')->height('440px')->col(10); + $form[] = Elm::input('sort','排序',$ainfo['sort'])->col(10); + $form[] = Elm::select('position', '位置',$ainfo['position'])->options(function(){ + $options = []; + foreach(['首页', '首页右侧','文章页面'] as $k=>$v){ + $options[] = Elm::option($k, $v); + } + return $options; + })->col(10); + $form[] = Elm::radio('status','状态',$ainfo['status'])->options([['label'=>'启用','value'=>1],['label'=>'冻结','value'=>0]])->col(10); + $form = Form::make_post_form($form, url('save',['id'=>$id])->build()); + $this->assign(compact('form')); + return $this->fetch("public/form-builder"); + } + + /** + * 保存修改 + * @param string $id + * @return mixed + */ + public function save($id="") + { + $data = Util::postMore([ + ['id',''], + ['title',''], + ['url',''], + ['image',''], + ['sort',''], + ['status',1], + ]); + if ($data['title'] == "") return app("json")->fail("广告名称不能为空"); + if ($data['url'] == "") return app("json")->fail("链接地址不能为空"); + if (is_array($data['image'])) $data['image'] = $data['avatar'][0]; + if ($id=="") { + //判断下用户是否存在 + $info = aModel::where('url',$data['url'])->find(); + if ($info){ + return app("json")->fail("链接已存在"); + } + $res = aModel::create($data); + }else { + $res = aModel::update($data,['id'=>$id]); + } + return $res ? app("json")->success("操作成功",'code') : app("json")->fail("操作失败"); + } +} \ No newline at end of file diff --git a/app/admin/controller/Invitation.php b/app/admin/controller/Invitation.php index 5951ea4..82e1d56 100644 --- a/app/admin/controller/Invitation.php +++ b/app/admin/controller/Invitation.php @@ -24,7 +24,7 @@ class Invitation extends AuthController $this->model = new aModel(); } /** - * 活动列表 + * 邀请码列表 * @return string * @throws \Exception * @author 李玉坤 diff --git a/app/admin/controller/Message.php b/app/admin/controller/Message.php index 07e7514..caf5707 100644 --- a/app/admin/controller/Message.php +++ b/app/admin/controller/Message.php @@ -2,7 +2,7 @@ namespace app\admin\controller; -use app\admin\model\MessageForm as aModel; +use app\common\model\MessageForm as aModel; use app\Request; use app\admin\service\UtilService as Util; diff --git a/app/admin/controller/Slides.php b/app/admin/controller/Slides.php index f97bca8..48d4d3a 100644 --- a/app/admin/controller/Slides.php +++ b/app/admin/controller/Slides.php @@ -53,7 +53,7 @@ class Slides extends AuthController } /** - * 添加账号 + * 添加banner * @param Request $request * @return string * @throws \FormBuilder\Exception\FormBuilderException @@ -72,7 +72,7 @@ class Slides extends AuthController } /** - * 修改账号 + * 修改banner * @return string * @throws \FormBuilder\Exception\FormBuilderException */ diff --git a/app/admin/view/advert/index.html b/app/admin/view/advert/index.html new file mode 100644 index 0000000..22ea7fb --- /dev/null +++ b/app/admin/view/advert/index.html @@ -0,0 +1,218 @@ + + + + 广告管理 - {:system_config("title")}后台管理系统 + {include file="public/header" /} + + +
+
+
+
+

搜索

+
+
+
+ +
+
+ +
+
+
+
+ +
+ + ~ + +
+
+ +
+
+
+
+
+
+
+
+ + 删除 +
+
+
+
+
+
+
+
+
+{include file="public/footer"/} + + + \ No newline at end of file diff --git a/app/common/model/Advert.php b/app/common/model/Advert.php new file mode 100644 index 0000000..5103b57 --- /dev/null +++ b/app/common/model/Advert.php @@ -0,0 +1,41 @@ +where("title|url","like","%$where[title]%"); + if ($where['start_time'] != '') $model = $model->where("create_time",">",strtotime($where['start_time']." 00:00:00")); + if ($where['end_time'] != '') $model = $model->where("create_time","<", strtotime($where['end_time']." 23:59:59")); + if ($where['status'] != '') $model = $model->where("status",$where['status']); + $count = self::counts($model); + if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']); + $data = $model->select()->each(function ($item){ + if (!empty($item->pic)){ + $item->pic = file_cdn($item->pic); + } + }); + if ($data) $data = $data->toArray(); + return compact('data','count'); + } +} \ No newline at end of file diff --git a/app/common/model/DocumentCategory.php b/app/common/model/DocumentCategory.php index 68e76ea..4de125b 100644 --- a/app/common/model/DocumentCategory.php +++ b/app/common/model/DocumentCategory.php @@ -3,9 +3,6 @@ namespace app\common\model; - -use app\common\model\BaseModel; - /** * Class DocumentCategory * @package app\admin\model\system diff --git a/app/common/model/MessageForm.php b/app/common/model/MessageForm.php index f4fed1c..0938701 100644 --- a/app/common/model/MessageForm.php +++ b/app/common/model/MessageForm.php @@ -3,9 +3,6 @@ namespace app\common\model; - -use app\admin\model\BaseModel; - /** * Class Document * @package app\admin\model\system diff --git a/app/common/model/Slides.php b/app/common/model/Slides.php index 08b1a79..472204e 100644 --- a/app/common/model/Slides.php +++ b/app/common/model/Slides.php @@ -27,6 +27,10 @@ class Slides extends BaseModel public static function systemPage($where): array { $model = new self; + if ($where['title'] != '') $model = $model->where("title|url","like","%$where[title]%"); + if ($where['start_time'] != '') $model = $model->where("create_time",">",strtotime($where['start_time']." 00:00:00")); + if ($where['end_time'] != '') $model = $model->where("create_time","<", strtotime($where['end_time']." 23:59:59")); + if ($where['status'] != '') $model = $model->where("status",$where['status']); $count = self::counts($model); if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']); $data = $model->select()->each(function ($item){ diff --git a/public/template/blog/info.json b/public/template/blog/info.json deleted file mode 100644 index 692370b..0000000 --- a/public/template/blog/info.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title":"默认主题", - "author":"MonkeyCode", - "demo_url":"http://default.lcm.wang/", - "category_list":[ - { - "name": "默认列表", - "template":"list_default.html" - }, - { - "name": "两排列表", - "template":"list_double.html" - } - ], - "article_list":[ - { - "name": "普通文章", - "template":"page.html" - }, - { - "name": "关于我们", - "template":"page_about.html" - }, - { - "name": "产品文章", - "template":"page_product.html" - } - ], - "info_file":"全部都是可视化的 没什么可说明的", - "update_url":"http://www.lcm.wang/", - "preview_file":"preview.jpg", - "versions":"1.0" -} \ No newline at end of file diff --git a/public/template/blog/preview.jpg b/public/template/blog/preview.jpg deleted file mode 100644 index 33e5953..0000000 Binary files a/public/template/blog/preview.jpg and /dev/null differ diff --git a/public/template/default/pc/index/index.html b/public/template/default/pc/index/index.html index c484e2f..6526d74 100644 --- a/public/template/default/pc/index/index.html +++ b/public/template/default/pc/index/index.html @@ -89,8 +89,6 @@
最新文章
wordpress
-
JavaScript
-
绿化破解
+

标签云

+
-
-
+
-

免费简单好用的网站服务器运维面板

-
-

拥有一个自己的网站服务器

- +

最新评论

+
  • + +
  • +
  • +
    +
    +
    +
    + 黑域博客 +
    +
    黑域博客
    +
    +
    + 7月16日 +
    +
    +
    +

    哈哈,我什么时候能上优秀网站

    +
    + +
    +
  • +
  • +
    +
    +
    +
    + 黯然gg +
    +
    黯然gg
    +
    +
    + 7月16日 +
    +
    +
    +

    + 啊 必须要首页的嘛 我用的主题没有首页链接这个模块儿呀 +

    +
    + +
    +
  • +
  • +
    +
    +
    +
    + Xpower +
    +
    Xpower
    +
    +
    + 7月16日 +
    +
    +
    +

    这模板可以

    +
    + +
    +
  • +
  • +
    +
    +
    +
    + 雅魔窝 +
    +
    雅魔窝
    +
    +
    + 7月16日 +
    +
    +
    +

    + 适合wp高手使用,如果用做新手小白,可能还需要写更傻瓜式的教程。 +

    +
    + +
    +
  • +
    +
    +

    免费简单好用的网站服务器运维面板

    + + + +
    +
    +

    拥有一个自己的网站服务器

    + +
    + loading="lazy" style="max-width: 100%; height: auto;"> + +