0、请不要问“在不在”之类的问题,有问题直接问!1、学生或暂时没有工作的童鞋,整站资源免费下载!2、¥9.9充值终身VIP会员,加我微信,826096331 拉你进VIP群学习!3、程序员加油,技术改变世界。 在线 充值
php mysql书城_php在线书城 thinkphp源码(含数据库脚本)
本类由系统自动生成,仅供测试用途
class IndexAction extends PublicAction {
public function index(){
//公告板
$notice=M('Notice');
$notice=$notice->limit(8)->select();
$this->assign('notice',$notice);
$book=M('Book');
//强力推荐
$abook=$book->table('book_book as a,book_cats as b')->where("a.book_cat=b.cat_id and a.flags like '%a%'")->limit(7)->select();
$this->assign('abook',$abook);
//最新完本
$endbook=$book->table('book_book as a,book_cats as b')->order('a.public_time')->where('a.book_cat=b.cat_id and a.progress=59')->limit(7)->select();
$this->assign('endbook',$endbook);
//封面推荐
$bbook=$book->table('book_book as a,book_cats as b')->where("a.book_cat=b.cat_id and a.flags like '%b%'")->limit(3)->select();
$this->assign('bbook',$bbook);
//最新上架
$newbook=$book->table('book_book as a,book_cats as b')->order('a.public_time')->where('a.book_cat=b.cat_id')->limit(12)->select();
$this->assign('newbook',$newbook);
//编辑推荐
$bianji=$book->table('book_book as a,book_cats as b')->where("a.book_cat=b.cat_id and a.flags like '%c%'")->select();
$this->assign('bianji',$bianji);
//精品推荐
$jingpin=$book->table('book_book as a,book_cats as b')->where("a.book_cat=b.cat_id and a.flags like '%d%'")->select();
$this->assign('jingpin',$jingpin);
//最近更新
$book=D('Book');
$newUpdate=$book->relation(true)->select();
// dump($newUpdate);
$this->assign('newUpdate',$newUpdate);
//热评榜
$book=M('Book');
$hots=$book->order('hits asc')->select();
$this->assign('hots',$hots);
//最新评论
$comment=D('Comment');
$comment=$comment->relation(true)->order('time desc')->select();
$this->assign('comment',$comment);
//会员积分排行榜
$user_info=M('User_info');
$user_info=$user_info->order('user_score desc')->select();
$this->assign('user_info',$user_info);
//友情链接
$link=M('Link');
$links=$link->where('status=1')->limit(32)->select();
$this->assign('links',$links);
//显示模板
$this->display();
}
}
————————————————
版权声明:本文为CSDN博主「四号学长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_34474777/article/details/113266722
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群