这个是前端局部的,内容具体页面,也是接着前天更新的进行欠缺的性能的,心愿本文章能够帮到大家的学习和应用。
在线文库网站程序源码,也是一款不错的手机微信文库网站零碎网站平台,反对手机在线观看下载文档。
这个模块波及手机版局部的首页展现
列表功能模块
namespace app\index\controller;
use think\facade\View;
use think\facade\Db;
use app\index\model\Cat_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();}