app/admin/controller/Article.php

(开头部分) 20KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 人人站CMS
 * ============================================================================
 * 版权所有 2015-2030 山东康程信息科技有限公司,并保留所有权利。
 * 网站地址: http://www.rrzcms.com
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 */

namespace app\admin\controller;

use app\admin\model\Articles;

class Article extends Base
{

    /**
     * 文章列表
     * @return false|string
     * @throws \Exception
     */
    function index() {
        $checkType = I('get.checkType');
        $nodeId = I('get.node_id');
        $this->pagedata['tabs'] = [
            ['name' => '文章列表', 'class' => 'current',],
            $checkType ? false : ['name' => '文章栏目', 'url' => U('Article/nodes'),],
            $checkType ? false : ['name' => '文章模型', 'url' => U('Channeltype/index', ['type' => 'articles',]),],
        ];
        $search = $_POST['search'] ?? [];
        if ($this->request->isPost() && $nodeId && (!isset($search['node_id']) || !$search['node_id'])) {
            $nodeId = null;
        }
        $node = [];
        $nodeList = [
            '' => '',
        ];
        if (!$this->request->isPost()) {

            if ($nodeId && is_numeric($nodeId)) {
                $node = M('article_nodes')->where('id', $nodeId)->field('id,name')->find();
                $node and $search['node_id'] = $nodeId;
            }

            $nodes = M('article_nodes')->field('id,name,depth,id_path')
                ->order('path asc,id asc')
                ->select()->toArray();
            $nodes = tierMenusList($nodes);
            foreach ($nodes as $item) {
                $name = str_repeat('&nbsp;', ($item['depth'] - 1) * 4) . $item['name'];
                $nodeList[$item['id']] = $name;
            }
        }
        $this->pagedata['search'] = [
            ['tag' => 'input', 'name' => 'a.title|has|trim', 'placeholder' => '文章标题',],
            ['tag' => 'select', 'name' => 'node_id', 'placeholder' => '文章栏目', 'value' => $node['id'] ?? '', 'options' => $nodeList,],
            ['tag' => 'select', 'name' => 'a.ifpub', 'placeholder' => '发布', 'options' => ['' => '全部', 'true' => '是', 'false' => '否',],],
        ];
后面还有 410 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。