moonsflyer 2 달 전
부모
커밋
1655f68782
26개의 변경된 파일0개의 추가작업 그리고 2906개의 파일을 삭제
  1. 0 108
      app/admin/controller/community/CommunityArticle.php
  2. 0 120
      app/admin/controller/community/CommunityCategory.php
  3. 0 82
      app/admin/controller/community/CommunityComment.php
  4. 0 40
      app/admin/controller/community/CommunitySetting.php
  5. 0 120
      app/admin/controller/community/CommunityTopic.php
  6. 0 203
      app/admin/logic/community/CommunityArticleLogic.php
  7. 0 167
      app/admin/logic/community/CommunityCategoryLogic.php
  8. 0 127
      app/admin/logic/community/CommunityCommentLogic.php
  9. 0 53
      app/admin/logic/community/CommunitySettingLogic.php
  10. 0 160
      app/admin/logic/community/CommunityTopicLogic.php
  11. 0 63
      app/admin/validate/community/CommunityArticleValidate.php
  12. 0 41
      app/admin/validate/community/CommunityCategoryValidate.php
  13. 0 60
      app/admin/validate/community/CommunityCommentValidate.php
  14. 0 72
      app/admin/validate/community/CommunityTopicValidate.php
  15. 0 131
      app/admin/view/community/community_article/audit.html
  16. 0 155
      app/admin/view/community/community_article/detail.html
  17. 0 217
      app/admin/view/community/community_article/lists.html
  18. 0 32
      app/admin/view/community/community_category/add.html
  19. 0 32
      app/admin/view/community/community_category/edit.html
  20. 0 191
      app/admin/view/community/community_category/lists.html
  21. 0 46
      app/admin/view/community/community_comment/audit.html
  22. 0 188
      app/admin/view/community/community_comment/lists.html
  23. 0 89
      app/admin/view/community/community_setting/setting.html
  24. 0 80
      app/admin/view/community/community_topic/add.html
  25. 0 90
      app/admin/view/community/community_topic/edit.html
  26. 0 239
      app/admin/view/community/community_topic/lists.html

+ 0 - 108
app/admin/controller/community/CommunityArticle.php

@@ -1,108 +0,0 @@
-<?php
-
-
-namespace app\admin\controller\community;
-
-
-use app\admin\logic\community\CommunityArticleLogic;
-use app\admin\validate\community\CommunityArticleValidate;
-use app\common\basics\AdminBase;
-use app\common\enum\CommunityArticleEnum;
-use app\common\server\JsonServer;
-
-/**
- * 种草社区文章
- * Class CommunityArticle
- * @package app\admin\controller\community
- */
-class CommunityArticle extends AdminBase
-{
-
-
-    /**
-     * @notes 文章列表
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/5/10 11:08
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = CommunityArticleLogic::lists($get);
-            return JsonServer::success("获取成功", $lists);
-        }
-        return view('', [
-            'status' => CommunityArticleEnum::getStatusDesc()
-        ]);
-    }
-
-
-    /**
-     * @notes 审核文章
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/5/10 17:45
-     */
-    public function audit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new CommunityArticleValidate())->goCheck('audit', $post);
-            $result = CommunityArticleLogic::audit($post);
-            if (false === $result) {
-                return JsonServer::error(CommunityArticleLogic::getError() ?: '操作失败');
-            }
-            return JsonServer::success('编辑成功');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => CommunityArticleLogic::detail($id)
-        ]);
-    }
-
-
-
-    /**
-     * @notes 文章详情
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/5/10 19:05
-     */
-    public function detail()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $result = CommunityArticleLogic::getRelationData($get);
-            return JsonServer::success('', $result);
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => CommunityArticleLogic::detail($id)
-        ]);
-    }
-
-
-
-
-    /**
-     * @notes 删除文章
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2022/5/10 16:46
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityArticleValidate())->goCheck('id');
-            $id = $this->request->post('id');
-            $result = CommunityArticleLogic::del($id);
-            if (false === $result) {
-                return JsonServer::error(CommunityArticleLogic::getError() ?: '删除失败');
-            }
-            return JsonServer::success('删除成功');
-        }
-    }
-
-
-}

+ 0 - 120
app/admin/controller/community/CommunityCategory.php

@@ -1,120 +0,0 @@
-<?php
-
-
-namespace app\admin\controller\community;
-
-
-use app\admin\logic\community\CommunityCategoryLogic;
-use app\admin\validate\community\CommunityCategoryValidate;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-/**
- * 种草社区分类
- * Class CommunityCategory
- * @package app\admin\controller\content
- */
-class CommunityCategory extends AdminBase
-{
-
-
-    /**
-     * @notes 获取分类列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2022/4/28 10:41
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = CommunityCategoryLogic::lists($get);
-            return JsonServer::success("获取成功", $lists);
-        }
-        return view();
-    }
-
-
-    /**
-     * @notes 新增分类
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/28 10:39
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            (new CommunityCategoryValidate())->goCheck('add', $post);
-            CommunityCategoryLogic::add($post);
-            return JsonServer::success('新增成功');
-        }
-        return view();
-    }
-
-
-
-    /**
-     * @notes 编辑分类
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/28 10:40
-     */
-    public function edit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            (new CommunityCategoryValidate())->goCheck('edit', $post);
-            CommunityCategoryLogic::edit($post);
-            return JsonServer::success('编辑成功');
-        }
-
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => CommunityCategoryLogic::detail($id)
-        ]);
-    }
-
-
-
-    /**
-     * @notes 删除分类
-     * @return \think\response\Json
-     * @author 段誉
-     * @date 2022/4/28 10:40
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityCategoryValidate())->goCheck('id');
-            $id = $this->request->post('id');
-            $result = CommunityCategoryLogic::del($id);
-            if (false === $result) {
-                return JsonServer::error(CommunityCategoryLogic::getError() ?: '删除失败');
-            }
-            return JsonServer::success('删除成功');
-        }
-        return JsonServer::error('异常');
-    }
-
-
-    /**
-     * @notes 设置显示z状态
-     * @return \think\response\Json
-     * @author 段誉
-     * @date 2022/4/28 10:41
-     */
-    public function status()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityCategoryValidate())->goCheck('status');
-            $post = $this->request->post();
-            CommunityCategoryLogic::setShowStatus($post);
-            return JsonServer::success('操作成功');
-        }
-        return JsonServer::success('异常');
-    }
-}

+ 0 - 82
app/admin/controller/community/CommunityComment.php

@@ -1,82 +0,0 @@
-<?php
-
-
-namespace app\admin\controller\community;
-
-
-use app\admin\logic\community\CommunityCommentLogic;
-use app\admin\validate\community\CommunityCommentValidate;
-use app\common\basics\AdminBase;
-use app\common\enum\CommunityCommentEnum;
-use app\common\server\JsonServer;
-
-
-/**
- * 种草社区评论
- * Class CommunityComment
- * @package app\admin\controller\community
- */
-class CommunityComment extends AdminBase
-{
-
-    /**
-     * @notes 评论列表
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/5/10 12:05
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = CommunityCommentLogic::lists($get);
-            return JsonServer::success("获取成功", $lists);
-        }
-        return view('', [
-            'status' => CommunityCommentEnum::getStatusDesc()
-        ]);
-    }
-
-
-    /**
-     * @notes 审核评论
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/5/10 15:12
-     */
-    public function audit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new CommunityCommentValidate())->goCheck('audit', $post);
-            CommunityCommentLogic::audit($post);
-            return JsonServer::success('审核成功');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => CommunityCommentLogic::detail($id)
-        ]);
-    }
-
-
-    /**
-     * @notes 删除评论
-     * @return \think\response\Json|void
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/5/10 15:42
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityCommentValidate())->goCheck('id');
-            $id = $this->request->post('id/d');
-            CommunityCommentLogic::del($id);
-            return JsonServer::success('删除成功');
-        }
-    }
-
-
-}

+ 0 - 40
app/admin/controller/community/CommunitySetting.php

@@ -1,40 +0,0 @@
-<?php
-
-
-namespace app\admin\controller\community;
-
-
-use app\admin\logic\community\CommunitySettingLogic;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-/**
- * 种草社区设置
- * Class CommunityTopic
- * @package app\admin\controller\content
- */
-class CommunitySetting extends AdminBase
-{
-
-
-    /**
-     * @notes 社区配置
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/28 16:16
-     */
-    public function setting()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            CommunitySettingLogic::setConfig($post);
-            return JsonServer::success('操作成功');
-        }
-        $config = CommunitySettingLogic::getConfig();
-        return view('', ['config' => $config]);
-    }
-
-}

+ 0 - 120
app/admin/controller/community/CommunityTopic.php

@@ -1,120 +0,0 @@
-<?php
-
-
-namespace app\admin\controller\community;
-
-
-use app\admin\logic\community\CommunityCategoryLogic;
-use app\admin\logic\community\CommunityTopicLogic;
-use app\admin\validate\community\CommunityTopicValidate;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-/**
- * 种草社区话题
- * Class CommunityTopic
- * @package app\admin\controller\content
- */
-class CommunityTopic extends AdminBase
-{
-
-    /**
-     * @notes 获取话题列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2022/4/28 10:41
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = CommunityTopicLogic::lists($get);
-            return JsonServer::success("获取成功", $lists);
-        }
-        return view('', ['cate' => CommunityCategoryLogic::getCategory()]);
-    }
-
-
-    /**
-     * @notes 新增话题
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/28 10:39
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            (new CommunityTopicValidate())->goCheck('add', $post);
-            CommunityTopicLogic::add($post);
-            return JsonServer::success('新增成功');
-        }
-        return view('', ['cate' => CommunityCategoryLogic::getCategory()]);
-    }
-
-
-
-    /**
-     * @notes 编辑话题
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/28 10:40
-     */
-    public function edit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            (new CommunityTopicValidate())->goCheck('edit', $post);
-            CommunityTopicLogic::edit($post);
-            return JsonServer::success('编辑成功');
-        }
-
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => CommunityTopicLogic::detail($id),
-            'cate' => CommunityCategoryLogic::getCategory()
-        ]);
-    }
-
-
-
-    /**
-     * @notes 删除话题
-     * @return \think\response\Json
-     * @author 段誉
-     * @date 2022/4/28 10:40
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityTopicValidate())->goCheck('id');
-            $id = $this->request->post('id');
-            $result = CommunityTopicLogic::del($id);
-            if (false === $result) {
-                return JsonServer::error(CommunityTopicLogic::getError() ?: '删除失败');
-            }
-            return JsonServer::success('删除成功');
-        }
-    }
-
-
-    /**
-     * @notes 设置显示z状态
-     * @return \think\response\Json
-     * @author 段誉
-     * @date 2022/4/28 10:41
-     */
-    public function status()
-    {
-        if ($this->request->isAjax()) {
-            (new CommunityTopicValidate())->goCheck('status');
-            $post = $this->request->post();
-            CommunityTopicLogic::setStatus($post);
-            return JsonServer::success('操作成功');
-        }
-        return JsonServer::success('异常');
-    }
-}

+ 0 - 203
app/admin/logic/community/CommunityArticleLogic.php

@@ -1,203 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\community;
-
-
-use app\common\basics\Logic;
-use app\common\enum\CommunityLikeEnum;
-use app\common\model\community\CommunityArticle;
-use app\common\model\community\CommunityComment;
-use app\common\model\community\CommunityLike;
-use app\common\model\community\CommunityTopic;
-use app\common\logic\CommunityArticleLogic as CommonArticleLogic;
-use app\common\server\UrlServer;
-use think\Exception;
-use think\facade\Db;
-
-
-/**
- * 种草社区文章逻辑
- * Class CommunityArticleLogic
- * @package app\admin\logic\community
- */
-class CommunityArticleLogic extends Logic
-{
-
-    /**
-     * @notes 文章列表
-     * @param $get
-     * @return array
-     * @author 段誉
-     * @date 2022/5/10 11:07
-     */
-    public static function lists($get)
-    {
-        $where = [
-            ['a.del', '=', 0]
-        ];
-
-        if (!empty($get['keyword'])) {
-            $where[] = ['u.sn|u.nickname|u.mobile', 'like', '%' . $get['keyword'] . '%'];
-        }
-
-        if (!empty($get['content'])) {
-            $where[] = ['a.content', 'like', '%' . $get['content'] . '%'];
-        }
-
-        if (isset($get['status']) && $get['status'] != '') {
-            $where[] = ['a.status', '=', $get['status']];
-        }
-
-        if (isset($get['start_time']) && $get['start_time'] != '') {
-            $where[] = ['a.audit_time', '>=', strtotime($get['start_time'])];
-        }
-
-        if (isset($get['end_time']) && $get['end_time'] != '') {
-            $where[] = ['a.audit_time', '<=', strtotime($get['end_time'])];
-        }
-
-        $model = new CommunityArticle();
-        $lists = $model->with(['images'])->alias('a')
-            ->field('a.*,u.nickname,u.avatar,u.sn')
-            ->join('user u', 'u.id = a.user_id')
-            ->where($where)
-            ->order(['id' => 'desc'])
-            ->append(['status_desc'])
-            ->paginate([
-                'page' => $get['page'],
-                'list_rows' => $get['limit'],
-                'var_page' => 'page'
-            ])
-            ->toArray();
-
-        foreach ($lists['data'] as &$item) {
-            $item['avatar'] = !empty($item['avatar']) ? UrlServer::getFileUrl($item['avatar']) : '';
-        }
-
-        return ['count' => $lists['total'], 'lists' => $lists['data']];
-    }
-
-
-    /**
-     * @notes 文章详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2022/5/10 16:53
-     */
-    public static function detail($id)
-    {
-        $detail = CommunityArticle::with(['images', 'topic', 'user' => function ($query) {
-            $query->field(['id', 'nickname', 'sn']);
-        }])
-            ->append(['shop_data', 'goods_data', 'status_desc'])
-            ->findOrEmpty($id);
-
-        $detail['cate_name'] = $detail['topic']['cate']['name'] ?? '';
-        $detail['audit_time'] = date('Y-m-d H:i:s', $detail['audit_time']);
-        return $detail->toArray();
-    }
-
-
-    /**
-     * @notes 删除文章
-     * @param $id
-     * @return bool
-     * @author 段誉
-     * @date 2022/5/10 16:34
-     */
-    public static function del($id)
-    {
-        Db::startTrans();
-        try {
-            $article = CommunityArticle::find($id);
-            $article->del = 1;
-            $article->update_time = time();
-            $article->save();
-
-            if (!empty($article['topic_id'])) {
-                CommunityTopic::decArticleNum($article['topic_id']);
-            }
-
-            Db::commit();
-            return true;
-
-        } catch (Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 审核文章
-     * @param $post
-     * @return bool
-     * @author 段誉
-     * @date 2022/5/12 16:57
-     */
-    public static function audit($post)
-    {
-        Db::startTrans();
-        try {
-            $article = CommunityArticle::findOrEmpty($post['id']);
-            $article->status = $post['status'];
-            $article->audit_remark = $post['audit_remark'] ?? '';
-            $article->audit_time = time();
-            $article->save();
-
-            // 通知粉丝有新文章发布
-            CommonArticleLogic::noticeFans($article['user_id'], $post['status']);
-
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 文章关联评论及点赞
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2022/5/11 10:14
-     */
-    public static function getRelationData($get)
-    {
-        $type = $get['type'] ?? 'comment';
-        if ($type == 'comment') {
-            $lists = CommunityComment::with(['user'])
-                ->where([
-                    'del' => 0,
-                    'article_id' => $get['id'],
-                ])->paginate([
-                    'page' => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page' => 'page'
-                ])
-                ->toArray();
-        } else {
-            $lists = CommunityLike::with(['user'])
-                ->where([
-                    'relation_id' => $get['id'],
-                    'type' => CommunityLikeEnum::TYPE_ARTICLE
-                ])
-                ->paginate([
-                    'page' => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page' => 'page'
-                ])
-                ->toArray();
-        }
-        return ['count' => $lists['total'], 'lists' => $lists['data']];
-    }
-
-
-}

+ 0 - 167
app/admin/logic/community/CommunityCategoryLogic.php

@@ -1,167 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\community;
-
-
-use app\common\basics\Logic;
-use app\common\model\community\CommunityCategory;
-use app\common\model\community\CommunityTopic;
-use think\Exception;
-
-
-/**
- * 种草社区分类逻辑
- * Class CommunityCategoryLogic
- * @package app\admin\logic\content
- */
-class CommunityCategoryLogic extends Logic
-{
-
-    /**
-     * @notes 获取分类
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2022/4/28 10:09
-     */
-    public static function lists($get)
-    {
-        $where = [
-            ['del', '=', 0]
-        ];
-        
-        if (!empty($get['name'])) {
-            $where[] = ['name', 'like', '%'.$get['name'].'%'];
-        }
-
-        $model = new CommunityCategory();
-        $lists = $model->field(true)
-            ->where($where)
-            ->order(['sort' => 'asc', 'id' => 'desc'])
-            ->paginate([
-                'page' => $get['page'],
-                'list_rows' => $get['limit'],
-                'var_page' => 'page'
-            ])
-            ->toArray();
-
-        return ['count' => $lists['total'], 'lists' => $lists['data']];
-    }
-
-
-    /**
-     * @notes 获取分类
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/28 10:11
-     */
-    public static function getCategory()
-    {
-        return CommunityCategory::where(['del' => 0, 'is_show' => 1])
-            ->order(['sort' => 'asc', 'id' => 'desc'])
-            ->select()
-            ->toArray();
-    }
-
-
-    /**
-     * @notes 获取分类详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2022/4/28 10:11
-     */
-    public static function detail($id)
-    {
-        return CommunityCategory::findOrEmpty($id)->toArray();
-    }
-
-
-    /**
-     * @notes 添加分类
-     * @param $post
-     * @return CommunityCategory|\think\Model
-     * @author 段誉
-     * @date 2022/4/28 10:23
-     */
-    public static function add($post)
-    {
-        return CommunityCategory::create([
-            'name' => $post['name'],
-            'is_show' => $post['is_show'],
-            'sort' => $post['sort'] ?? 255,
-            'create_time' => time()
-        ]);
-    }
-
-
-    /**
-     * @notes 编辑分类
-     * @param $post
-     * @return CommunityCategory
-     * @author 段誉
-     * @date 2022/4/28 10:24
-     */
-    public static function edit($post)
-    {
-        return CommunityCategory::update([
-            'name' => $post['name'],
-            'is_show' => $post['is_show'],
-            'sort' => $post['sort'] ?? 255,
-            'update_time' => time()
-        ], ['id' => $post['id']]);
-    }
-
-
-
-    /**
-     * @notes 删除分类
-     * @param $id
-     * @return bool
-     * @author 段誉
-     * @date 2022/4/28 15:19
-     */
-    public static function del($id)
-    {
-        try {
-            $topic = CommunityTopic::where(['del' => 0, 'cid'=> $id])->findOrEmpty();
-
-            if (!$topic->isEmpty()) {
-                throw new Exception('该分类已关联话题,暂无法删除');
-            }
-
-            CommunityCategory::update([
-                'id' => $id,
-                'del' => 1,
-                'update_time' => time()
-            ]);
-
-            return true;
-
-        } catch (Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-
-    /**
-     * @notes 设置显示状态
-     * @param $post
-     * @author 段誉
-     * @date 2022/4/28 10:50
-     */
-    public static function setShowStatus($post)
-    {
-        CommunityCategory::update([
-            'is_show' => $post['is_show'],
-            'update_time' => time()
-        ], ['id' => $post['id']]);
-    }
-}

+ 0 - 127
app/admin/logic/community/CommunityCommentLogic.php

@@ -1,127 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\community;
-
-
-use app\common\basics\Logic;
-use app\common\enum\CommunityCommentEnum;
-use app\common\model\community\CommunityArticle;
-use app\common\model\community\CommunityComment;
-use app\common\server\UrlServer;
-
-
-/**
- * 种草社区评论
- * Class CommunityCommentLogic
- * @package app\admin\logic\community
- */
-class CommunityCommentLogic extends Logic
-{
-
-    /**
-     * @notes 评论列表
-     * @param $get
-     * @return array
-     * @author 段誉
-     * @date 2022/5/10 12:06
-     */
-    public static function lists($get)
-    {
-        $where = [
-            ['c.del', '=', 0]
-        ];
-
-        if (!empty($get['keyword'])) {
-            $where[] = ['u.sn|u.nickname|u.mobile', 'like', '%' . $get['keyword'] . '%'];
-        }
-
-        if (!empty($get['comment'])) {
-            $where[] = ['c.comment', 'like', '%' . $get['comment'] . '%'];
-        }
-
-        if (isset($get['status']) && $get['status'] != '') {
-            $where[] = ['c.status', '=', $get['status']];
-        }
-
-        $model = new CommunityComment();
-        $lists = $model->alias('c')
-            ->with(['article' => function($query) {
-                $query->field('id,content,topic_id');
-            }])
-            ->field('c.*,u.nickname,u.avatar,u.sn')
-            ->join('user u', 'u.id = c.user_id')
-            ->where($where)
-            ->order(['id' => 'desc'])
-            ->append(['status_desc'])
-            ->paginate([
-                'page' => $get['page'],
-                'list_rows' => $get['limit'],
-                'var_page' => 'page'
-            ]);
-        foreach ($lists as &$item) {
-            $item['avatar'] = !empty($item['avatar']) ? UrlServer::getFileUrl($item['avatar']) : '';
-            $item['status_desc'] = CommunityCommentEnum::getStatusDesc($item['status']);
-            $item['topic_name'] = $item['article']['topic']['name'] ?? '';
-        }
-
-        return ['count' => $lists->total(), 'lists' => $lists->getCollection()];
-    }
-
-
-    /**
-     * @notes 详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2022/5/10 12:15
-     */
-    public static function detail($id)
-    {
-        return CommunityComment::with(['article'])->findOrEmpty($id)->toArray();
-    }
-
-
-    /**
-     * @notes 审核成功
-     * @param $post
-     * @return CommunityComment
-     * @author 段誉
-     * @date 2022/5/10 15:11
-     */
-    public static function audit($post)
-    {
-        return CommunityComment::where(['id' => $post['id']])->update([
-            'status' => $post['status'],
-            'update_time' => time()
-        ]);
-    }
-
-
-
-    /**
-     * @notes 删除评论
-     * @param $id
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/5/10 15:23
-     */
-    public static function del($id)
-    {
-        // 删除评论
-        $comment = CommunityComment::find($id);
-        $comment->del     = 1;
-        $comment->update_time    = time();
-        $comment->save();
-
-        // 更新文章评论数
-        CommunityArticle::where([
-            ['id', '=', $comment['article_id']],
-            ['comment', '>=', 1]]
-        )->dec('comment')->update();
-    }
-
-
-}

+ 0 - 53
app/admin/logic/community/CommunitySettingLogic.php

@@ -1,53 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\community;
-
-
-use app\common\basics\Logic;
-use app\common\server\ConfigServer;
-
-
-/**
- * 种草社区设置
- * Class CommunityTopicLogic
- * @package app\admin\logic\content
- */
-class CommunitySettingLogic extends Logic
-{
-
-    /**
-     * @notes 获取社区配置
-     * @return array
-     * @author 段誉
-     * @date 2022/4/28 16:13
-     */
-    public static function getConfig()
-    {
-        $config = [
-            'status' => ConfigServer::get('community', 'status', 1),
-            'audit_article' => ConfigServer::get('community', 'audit_article', 1),
-            'audit_comment' => ConfigServer::get('community', 'audit_comment', 1),
-        ];
-        return $config;
-    }
-
-
-    /**
-     * @notes 设置社区配置
-     * @param $post
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/28 16:14
-     */
-    public static function setConfig($post)
-    {
-        ConfigServer::set('community', 'status', $post['status']);
-        ConfigServer::set('community', 'audit_article', $post['audit_article']);
-        ConfigServer::set('community', 'audit_comment', $post['audit_comment']);
-    }
-
-
-}

+ 0 - 160
app/admin/logic/community/CommunityTopicLogic.php

@@ -1,160 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\community;
-
-
-use app\common\basics\Logic;
-use app\common\model\community\CommunityArticle;
-use app\common\model\community\CommunityTopic;
-
-
-/**
- * 种草社区话题逻辑
- * Class CommunityTopicLogic
- * @package app\admin\logic\content
- */
-class CommunityTopicLogic extends Logic
-{
-
-    /**
-     * @notes 获取话题
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2022/4/28 10:09
-     */
-    public static function lists($get)
-    {
-        $where = [
-            ['del', '=', 0]
-        ];
-        
-        if (!empty($get['name'])) {
-            $where[] = ['name', 'like', '%'.$get['name'].'%'];
-        }
-
-        if (!empty($get['cid'])) {
-            $where[] = ['cid', '=', $get['cid']];
-        }
-
-        $model = new CommunityTopic();
-        $lists = $model->with(['cate'])
-            ->where($where)
-            ->order(['sort' => 'asc', 'id' => 'desc'])
-            ->paginate([
-                'page' => $get['page'],
-                'list_rows' => $get['limit'],
-                'var_page' => 'page'
-            ])
-            ->toArray();
-
-        foreach ($lists['data'] as &$item) {
-            $item['cate_name'] = $item['cate']['name'] ?? '';
-        }
-
-
-        return ['count' => $lists['total'], 'lists' => $lists['data']];
-    }
-
-
-
-
-    /**
-     * @notes 获取话题详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2022/4/28 10:11
-     */
-    public static function detail($id)
-    {
-        return CommunityTopic::findOrEmpty($id)->toArray();
-    }
-
-
-    /**
-     * @notes 添加话题
-     * @param $post
-     * @return CommunityTopic|\think\Model
-     * @author 段誉
-     * @date 2022/4/28 10:23
-     */
-    public static function add($post)
-    {
-        return CommunityTopic::create([
-            'name' => $post['name'],
-            'image' => $post['image'],
-            'cid' => $post['cid'],
-            'is_show' => $post['is_show'],
-            'is_recommend' => $post['is_recommend'],
-            'sort' => $post['sort'] ?? 255,
-            'create_time' => time()
-        ]);
-    }
-
-
-    /**
-     * @notes 编辑话题
-     * @param $post
-     * @return CommunityTopic
-     * @author 段誉
-     * @date 2022/4/28 10:24
-     */
-    public static function edit($post)
-    {
-        return CommunityTopic::update([
-            'name' => $post['name'],
-            'image' => $post['image'],
-            'cid' => $post['cid'],
-            'is_show' => $post['is_show'],
-            'is_recommend' => $post['is_recommend'],
-            'sort' => $post['sort'] ?? 255,
-            'update_time' => time()
-        ], ['id' => $post['id']]);
-    }
-
-
-    /**
-     * @notes 删除话题
-     * @param $id
-     * @return bool
-     * @author 段誉
-     * @date 2022/5/10 15:53
-     */
-    public static function del($id)
-    {
-        try {
-            $check = CommunityArticle::where(['topic_id' => $id, 'del' => 0])->findOrEmpty();
-            if (!$check->isEmpty()) {
-                throw new \Exception('该话题下已关联文章,不可删除');
-            }
-
-            CommunityTopic::where(['id' => $id])->update([
-                'del' => 1,
-                'update_time' => time()
-            ]);
-            return true;
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-
-    /**
-     * @notes 设置显示状态
-     * @param $post
-     * @author 段誉
-     * @date 2022/4/28 10:50
-     */
-    public static function setStatus($post)
-    {
-        CommunityTopic::update([
-            $post['field'] => $post['value'],
-            'update_time' => time()
-        ], ['id' => $post['id']]);
-    }
-}

+ 0 - 63
app/admin/validate/community/CommunityArticleValidate.php

@@ -1,63 +0,0 @@
-<?php
-
-
-namespace app\admin\validate\community;
-
-
-use app\common\basics\Validate;
-use app\common\model\community\CommunityArticle;
-
-
-/**
- * 仲裁社区文章验证
- * Class CommunityArticleValidate
- * @package app\admin\validate\community
- */
-class CommunityArticleValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number|checkArticle',
-        'status' => 'require|in:1,2',
-        'audit_remark' => 'requireIf:status,2|max:100',
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-        'status.require' => '请选择审核状态',
-        'status.in' => '审核状态值异常',
-        'audit_remark.requireIf' => '请填写拒绝说明',
-        'audit_remark.max' => '审核说明仅限100字内',
-    ];
-
-    protected $scene = [
-        'audit' => ['id', 'status', 'audit_remark'],
-        'id' => ['id'],
-    ];
-
-
-    /**
-     * @notes 校验文章
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/5/10 15:08
-     */
-    protected function checkArticle($value, $rule, $data)
-    {
-        $comment = CommunityArticle::where(['del' => 0])->findOrEmpty($value);
-
-        if ($comment->isEmpty()) {
-            return '文章信息不存在';
-        }
-
-        return true;
-    }
-
-
-
-
-
-}

+ 0 - 41
app/admin/validate/community/CommunityCategoryValidate.php

@@ -1,41 +0,0 @@
-<?php
-
-
-namespace app\admin\validate\community;
-
-
-use app\common\basics\Validate;
-use app\common\model\community\CommunityCategory;
-
-/**
- * 种草社区分类验证
- * Class CommunityCategoryValidate
- * @package app\admin\validate\community
- */
-class CommunityCategoryValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number',
-        'name' => 'require|max:4|unique:'.CommunityCategory::class.',name^del',
-        'is_show' => 'require|in:0,1',
-        'sort' => 'egt:0'
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-        'name.require' => '请填写分类名称',
-        'name.max' => '分类名称长度不能超过4位',
-        'name.unique' => '分类名称已存在',
-        'is_show.require' => '请选择是否显示',
-        'is_show.in' => '选择是否显示异常',
-        'sort.egt' => '请填写大于等于0的排序值',
-    ];
-
-    protected $scene = [
-        'id' => ['id'],
-        'status' => ['id', 'is_show'],
-        'add' => ['name', 'is_show', 'sort'],
-        'edit' => ['id', 'name', 'is_show', 'sort']
-    ];
-}

+ 0 - 60
app/admin/validate/community/CommunityCommentValidate.php

@@ -1,60 +0,0 @@
-<?php
-
-
-namespace app\admin\validate\community;
-
-
-use app\common\basics\Validate;
-use app\common\model\community\CommunityComment;
-
-
-/**
- * 社区种草评论验证
- * Class CommunityCommentValidate
- * @package app\admin\validate\community
- */
-class CommunityCommentValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number|checkComment',
-        'status' => 'require|in:1,2',
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-        'status.require' => '请选择审核状态',
-        'status.in' => '审核状态值异常',
-    ];
-
-    protected $scene = [
-        'audit' => ['id', 'status'],
-        'id' => ['id'],
-    ];
-
-
-    /**
-     * @notes 校验评论
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/5/10 15:08
-     */
-    protected function checkComment($value, $rule, $data)
-    {
-        $comment = CommunityComment::where(['del' => 0])->findOrEmpty($value);
-
-        if ($comment->isEmpty()) {
-            return '评论信息不存在';
-        }
-
-        return true;
-    }
-
-
-
-
-
-}

+ 0 - 72
app/admin/validate/community/CommunityTopicValidate.php

@@ -1,72 +0,0 @@
-<?php
-
-
-namespace app\admin\validate\community;
-
-
-use app\common\basics\Validate;
-use app\common\model\community\CommunityTopic;
-
-/**
- * 种草社区话题验证
- * Class CommunityTopicValidate
- * @package app\admin\validate\community
- */
-class CommunityTopicValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number',
-        'name' => 'require|max:12|unique:' . CommunityTopic::class . ',name^del',
-        'image' => 'require',
-        'cid' => 'require|number',
-        'is_show' => 'require|in:0,1',
-        'is_recommend' => 'require|in:0,1',
-        'sort' => 'egt:0',
-        'field' => 'require|checkUpdateField',
-        'value' => 'require|in:0,1',
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-        'name.require' => '请填写话题名称',
-        'name.max' => '话题名称长度不能超过12位',
-        'name.unique' => '话题名称已存在',
-        'image.require' => '请选择话题图标',
-        'cid.require' => '请选择关联分类',
-        'is_recommend.require' => '请选择是否推荐',
-        'is_recommend.in' => '推荐状态异常',
-        'is_show.require' => '请选择是否显示',
-        'is_show.in' => '显示状态异常',
-        'sort.egt' => '请填写大于等于0的排序值',
-        'field.egt' => '参数缺失',
-        'value.egt' => '参数缺失',
-        'value.in' => '状态值异常',
-    ];
-
-    protected $scene = [
-        'id' => ['id'],
-        'status' => ['id', 'field', 'value'],
-        'add' => ['name', 'image', 'cid', 'is_recommend', 'is_show', 'sort'],
-        'edit' => ['id', 'name', 'image', 'cid', 'is_recommend', 'is_show', 'sort']
-    ];
-
-
-    /**
-     * @notes 校验更新字段
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/4/28 15:13
-     */
-    protected function checkUpdateField($value, $rule, $data)
-    {
-        $allow_field = ['is_show', 'is_recommend'];
-        if (in_array($value, $allow_field)) {
-            return true;
-        }
-        return '非法字段';
-    }
-}

+ 0 - 131
app/admin/view/community/community_article/audit.html

@@ -1,131 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .image {
-        height:60px;width: 60px;margin-right: 5px;
-    }
-</style>
-
-<div class="layui-card layui-form" style="padding-bottom: 10%">
-    <div class="layui-card-body">
-
-        <input type="hidden" name="id" value="{$detail.id}">
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">图片:</label>
-            <div class="layui-input-block" style="width: 50%">
-                {volist name="detail.images" id="vo"}
-                <img src="{$vo.image}" class="image-show image">
-                {/volist}
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">文章内容:</label>
-            <div class="layui-card-body">
-                <p>{$detail.content}</p>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">分类:</label>
-            <div class="layui-card-body">
-                <p>{$detail.topic.cate.name}</p>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">话题:</label>
-            <div class="layui-card-body">
-                <p>{$detail.topic.name | default =""}</p>
-            </div>
-        </div>
-
-        {if !empty($detail.goods_data)}
-            <div class="layui-form-item">
-            <label class="layui-form-label">关联商品:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <table class="layui-table">
-                    <tbody>
-                    {foreach $detail.goods_data as $k => $goods}
-                    <tr>
-                        <td>
-                            <div style="text-align: left">
-                                <div class="layui-col-md3">
-                                    <img src="{$goods.image}" class="image-show image" >
-                                </div>
-                                <div class="layui-col-md9">
-                                    <p style="margin-top: 10px">{$goods.name}</p>
-                                </div>
-                            </div>
-                        </td>
-                    </tr>
-                    {/foreach}
-                    </tbody>
-                </table>
-            </div>
-        </div>
-        {/if}
-
-
-        {if !empty($detail.shop_data)}
-            <div class="layui-form-item">
-            <label class="layui-form-label">关联商品:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <table class="layui-table">
-                    <tbody>
-                    {foreach $detail.shop_data as $k => $shop}
-                    <tr>
-                        <td>
-                            <div style="text-align: left">
-                                <div class="layui-col-md3">
-                                    <img src="{$shop.logo}" class="image-show image" >
-                                </div>
-                                <div class="layui-col-md9">
-                                    <p style="margin-top: 10px">{$shop.name}</p>
-                                </div>
-                            </div>
-                        </td>
-                    </tr>
-                    {/foreach}
-                    </tbody>
-                </table>
-            </div>
-        </div>
-        {/if}
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>审核状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="status" value="1" title="通过" {if $detail.status}checked{/if}>
-                <input type="radio" name="status" value="2" title="拒绝" {if !$detail.status}checked{/if}>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>审核说明:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <textarea class="layui-textarea"  name="audit_remark"></textarea>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['form'], function () {
-        var form = layui.form;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-    });
-</script>

+ 0 - 155
app/admin/view/community/community_article/detail.html

@@ -1,155 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .div-flex {
-        display: flex;
-        align-items: center;
-        justify-content: left;
-    }
-    .width-160 {
-        width: 200px;
-    }
-    .image {
-        height: 60px;
-        width: 60px;
-        margin-right: 5px;
-    }
-</style>
-
-<div class="layui-card-body">
-    <!--基本信息-->
-    <div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order">
-        <input type="hidden" id="article_id" name="id" value="{$detail.id}">
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>用户信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">昵称:</label>
-            <div class="width-160">{$detail.user.nickname}</div>
-            <label class="layui-form-label ">编号:</label>
-            <div class="width-160">{$detail.user.sn}</div>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>种草内容</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">分类:</label>
-            <div class="width-160">{$detail.cate_name}</div>
-            <label class="layui-form-label ">话题:</label>
-            <div class="width-160">{$detail.topic.name | default= ''}</div>
-            <label class="layui-form-label ">发布时间:</label>
-            <div class="width-160">{$detail.create_time}</div>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">点赞:</label>
-            <div class="width-160">{$detail.like}</div>
-            <label class="layui-form-label ">评论:</label>
-            <div class="width-160">{$detail.comment}</div>
-            <label class="layui-form-label ">审核状态:</label>
-            <div class="width-160">{$detail.status_desc}</div>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">发布内容:</label>
-            <div class="width-160">{$detail.content}</div>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">发布图片:</label>
-            <div>
-                {volist name="detail.images" id="vo"}
-                <img src="{$vo.image}" class="image-show image">
-                {/volist}
-            </div>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">审核时间:</label>
-            <div class="width-160">{$detail.audit_time}</div>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">审核说明:</label>
-            <div class="width-160">{$detail.audit_remark}</div>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>种草数据</legend>
-            </fieldset>
-        </div>
-
-
-        <div class="layui-form-item">
-            <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-                <ul class="layui-tab-title">
-                    <li data-type='comment' class="layui-this">评论</li>
-                    <li data-type='like' >点赞</li>
-                </ul>
-                <div class="layui-tab-item layui-show">
-                        <div class="layui-card-body">
-                            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-                            <script type="text/html" id="table-userInfo">
-                                <div class="layui-inline" style="text-align:left;">
-                                    <p>用户编号:{{d.sn}}</p>
-                                    <p>用户昵称:{{d.nickname}}</p>
-                                </div>
-                            </script>
-                        </div>
-                </div>
-            </div>
-        </div>
-
-    </div>
-</div>
-
-<script type="text/javascript">
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['form', 'table', 'element'], function () {
-        var $ = layui.$;
-        var table = layui.table;
-        var element = layui.element;
-
-        //主图放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src, 400);
-        });
-
-        //获取列表
-        getList('comment');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            var type = $(this).attr('data-type');
-            getList(type);
-        });
-
-        function getList(type) {
-            var cols = [
-                {field: 'user', title: '用户信息', align: 'center', templet: "#table-userInfo"}
-                , {field: 'create_time', title: '点赞时间', align: 'center'}
-            ];
-            if (type === 'comment') {
-                cols = [
-                    {field: 'user', title: '评论用户', align: 'center', templet: "#table-userInfo"}
-                    , {field: 'comment', title: '评论内容', align: 'center'}
-                    , {field: 'create_time', title: '评价时间', align: 'center'}
-                ];
-            }
-            var id = $('#article_id').val();
-            like.tableLists("#like-table-lists", '{:url("community.CommunityArticle/detail")}?type='+ type + '&id=' + id, cols);
-        }
-
-
-    });
-</script>

+ 0 - 217
app/admin/view/community/community_article/lists.html

@@ -1,217 +0,0 @@
-{layout name="layout1" /}
-<style>
-
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*平台管理社区帖子,平台可对贴子进行查看,删除等操作</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索区域 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="keyword" class="layui-form-label">会员信息:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="keyword" name="keyword" autocomplete="off" class="layui-input" placeholder="请输入昵称/编号/手机号">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="content" class="layui-form-label">内容搜索:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="content" name="content" autocomplete="off" class="layui-input" placeholder="请输入种草内容">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="status" class="layui-form-label">审核状态:</label>
-                    <div class="layui-input-inline">
-                        <select name="status" id="status">
-                            <option value="">全部</option>
-                            {foreach $status as $item => $val}
-                            <option value="{$item}">{$val}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">审核时间:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" class="layui-input time" id="start_time" name="start_time"  autocomplete="off">
-                    </div>
-                    <div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
-                        <label class="layui-form-mid">-</label>
-                    </div>
-                    <div class="layui-input-inline">
-                        <input type="text" class="layui-input time" id="end_time" name="end_time"  autocomplete="off">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-            <script type="text/html" id="table-operation">
-                {{#  if(d.status == 0){ }}
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
-                {{#  } }}
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="detail">详情</a>
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
-            </script>
-            <script type="text/html" id="table-image">
-                {{#  layui.each(d.images, function(index, item){ }}
-                <img src="{{item.image}}" style="height:60px;width: 60px;margin-right: 5px;" class="image-show">
-                {{#  }); }}
-            </script>
-            <script type="text/html" id="table-userInfo">
-                <img src="{{d.avatar}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
-                <div class="layui-inline" style="text-align:left;">
-                    <p>编号:{{d.sn}}</p>
-                    <p>昵称:{{d.nickname}}</p>
-                </div>
-            </script>
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.use(["table", "form", "laydate"], function(){
-        var table   = layui.table;
-        var form   = layui.form;
-        var laydate   = layui.laydate;
-
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-        });
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"user",  align:"center",width: 240, title:"会员信息", templet: "#table-userInfo"}
-            ,{field:"content", width: 200,title:"种草内容"}
-            ,{field:"images", width: 250, align:"left", title:"图片", templet: "#table-image"}
-            ,{field:"like", width: 100, align:"center", title:"点赞数"}
-            ,{field:"comment", width: 100,  align:"center", title:"评论数"}
-            ,{field:"status_desc",  width: 120, align:"center", title:"状态"}
-            ,{field:"create_time", width: 180, align:"center", title:"发布时间"}
-            ,{title:"操作", align:"left", fixed:"right",width: 220, toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            audit: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "文章审核"
-                    ,content: "{:url('community.CommunityArticle/audit')}?id=" + obj.data.id
-                    ,area: ["90%", "90%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('community.CommunityArticle/audit')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            detail: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "详情"
-                    ,content: "{:url('community.CommunityArticle/detail')}?id=" + obj.data.id
-                    ,area: ["90%", "90%"]
-                    ,yes: function(index, layero){
-                    }
-                });
-            },
-            del: function(obj) {
-                var name =  "<div style='width:200px;overflow:hidden;text-overflow: ellipsis;white-space:nowrap;'>" +
-                    "<span>确定删除文章:</span>" +
-                    "<span style='color: red;'>"+obj.data.content +"</span></div>";
-
-                layer.confirm(name, function(index) {
-                    like.ajax({
-                        url: "{:url('community.CommunityArticle/del')}",
-                        data: {id: obj.data.id},
-                        type: "POST",
-                        success: function (res) {
-                            if (res.code === 1) {
-                                layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                layer.close(index);
-                                obj.del();
-                            }
-                        }
-                    });
-                    layer.close(index);
-                })
-            }
-        };
-        like.eventClick(active);
-
-
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        form.on("submit(clear-search)", function(){
-            $("#keyword").val("");
-            $("#content").val("");
-            $("#status").val("");
-            $("#start_time").val("");
-            $("#end_time").val("");
-            form.render("select");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-    })
-</script>

+ 0 - 32
app/admin/view/community/community_category/add.html

@@ -1,32 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-card layui-form" style="padding-bottom: 10%">
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label for="name" class="layui-form-label"><span style="color:red;">*</span>分类名称:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="text" name="name" id="name" lay-verify="required" autocomplete="off" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_show" value="1" title="显示" checked>
-                <input type="radio" name="is_show" value="0" title="隐藏" >
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="sort" class="layui-form-label">排序:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="number" name="sort" id="sort" value="255" lay-verType="tips" lay-verify="number" min="0"
-                       autocomplete="off" class="layui-input">
-                <div class=" layui-form-mid layui-word-aux">排序值必须为整数;数值越小,越靠前</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>

+ 0 - 32
app/admin/view/community/community_category/edit.html

@@ -1,32 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-card layui-form" style="padding-bottom: 10%">
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label for="name" class="layui-form-label"><span style="color:red;">*</span>分类名称:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="text" name="name" id="name" value="{$detail.name}" lay-verify="required" autocomplete="off" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>分类状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_show" value="1" title="显示" {if $detail.is_show}checked{/if}>
-                <input type="radio" name="is_show" value="0" title="隐藏" {if !$detail.is_show}checked{/if}>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="sort" class="layui-form-label">排序:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="number" name="sort" id="sort" value="{$detail.sort}" lay-verType="tips" lay-verify="number" min="0"
-                       autocomplete="off" class="layui-input">
-                <div class=" layui-form-mid layui-word-aux">排序值必须为整数;数值越小,越靠前</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>

+ 0 - 191
app/admin/view/community/community_category/lists.html

@@ -1,191 +0,0 @@
-{layout name="layout1" /}
-
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*可对社区文章分类管理,分类有关联话题则不允许删除。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索区域 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="name" class="layui-form-label">分类名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">新增分类</button>
-
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-            <script type="text/html" id="table-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
-            </script>
-            <script type="text/html" id="showTpl">
-                <input type="checkbox" lay-filter="switch-show" data-id={{d.id}} lay-skin="switch"
-                       lay-text="显示|隐藏" {{# if(d.is_show==1){ }} checked {{# } }}/>
-            </script>
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.use(["table", "form"], function(){
-        var table   = layui.table;
-        var form   = layui.form;
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"name",  align:"center", title:"分类名称"}
-            ,{field:"is_show", align:"center", title:"状态",  templet: "#showTpl"}
-            ,{field:"sort", align:"center", title:"排序"}
-            ,{field:"create_time",  align:"center", title:"创建时间"}
-            ,{title:"操作", align:"center", fixed:"right", toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            add: function() {
-                layer.open({
-                    type: 2
-                    ,title: "新增分类"
-                    ,content: "{:url('community.CommunityCategory/add')}"
-                    ,area: ["60%", "60%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            like.ajax({
-                                url: "{:url('community.CommunityCategory/add')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            edit: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "编辑分类"
-                    ,content: "{:url('community.CommunityCategory/edit')}?id=" + obj.data.id
-                    ,area: ["60%", "60%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('community.CommunityCategory/edit')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            del: function(obj) {
-                var cateName =  "<span style='color: red'>"+obj.data.name+"</span>";
-                layer.confirm("确定删除分类:"+cateName, function(index) {
-                    like.ajax({
-                        url: "{:url('community.CommunityCategory/del')}",
-                        data: {id: obj.data.id},
-                        type: "POST",
-                        success: function (res) {
-                            if (res.code === 1) {
-                                layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                layer.close(index);
-                                obj.del();
-                            }
-                        }
-                    });
-                    layer.close(index);
-                })
-            }
-        };
-        like.eventClick(active);
-
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        form.on("submit(clear-search)", function(){
-            $("#name").val("");
-            form.render("select");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        // 状态切换
-        form.on('switch(switch-show)', function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var show = 0;
-            if (obj.elem.checked) {
-                show = 1;
-            }
-            var data = {is_show: show, id: id};
-            like.ajax({
-                url: '{:url("community.CommunityCategory/status")}',
-                data: data,
-                type: "post",
-                success: function (res) {
-                    if (res.code === 1) {
-                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                    }
-                }
-            });
-        });
-
-    })
-</script>

+ 0 - 46
app/admin/view/community/community_comment/audit.html

@@ -1,46 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-card layui-form" style="padding-bottom: 10%">
-    <div class="layui-card-body">
-        <input type="hidden" name="id" value="{$detail.id}">
-        <div class="layui-form-item">
-            <label  class="layui-form-label">种草内容:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <div class="layui-card-body">
-                    {$detail.article.content}
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label  class="layui-form-label">评价内容:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <div class="layui-card-body">
-                    {$detail.comment}
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">审核:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="status" value="1" title="审核通过" {if $detail.status}checked{/if}>
-                <input type="radio" name="status" value="2" title="审核拒绝" {if !$detail.status}checked{/if}>
-            </div>
-        </div>
-
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['form'], function () {
-        var form = layui.form;
-    });
-</script>

+ 0 - 188
app/admin/view/community/community_comment/lists.html

@@ -1,188 +0,0 @@
-{layout name="layout1" /}
-<style>
-
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*可对社区文章评论进行管理审核.</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索区域 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="keyword" class="layui-form-label">会员信息:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="keyword" name="keyword" autocomplete="off" class="layui-input" placeholder="请输入昵称/编号/手机号">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="comment" class="layui-form-label">内容搜索:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="comment" name="comment" autocomplete="off" class="layui-input" placeholder="请输入评论内容">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="status" class="layui-form-label">审核状态:</label>
-                    <div class="layui-input-inline">
-                        <select name="status" id="status">
-                            <option value="">全部</option>
-                            {foreach $status as $item => $val}
-                            <option value="{$item}">{$val}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-            <script type="text/html" id="table-operation">
-                {{#  if(d.status == 0){ }}
-                    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
-                {{#  } }}
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
-            </script>
-            <script type="text/html" id="table-userInfo">
-                <img src="{{d.avatar}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
-                <div class="layui-inline" style="text-align:left;">
-                    <p>编号:{{d.sn}}</p>
-                    <p>昵称:{{d.nickname}}</p>
-                </div>
-            </script>
-            <script type="text/html" id="table-articleContent">
-                <div>{{d.article.content}}</div>
-            </script>
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.use(["table", "form", "laydate"], function(){
-        var table   = layui.table;
-        var form   = layui.form;
-        var laydate   = layui.laydate;
-
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-        });
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"user",  align:"center",width: 240, title:"会员信息", templet: "#table-userInfo"}
-            ,{field:"article_content", width: 250,title:"种草内容", templet: "#table-articleContent"}
-            ,{field:"comment", width: 300,title:"评价内容"}
-            ,{field:"topic_name", width: 150, align:"center",title:"话题"}
-            ,{field:"status_desc",  width: 120, align:"center", title:"审核状态"}
-            ,{field:"create_time", width: 180, align:"center", title:"评论时间"}
-            ,{title:"操作", align:"left", fixed:"right",width: 160, toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            audit: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "评论审核"
-                    ,content: "{:url('community.CommunityComment/audit')}?id=" + obj.data.id
-                    ,area: ["60%", "60%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('community.CommunityComment/audit')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            del: function(obj) {
-                var comment =  "<div style='width:200px;overflow:hidden;text-overflow: ellipsis;white-space:nowrap;'>" +
-                    "<span>确定删除评论:</span>" +
-                    "<span style='color: red;'>"+obj.data.comment +"</span></div>";
-                layer.confirm(comment, function(index) {
-                    like.ajax({
-                        url: "{:url('community.CommunityComment/del')}",
-                        data: {id: obj.data.id},
-                        type: "POST",
-                        success: function (res) {
-                            if (res.code === 1) {
-                                layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                layer.close(index);
-                                obj.del();
-                            }
-                        }
-                    });
-                    layer.close(index);
-                })
-            }
-        };
-        like.eventClick(active);
-
-
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        form.on("submit(clear-search)", function(){
-            $("#keyword").val("");
-            $("#comment").val("");
-            $("#status").val("");
-            form.render("select");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-    })
-</script>

+ 0 - 89
app/admin/view/community/community_setting/setting.html

@@ -1,89 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-form-label {
-        width: 120px;
-    }
-    .layui-input-block {
-        margin-left: 150px;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-            <!--操作提示-->
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*设置是否启用种草功能,以及文章和评论相关审核设置,默认都开启审核</p>
-                    </div>
-                </div>
-            </div>
-
-            <!--表单区域-->
-            <div class="layui-form" style="margin-top: 15px;">
-                <div class="layui-field-box">
-                    <div class="layui-form-item">
-                        <lable class="layui-form-label">种草功能:</lable>
-                        <div class="layui-input-block" style="width:300px;">
-                            <input type="radio" name="status" value="1" title="开启" {if $config.status == 1} checked {/if}>
-                            <input type="radio" name="status" value="0" title="关闭" {if !$config.status} checked {/if}>
-                        </div>
-                    </div>
-                    <div class="layui-form-item">
-                        <lable class="layui-form-label">文章审核:</lable>
-                        <div class="layui-input-block" style="width:300px;">
-                            <input type="radio" name="audit_article" value="1" title="开启" {if $config.audit_article == 1} checked {/if}>
-                            <input type="radio" name="audit_article" value="0" title="关闭" {if !$config.audit_article} checked {/if}>
-                        </div>
-                    </div>
-                    <div class="layui-form-item">
-                        <lable class="layui-form-label">评论审核:</lable>
-                        <div class="layui-input-block" style="width:300px;">
-                            <input type="radio" name="audit_comment" value="1" title="开启" {if $config.audit_comment == 1} checked {/if}>
-                            <input type="radio" name="audit_comment" value="0" title="关闭" {if !$config.audit_comment} checked {/if}>
-                        </div>
-                    </div>
-                </div>
-
-                <div class="layui-form-item">
-                    <lable class="layui-form-label"></lable>
-                    <div class="layui-input-block">
-                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="set">确定</button>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/'
-    }).use(['form','element'], function(){
-        var $ = layui.$,
-            form = layui.form,
-            element = layui.element;
-
-        form.on('submit(set)', function(data) {
-            like.ajax({
-                url:'{:url("community.CommunitySetting/setting")}',
-                data: data.field,
-                type:"post",
-                success:function(res)
-                {
-                    if(res.code == 1)
-                    {
-                        layui.layer.msg(res.msg, {
-                            offset: '15px'
-                            , icon: 1
-                            , time: 1000
-                        });
-                    }
-                }
-            });
-        });
-
-    });
-</script>

+ 0 - 80
app/admin/view/community/community_topic/add.html

@@ -1,80 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-card layui-form" >
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label for="name" class="layui-form-label"><span style="color:red;">*</span>话题名称:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="text" name="name" id="name" lay-verify="required" autocomplete="off" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>话题图标:</label>
-            <div class="layui-input-block">
-                <div class="like-upload-image" switch-tab="0" lay-verType="tips">
-                    <div class="upload-image-elem"><a class="add-upload-image"> + 添加</a></div>
-                </div>
-                <div class="layui-form-mid layui-word-aux">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="cid" class="layui-form-label"><span style="color:red;">*</span>关联分类:</label>
-            <div class="layui-input-inline">
-                <select name="cid" id="cid" lay-verType="tips" lay-verify="required">
-                    <option value="">全部</option>
-                    {volist name="cate" id="vo"}
-                    <option value="{$vo.id}">{$vo.name}</option>
-                    {/volist}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">推荐:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_recommend" value="1" title="是" >
-                <input type="radio" name="is_recommend" value="0" title="否" checked>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_show" value="1" title="显示" checked>
-                <input type="radio" name="is_show" value="0" title="隐藏" >
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="sort" class="layui-form-label">排序:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="number" name="sort" id="sort" value="255" lay-verType="tips" lay-verify="number" min="0"
-                       autocomplete="off" class="layui-input">
-                <div class=" layui-form-mid layui-word-aux">排序值必须为整数;数值越小,越靠前</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['form'], function () {
-        var form = layui.form;
-
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        });
-    });
-</script>

+ 0 - 90
app/admin/view/community/community_topic/edit.html

@@ -1,90 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-card layui-form" style="padding-bottom: 10%">
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label for="name" class="layui-form-label"><span style="color:red;">*</span>话题名称:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="text" name="name" id="name" value="{$detail.name}" lay-verify="required" autocomplete="off" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>话题图标:</label>
-            <div class="layui-input-block">
-                <div class="like-upload-image">
-                    {if $detail.image}
-                    <div class="upload-image-div">
-                        <img src="{$detail.image}" alt="img">
-                        <input type="hidden" name="image" value="{$detail.image}">
-                        <div class="del-upload-btn">x</div>
-                    </div>
-                    <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a></div>
-                    {else}
-                    <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-                    {/if}
-                </div>
-                <div class="layui-form-mid layui-word-aux">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="cid" class="layui-form-label">关联分类:</label>
-            <div class="layui-input-inline">
-                <select name="cid" id="cid" lay-verType="tips" lay-verify="required">
-                    <option value="">全部</option>
-                    {volist name="cate" id="vo"}
-                    <option value="{$vo.id}" {if $detail.cid==$vo.id}selected{/if}>{$vo.name}</option>
-                    {/volist}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">推荐:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_recommend" value="1" title="显示" {if $detail.is_recommend}checked{/if}>
-                <input type="radio" name="is_recommend" value="0" title="隐藏" {if !$detail.is_recommend}checked{/if}>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_show" value="1" title="是" {if $detail.is_show}checked{/if}>
-                <input type="radio" name="is_show" value="0" title="否" {if !$detail.is_show}checked{/if}>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="sort" class="layui-form-label">排序:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <input type="number" name="sort" id="sort" value="{$detail.sort}" lay-verType="tips" lay-verify="number" min="0"
-                       autocomplete="off" class="layui-input">
-                <div class=" layui-form-mid layui-word-aux">排序值必须为整数;数值越小,越靠前</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['form'], function () {
-        var form = layui.form;
-
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        });
-    });
-</script>

+ 0 - 239
app/admin/view/community/community_topic/lists.html

@@ -1,239 +0,0 @@
-{layout name="layout1" /}
-
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*可对社区话题管理,用户发布文章时需要选择对应的话题.话题下关联文章则不允许删除话题</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索区域 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="name" class="layui-form-label">话题名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="cate" class="layui-form-label">话题分类:</label>
-                    <div class="layui-input-inline">
-                        <select name="cid" id="cate">
-                            <option value="">全部</option>
-                            {volist name="cate" id="vo"}
-                            <option value="{$vo.id}">{$vo.name}</option>
-                            {/volist}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">新增话题</button>
-
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-            <script type="text/html" id="table-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
-            </script>
-            <script type="text/html" id="showTpl">
-                <input type="checkbox" lay-filter="switch-show" data-id={{d.id}} lay-skin="switch"
-                       lay-text="显示|隐藏" {{# if(d.is_show==1){ }} checked {{# } }}/>
-            </script>
-            <script type="text/html" id="recommendTpl">
-                <input type="checkbox" lay-filter="switch-recommend" data-id={{d.id}} lay-skin="switch"
-                       lay-text="是|否" {{# if(d.is_recommend==1){ }} checked {{# } }}/>
-            </script>
-            <script type="text/html" id="table-image">
-                {{#  if(d.image){ }}
-                <img src="{{d.image}}" class="image-show" alt="图" style="width:80px;height:80px;">
-                {{#  } }}
-            </script>
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.use(["table", "form"], function(){
-        var table   = layui.table;
-        var form   = layui.form;
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"name",  align:"center", title:"话题名称"}
-            ,{field:"image",  align:"center", title:"话题图标", templet: "#table-image"}
-            ,{field:"cate_name",  align:"center", title:"关联分类"}
-            ,{field:"article_num",  align:"center", title:"文章数量"}
-            ,{field:"sort", align:"center", title:"排序"}
-            ,{field:"is_recommend", align:"center", title:"是否推荐",  templet: "#recommendTpl"}
-            ,{field:"is_show", align:"center", title:"是否显示",  templet: "#showTpl"}
-            ,{title:"操作", align:"center", fixed:"right", toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            add: function() {
-                layer.open({
-                    type: 2
-                    ,title: "新增话题"
-                    ,content: "{:url('community.CommunityTopic/add')}"
-                    ,area: ["90%", "90%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            like.ajax({
-                                url: "{:url('community.CommunityTopic/add')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            edit: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "编辑话题"
-                    ,content: "{:url('community.CommunityTopic/edit')}?id=" + obj.data.id
-                    ,area: ["90%", "90%"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('community.CommunityTopic/edit')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            del: function(obj) {
-                var cateName =  "<span style='color: red'>"+obj.data.name+"</span>";
-                layer.confirm("确定删除话题:"+cateName, function(index) {
-                    like.ajax({
-                        url: "{:url('community.CommunityTopic/del')}",
-                        data: {id: obj.data.id},
-                        type: "POST",
-                        success: function (res) {
-                            if (res.code === 1) {
-                                layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                                layer.close(index);
-                                obj.del();
-                            }
-                        }
-                    });
-                    layer.close(index);
-                })
-            }
-        };
-        like.eventClick(active);
-
-
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        form.on("submit(clear-search)", function(){
-            $("#name").val("");
-            $("#cate").val("");
-            form.render("select");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        // 状态切换
-        form.on('switch(switch-show)', function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var show = 0;
-            if (obj.elem.checked) {
-                show = 1;
-            }
-            var data = {field: 'is_show', value:show, id: id};
-            updateField(data);
-        });
-
-        // 状态切换
-        form.on('switch(switch-recommend)', function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var recommend = 0;
-            if (obj.elem.checked) {
-                recommend = 1;
-            }
-            var data = {field: 'is_recommend', value:recommend, id: id};
-            updateField(data);
-        });
-
-
-        function updateField(data) {
-            like.ajax({
-                url: '{:url("community.CommunityTopic/status")}',
-                data: data,
-                type: "post",
-                success: function (res) {
-                    if (res.code === 1) {
-                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                    }
-                }
-            });
-        }
-
-
-    })
-</script>