栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

文库网站建设小说在线阅读源码分享

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

文库网站建设小说在线阅读源码分享

文库是指网上的开放供网友在线分享文档的平台,能够提供原创系统性知识的网站。现在的文库网站具有很大的营销能力,同时具有很大的广告能力。

我们的文库网站支持doc、docx 、ppt、 pptx、 pdf等主流文档格式。

下面源码分电脑端和手机端

​列表功能模块

namespace appindexcontroller;

use thinkfacadeView;
use thinkfacadeDb;
use appindexmodelCat_tree as CatTree;

class Doclist extends Common
{
    public function index()
    {
        return View::fetch();
    }
    public function report()
    {
        print_r(111);
    }

    public function Type()
    {
        //获取到id
        $id = input('id','');
        // 接收路由v参数
        $v1 = input('v');
        // 接收路由d参数
        $d = input('d');

        // 查被点击的单条
        $cateid = Db::name('category')->where('id', $id)->find();
        $title = $cateid['type'];

        // 导航第二级
        $parent = Db::name('category') ->where('id',$cateid['parent_id'])->find();
        // 导航第一级
        $Parent = Db::name('category') ->where('id',$parent['parent_id'])->find();
        // id查被点击的父级下的全部
        $category = Db::name('category')->where('parent_id', $id)->select();
        //父级id查出父级下的全部子类
        $CateGory = Db::name('category')->where('parent_id', $cateid['parent_id'])->select();
        // 优秀作者
        $User = Db::name('user')->order('upload_data', 'desc')->find();
        // 优秀作者的文章
        $Article = Db::name('article')->where('uid', $User['uid'])->order('download', 'desc')->limit(3)->select();
       
        // 其他作者
        $ThinkUser = Db::name('user')->order('upload_data', 'desc')->limit(4)->select();
        unset($ThinkUser[0]);
        // 相关推荐(下载量最多)
        $ThinkArticle = Db::name('article')->order('download', 'desc')->limit(5)->select();
        // 热门标签
        $Hot = Db::name('category')->where('recom',1)->select();

        $Catesonid = CatTree::get_AllCate($cateid['id']);
        $Catesonid = rtrim($Catesonid,',');
        $where[] = ['cateid','in',$Catesonid];




        $cc = [];
        if($v1 == 1){
            $cc = ['vip_only'=>1];
        }elseif($v1 == 2){
            $cc = ['vip_free'=>1];
        }elseif($v1 == 3){
            $cc = ['ShareType'=>1];
        }

        if($d == 1){
            $Newarticle = Db::name('article')->where($where)->where($cc)->order('download','desc')->limit(15)->paginate();
            
        }elseif($d == 2){
           $Newarticle = Db::name('article')->where($where)->where($cc)->order('update_time','desc')->limit(15)->paginate();
        }elseif($d == 3){
            $Newarticle = Db::name('article')->where($where)->where($cc)->order('hits','desc')->limit(15)->paginate();
        }else{
            // 文档
            $Newarticle = Db::name('article')->where($where)->where($cc)->limit(15)->paginate();
        }

 手机部分的分类

 

//手机分类二级
    public function m_cate(){
        $first = input('first');

        $m_twocate = Db::name('category')->where('parent_id',$first)->select();
        if(!empty($m_twocate)){
            return json(['code'=>1,'data'=>$m_twocate]);
        }


    }

    //手机分类三级
    public function m_cate_three(){
        $second = input('second');
        $m_threecate = Db::name('category')->where('parent_id',$second)->select();

        if(!empty($m_threecate)){
            return json(['code'=>22,'data'=>$m_threecate]);
        }
    }

 列表展开

getCode('https://www.grcc.vip/article-4267.html');

        $id = request()->param('id');

        //面包削的查询
        $title_list = (new DocModel())->titleList($id);
        //文档信息
        $doc_detail = (new DocModel())->docDetail($id);

        //作者信息查询
        $author = (new DocModel())->authorInformation($doc_detail['uid']);

        //关注判断
        $follow = Db::name('user_follow')->where('fans_uid',session('user')['uid'])->where('friend_uid',$author['uid'])->find();

        //作者文档展示
        $author_doc = (new DocModel())->authorDoc($doc_detail['uid']);

        $aaa = Db::name('article')->where('id',$id)->find();
        //导航标题
        $title = $aaa['title'];
        //相关推荐
        $related = (new DocModel())->relatedList($doc_detail['cateid']);
        //文档图片展示
        $show_doc = (new DocModel())->showDoc($id);

        $show_doc = html_entity_decode($show_doc['data'],ENT_QUOTES, 'UTF-8');
        //剩余页码的查询
        $numpages = (new DocModel())->numPages($id);
        //查询是否收藏
        $is_collect = (new DocModel())->isCollect($id);
        View::assign([
            'title' =>$title,
            'title_list'=>$title_list,
            'doc_detail'=>$doc_detail,
            'author'=>$author,
            'author_doc'=>$author_doc,
            'related'=>$related,
            'show_doc'=>$show_doc,
            'numpages'=>$numpages,
            'is_collect'=>$is_collect,
            'follow' => $follow,
        ]);
        return View::fetch();
    }

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1032469.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号