This commit is contained in:
zhao 2020-02-12 15:08:52 +08:00
parent f49998fb99
commit f575441479
7 changed files with 29 additions and 37 deletions

View File

@ -1,8 +1,14 @@
# TaoLer
版本: TaoLer 1.0.0
日期: 2020.1.1
官网: http://www.aieok.com
版本TaoLer 1.0.0
日期2020.1.1
官网http://www.aieok.com
#### 项目地址
gitee https://www.gitee.com/toogee/Taoler
github https://www.github.com/taoser/TaoLer
#### 介绍
1. 采用动态密码加密,相同密码在入库时具有唯一性,即使管理员也无法破解,用户信息安全牢固。
@ -28,9 +34,9 @@
1. git下载https://gitee.com/toogee/TaoLer
2. 官网下载http://www.aieok.com
3. 解压后,项目域名部署为public目录对外访问首页安装访问http://www.youdomain.com可自动跳转到/install.php/index,如果重新安装需删除根目录下install.lock。
4. 安装前需要先建立好数据库(需求:数据库连接地址,数据库用户名,数据库密码,数据库端口,数据库名)
5. 安装过程注意记录好设置的管理员用户名和密码默认admin/123456。前后台的管理员密码一致。安装好后,前后端管理员是分开的,前端主要对文章内容的审查,置顶等操作。
3. 解压后,项目绑定域名为public目录对外访问首次安装访问域名http://www.youdomain.com可自动跳转到/install.php/index进行引导安装重新安装需删除根目录下install.lock。
4. 安装前需要先创建mysql数据库(准备:数据库连接地址,数据库用户名,数据库密码,数据库端口,建好在数据库名)
5. 请牢记安装设置的管理员用户名和密码默认admin/123456。前后台的管理员密码一致。前后端管理员账户是独立的,前端主要对文章内容的审查管理等操作。
#### 使用说明

View File

@ -31,7 +31,7 @@ class Article extends Model
//文章关联评论
public function comments()
{
return $this->hasMany('Comment','article_id','id');
return $this->hasMany(Comment::class);
}
//文章关联用户

View File

@ -92,10 +92,10 @@ class Article extends BaseController
}
//文章详情页
public function detail($id = 1)
public function detail($id)
{
//获取文章ID
$id = Request::param('id');
//$id = Request::param('id');
//查询文章
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,create_time')->where('status',1)->with([
'cate' => function($query){
@ -104,7 +104,8 @@ class Article extends BaseController
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id');
}
])->withCount(['comments'])->find($id);
])->find($id);
$comments = $article->comments()->where('status',1)->select();
$article->inc('pv')->update();
/*
@ -129,7 +130,7 @@ class Article extends BaseController
//通用右栏
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
View::assign(['article'=>$article,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm]);
View::assign(['article'=>$article,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm]);
return View::fetch();
}

View File

@ -1,13 +0,0 @@
<?php
namespace app\index\controller;
use app\common\controller\BaseController;
class FriendLink extends BaseController
{
public function link()
{
}
}

View File

@ -18,13 +18,12 @@ class Sign extends BaseController
{
parent::_initialize();
$this->uid = session('user_id');
}
public function lists()
{
//总榜
$totallist = Db::name('user_sign')->alias('s')->join('user u', 's.uid=u.id', 'LEFT')->field('s.uid,s.id,max(s.days) as days,u.name as name,u.user_img as user_img')->group('s.uid')->order('days desc')->limit(20)->select();
$list = Db::name('user_sign')->alias('s')->leftJoin('user u', 's.uid=u.id')->field('uid,s.id as id,max(days) as days,name,user_img')->group('uid')->order('days desc')->limit(20)->select();
$time = time();
$start_stime = strtotime(date('Y-m-d 0:0:0', $time)) - 1;
$end_stime = strtotime(date('Y-m-d 23:59:59', $time)) + 1;
@ -70,7 +69,7 @@ class Sign extends BaseController
$score = $todayData['will_getscore'];
$date=date('Ymd');
$msg='';
$teshudate=['20180215','20180216','20180217','20180218','20180219','20180220','20180221'];
$teshudate=['20200214','20200501','20201001'];
//签到奖励
if(in_array($date,$teshudate)){
$randnum=rand(1,99);
@ -89,9 +88,8 @@ class Sign extends BaseController
}
return json(['code'=>200,'score'=>$score,'days'=>$days,'msg'=>$msg]);
// exit('{"code":200,"score":"' . $score . '","days":"' . $days . '"}');
} else {
exit('{"code":-1,"msg":"签到失败,请刷新后重试!"}');
return json(['code'=>-1,'msg'=>'签到失败,请刷新后重试!']);
}
}
}

View File

@ -43,7 +43,7 @@
</div>
<span class="fly-list-nums">
<a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> {$article.comments_count} </a>
<a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> {$comments->count()} </a>
<i class="iconfont" title="人气">&#xe60b;</i> {$article.pv}
</span>
</div>
@ -84,7 +84,7 @@
</fieldset>
<ul class="jieda" id="jieda">
{volist name="article.comments" id="vo"}
{volist name="comments" id="vo"}
<li data-id="{$vo.id}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
@ -95,8 +95,8 @@
<a href="{:url('user/home',['id'=>$vo.user.id])}" class="fly-link">
<i class="layui-badge layui-bg-green " title="来自哪里简称">{:getAsing($vo.user.area_id) ?: '无'}</i>
<cite>{$vo.user.nickname ?: $vo.user.name}</cite>
<i class="iconfont icon-renzheng" title="认证信息XXX"></i>
<i class="layui-badge fly-badge-vip">VIP3</i>
<!--i class="iconfont icon-renzheng" title="认证信息XXX"></i>
<i class="layui-badge fly-badge-vip">VIP3</i-->
</a>
{if condition="$article.user.id eq $vo.user.id"}
<span>(楼主)</span>
@ -178,7 +178,7 @@
{volist name="artHot" id="vo"}
<dd>
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
<span><i class="iconfont icon-pinglun1"></i> {$comments->total()}</span>
</dd>
{/volist}

View File

@ -104,7 +104,7 @@
<ul class="layui-tab-item layui-show">
{volist name="newlist" id="vo" empty="暂无数据"}
<li>
<a href="{:url('user/index/home',array('id'=>$vo.uid))}" target="_blank">
<a href="{:url('user/home',array('id'=>$vo.uid))}" target="_blank">
<img src="{$vo.user_img}">
<cite class="fly-link">{$vo.name}</cite>
</a>
@ -116,7 +116,7 @@
<ul class="layui-tab-item">
{volist name="fastlist" id="vo" empty="今天还没有人签到"}
<li>
<a href="{:url('user/index/home',array('id'=>$vo.uid))}" target="_blank">
<a href="{:url('user/home',array('id'=>$vo.uid))}" target="_blank">
<img src="{$vo.user_img}">
<cite class="fly-link">{$vo.name}</cite>
</a>
@ -127,7 +127,7 @@
<ul class="layui-tab-item">
{volist name="totallist" id="vo" empty="暂无数据"}
<li>
<a href="{:url('user/index/home',array('id'=>$vo.uid))}" target="_blank">
<a href="{:url('user/home',array('id'=>$vo.uid))}" target="_blank">
<img src="{$vo.user_img}">
<cite class="fly-link">{$vo.name}</cite>
</a>