1.9.7
This commit is contained in:
parent
bdf3421b9d
commit
c528ef2e16
@ -12,6 +12,8 @@
|
|||||||
2. github https://www.github.com/taoser/TaoLer
|
2. github https://www.github.com/taoser/TaoLer
|
||||||
3. composer create-project taoser/taoler
|
3. composer create-project taoser/taoler
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
|
|
||||||
1. 采用动态密码加密,相同密码在入库时具有唯一性,即使管理员也无法破解,用户信息安全牢固。
|
1. 采用动态密码加密,相同密码在入库时具有唯一性,即使管理员也无法破解,用户信息安全牢固。
|
||||||
@ -24,6 +26,7 @@
|
|||||||
8. 项目会长期维护,优化更新。
|
8. 项目会长期维护,优化更新。
|
||||||
9. 预增加插件管理机制1.0(2.0版本正式上线)
|
9. 预增加插件管理机制1.0(2.0版本正式上线)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
#### 构架组成
|
#### 构架组成
|
||||||
- 1.x版本构架:
|
- 1.x版本构架:
|
||||||
@ -39,6 +42,8 @@
|
|||||||
Fly模板:
|
Fly模板:
|
||||||
一款至简的社区模板。
|
一款至简的社区模板。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
#### 安装教程
|
#### 安装教程
|
||||||
|
|
||||||
1. 首选确保满目使用环境要求,php > 7.2, mysql > 5.7.3
|
1. 首选确保满目使用环境要求,php > 7.2, mysql > 5.7.3
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: TaoLer <alipey_tao@qq.com>
|
* @Author: TaoLer <alipey_tao@qq.com>
|
||||||
* @Date: 2022-04-13 09:54:31
|
* @Date: 2022-04-13 09:54:31
|
||||||
* @LastEditTime: 2022-04-29 17:24:47
|
* @LastEditTime: 2022-05-02 11:54:00
|
||||||
* @LastEditors: TaoLer
|
* @LastEditors: TaoLer
|
||||||
* @Description: 搜索引擎SEO优化设置
|
* @Description: 搜索引擎SEO优化设置
|
||||||
* @FilePath: \TaoLer\app\admin\controller\Seo.php
|
* @FilePath: \TaoLer\app\admin\controller\Seo.php
|
||||||
@ -317,6 +317,8 @@ class Seo extends AdminController
|
|||||||
{
|
{
|
||||||
$time = input('search_time');
|
$time = input('search_time');
|
||||||
$name = input('spider_name');
|
$name = input('spider_name');
|
||||||
|
$page = input('page') ? input('page') : 1;
|
||||||
|
$limit = input('limit') ? input('limit') : 20;
|
||||||
$logPath = app()->getRootPath().'runtime/log/browse/'.$time.'.log';
|
$logPath = app()->getRootPath().'runtime/log/browse/'.$time.'.log';
|
||||||
$logPath = str_replace('\\','/',$logPath);
|
$logPath = str_replace('\\','/',$logPath);
|
||||||
if(!file_exists($logPath)) {
|
if(!file_exists($logPath)) {
|
||||||
@ -324,6 +326,7 @@ class Seo extends AdminController
|
|||||||
}
|
}
|
||||||
$log = file_get_contents($logPath);
|
$log = file_get_contents($logPath);
|
||||||
$log = preg_replace('/\[info\][^\n]*compatible;/', '', $log);
|
$log = preg_replace('/\[info\][^\n]*compatible;/', '', $log);
|
||||||
|
$log = preg_replace('/\[info\][^\n]*(?=YisouSpider)/', ' ', $log);
|
||||||
|
|
||||||
switch($name) {
|
switch($name) {
|
||||||
case 'Baiduspider':
|
case 'Baiduspider':
|
||||||
@ -340,7 +343,7 @@ class Seo extends AdminController
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// 正则全部蜘蛛
|
// 正则全部蜘蛛
|
||||||
preg_match_all('/(.*?)(?:bingbot|Googlebot|Baiduspider|Bytespider|SemrushBot|AhrefsBot|MJ12bot)+[^\n]*\r?\n/',$log,$arr);
|
preg_match_all('/(.*?)(?:bingbot|Googlebot|Baiduspider|Bytespider|360Spider|YisouSpider|Sosospider|Sogou News Spider|SemrushBot|AhrefsBot|MJ12bot)+[^\n]*\r?\n/',$log,$arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $string = '';
|
// $string = '';
|
||||||
@ -355,6 +358,7 @@ class Seo extends AdminController
|
|||||||
// } else {
|
// } else {
|
||||||
// return json(['code'=>-1,'msg'=>'还没有蜘蛛来哦']);
|
// return json(['code'=>-1,'msg'=>'还没有蜘蛛来哦']);
|
||||||
// }
|
// }
|
||||||
|
$data = [];
|
||||||
$list = [];
|
$list = [];
|
||||||
if(count($arr[0])) {
|
if(count($arr[0])) {
|
||||||
$list['code']= 0;
|
$list['code']= 0;
|
||||||
@ -363,22 +367,35 @@ class Seo extends AdminController
|
|||||||
foreach($arr[0] as $k =>$str) {
|
foreach($arr[0] as $k =>$str) {
|
||||||
// $str = preg_replace('/\[(.*?)T/', '', $str);
|
// $str = preg_replace('/\[(.*?)T/', '', $str);
|
||||||
// $str = preg_replace('/\+08:00\]/', '', $str);
|
// $str = preg_replace('/\+08:00\]/', '', $str);
|
||||||
// 时间
|
|
||||||
$str = preg_replace('/\/(.*?)\)/', '', $str);
|
$str = preg_replace('/\/(.*?)\)/', '', $str);
|
||||||
|
// 时间
|
||||||
$ptime = "/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/";
|
$ptime = "/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/";
|
||||||
preg_match($ptime, $str,$at);
|
preg_match($ptime, $str,$at);
|
||||||
$time = str_replace('T',' ',$at[0]);
|
$time = str_replace('T',' ',$at[0]);
|
||||||
//$list[$k]['time'] = $time;
|
//$list[$k]['time'] = $time;
|
||||||
// ip
|
// ip
|
||||||
$pip = '/(?:(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:1[0-9][0-9]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:2[0-5][0-5])|(?:25[0-5])|(?:1[0-9][0-9])|(?:[1-9][0-9])|(?:[1-9]))/';
|
$pip = '/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/';
|
||||||
preg_match($pip, $str,$aip);
|
preg_match($pip, $str,$aip);
|
||||||
$ip = $aip[0];
|
$ip = $aip[0];
|
||||||
// url
|
// url
|
||||||
$pattern="/(http|https):\/\/.*$/i";
|
$pattern="/(http|https):\/\/.*$/i";
|
||||||
preg_match($pattern, $str,$url);
|
preg_match($pattern, $str,$url);
|
||||||
|
// name
|
||||||
|
preg_match('/(?:bingbot|Googlebot|Baiduspider|Bytespider|360Spider|YisouSpider|Sosospider|Sogou News Spider|SemrushBot|AhrefsBot|MJ12bot)/', $str, $n);
|
||||||
|
$name = $n[0];
|
||||||
|
|
||||||
$list['data'][] = ['id'=>$k + 1, 'time'=>$time, 'name'=>$name, 'ip'=>$ip, 'url'=>$url[0]];
|
//$list['data'][] = ['id'=>$k + 1, 'time'=>$time, 'name'=>$name, 'ip'=>$ip, 'url'=>$url[0]];
|
||||||
|
$data[] = ['id'=>$k + 1, 'time'=>$time, 'name'=>$name, 'ip'=>$ip, 'url'=>$url[0]];
|
||||||
}
|
}
|
||||||
|
$datas = array_chunk($data,(int)$limit);
|
||||||
|
//$pages = count($datas);
|
||||||
|
|
||||||
|
foreach($datas as $k=>$v) {
|
||||||
|
if($page-1 == $k) {
|
||||||
|
$list['data'] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return json($list);
|
return json($list);
|
||||||
} else {
|
} else {
|
||||||
return json(['code'=>-1,'msg'=> '没有需要分析的数据']);
|
return json(['code'=>-1,'msg'=> '没有需要分析的数据']);
|
||||||
|
@ -5,8 +5,6 @@ use app\common\controller\AdminController;
|
|||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
use think\facade\Config;
|
|
||||||
use think\exception\ValidateException;
|
|
||||||
use app\common\model\Slider as SliderModel;
|
use app\common\model\Slider as SliderModel;
|
||||||
|
|
||||||
class Slider extends AdminController
|
class Slider extends AdminController
|
||||||
@ -19,12 +17,53 @@ class Slider extends AdminController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//幻灯列表
|
|
||||||
$sliders = SliderModel::select();
|
|
||||||
View::assign('slider',$sliders);
|
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链接列表
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function list()
|
||||||
|
{
|
||||||
|
$list = [];
|
||||||
|
$type = input('slid_type');
|
||||||
|
$limit = input('limit');
|
||||||
|
$page = input('page');
|
||||||
|
if($type) {
|
||||||
|
$datas = SliderModel::where('slid_type',$type)->where('')->paginate([
|
||||||
|
'list_rows'=> $limit,
|
||||||
|
'page'=>$page
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$datas = SliderModel::paginate([
|
||||||
|
'list_rows'=> $limit,
|
||||||
|
'page'=>$page
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($datas)) {
|
||||||
|
$list = ['code'=>0,'msg'=>'获取数据成功'];
|
||||||
|
foreach($datas as $k=>$v) {
|
||||||
|
$list['data'][] = [
|
||||||
|
'id'=>$v['id'],
|
||||||
|
'slid_name'=>$v['slid_name'],
|
||||||
|
'slid_img' =>$v['slid_img'],
|
||||||
|
'slid_type'=>$v['slid_type'],
|
||||||
|
'slid_href'=>$v['slid_href'],
|
||||||
|
'slid_color'=>$v['slid_color'],
|
||||||
|
'slid_start'=> time() < $v['slid_start'] ? '<span style="color:#1c97f5;">未开始</span>' : date('Y-m-d H:i',$v['slid_start']),
|
||||||
|
'slid_over'=> time() > $v['slid_over'] ? '<span style="color:#F00;">已结束</span>' : date('Y-m-d H:i',$v['slid_over']),
|
||||||
|
'slid_status'=> $v['slid_status'] ? '正常' : '禁止'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return json($list);
|
||||||
|
} else {
|
||||||
|
return json(['code'=>-1,'msg'=>'还没有数据']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示创建资源表单页.
|
* 显示创建资源表单页.
|
||||||
*
|
*
|
||||||
@ -37,8 +76,9 @@ class Slider extends AdminController
|
|||||||
$data = Request::param();
|
$data = Request::param();
|
||||||
$data['slid_start'] = strtotime($data['slid_start']);
|
$data['slid_start'] = strtotime($data['slid_start']);
|
||||||
$data['slid_over'] = strtotime($data['slid_over']);
|
$data['slid_over'] = strtotime($data['slid_over']);
|
||||||
$result = Db::name('slider')->save($data);
|
$slid = new SliderModel();
|
||||||
if($result){
|
$result = $slid->add($data);
|
||||||
|
if($result == 1){
|
||||||
$res = ['code'=>0,'msg'=>'添加成功'];
|
$res = ['code'=>0,'msg'=>'添加成功'];
|
||||||
}else{
|
}else{
|
||||||
$res = ['code'=>-1,'msg'=>'添加失败'];
|
$res = ['code'=>-1,'msg'=>'添加失败'];
|
||||||
@ -57,17 +97,18 @@ class Slider extends AdminController
|
|||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit()
|
||||||
{
|
{
|
||||||
|
$id = (int)input('id');
|
||||||
$slider = Db::name('slider')->find($id);
|
$slider = Db::name('slider')->find($id);
|
||||||
|
|
||||||
if(Request::isAjax()){
|
if(Request::isAjax()){
|
||||||
$data = Request::param();
|
$data = Request::param();
|
||||||
//var_dump($data);
|
|
||||||
$data['slid_start'] = strtotime($data['slid_start']);
|
$data['slid_start'] = strtotime($data['slid_start']);
|
||||||
$data['slid_over'] = strtotime($data['slid_over']);
|
$data['slid_over'] = strtotime($data['slid_over']);
|
||||||
$result = Db::name('slider')->where('id',$id)->save($data);
|
$slid = new SliderModel();
|
||||||
if($result){
|
$result = $slid->edit($data);
|
||||||
|
if($result == 1){
|
||||||
$res = ['code'=>0,'msg'=>'编辑成功'];
|
$res = ['code'=>0,'msg'=>'编辑成功'];
|
||||||
}else{
|
}else{
|
||||||
$res = ['code'=>-1,'msg'=>'编辑失败'];
|
$res = ['code'=>-1,'msg'=>'编辑失败'];
|
||||||
@ -106,7 +147,6 @@ class Slider extends AdminController
|
|||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
$slider = SliderModel::find($id);
|
$slider = SliderModel::find($id);
|
||||||
$res = $slider->delete();
|
$res = $slider->delete();
|
||||||
if($res){
|
if($res){
|
||||||
|
@ -194,7 +194,7 @@
|
|||||||
<option value="Bytespider" >头条</option>
|
<option value="Bytespider" >头条</option>
|
||||||
<option value="Googlebot" >谷歌</option>
|
<option value="Googlebot" >谷歌</option>
|
||||||
<option value="bingbot" >bing</option>
|
<option value="bingbot" >bing</option>
|
||||||
<option value="" >全部</option>
|
<option value="''" >全部</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -257,8 +257,9 @@
|
|||||||
,{field: 'time', title: '时间', width:160}
|
,{field: 'time', title: '时间', width:160}
|
||||||
,{field: 'name', title: '名称', width:120, sort: true}
|
,{field: 'name', title: '名称', width:120, sort: true}
|
||||||
,{field: 'ip', title: 'IP', width:200}
|
,{field: 'ip', title: 'IP', width:200}
|
||||||
,{field: 'url', title: 'URL', minWidth: 200}
|
,{field: 'url', title: 'URL', minWidth: 200, templet: '<div><a href="{{d.url}}" target="_blank">{{d.url}}</a></div>'}
|
||||||
]]
|
]]
|
||||||
|
,limit: 20
|
||||||
,text: '对不起,加载出现异常!'
|
,text: '对不起,加载出现异常!'
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -366,6 +367,9 @@
|
|||||||
//执行重载
|
//执行重载
|
||||||
table.reload('spider', {
|
table.reload('spider', {
|
||||||
where: field
|
where: field
|
||||||
|
,page: {
|
||||||
|
curr: 1 //重新从第 1 页开始
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
@ -120,16 +120,9 @@
|
|||||||
,done: function(res){
|
,done: function(res){
|
||||||
$(this.item).prev("div").children("input").val(res.src)
|
$(this.item).prev("div").children("input").val(res.src)
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
layer.msg(res.msg,{
|
layer.msg(res.msg,{icon:6,tiye:2000});
|
||||||
icon:6,
|
|
||||||
tiye:2000
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
layer.open({
|
layer.open({title:"上传失败",content:res.msg,icon:5,anim:6
|
||||||
title:"上传失败",
|
|
||||||
content:res.msg,
|
|
||||||
icon:5,
|
|
||||||
anim:6
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,52 +8,35 @@
|
|||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
|
|
||||||
<div class="layui-form" wid100 lay-filter="">
|
<div class="layui-form" wid100 lay-filter="">
|
||||||
|
|
||||||
<div class="layui-upload">
|
<div class="layui-upload">
|
||||||
<button type="button" class="layui-btn layui-btn-normal" id="slid-add">添加</button>
|
<button type="button" class="layui-btn layui-btn-normal" id="slid-add">添加</button>
|
||||||
<div class="layui-upload-list">
|
<div class="layui-form" lay-filter="select_type">位置:
|
||||||
<table class="layui-table">
|
<div class="layui-inline">
|
||||||
<thead>
|
<select name="slid_type" lay-verify="required" lay-filter="slid-type">
|
||||||
<tr>
|
<option value="">链接投放位置</option>
|
||||||
<th>ID</th>
|
<option value="1">1首页幻灯</option>
|
||||||
<th>名称</th>
|
<option value="2">2首页图片</option>
|
||||||
<th>图片/icon</th>
|
<option value="3">3分类图片</option>
|
||||||
<th>位置</th>
|
<option value="4">4详情图片</option>
|
||||||
<th>路径</th>
|
<option value="5">5首页赞助</option>
|
||||||
<th>颜色</th>
|
<option value="6">6分类赞助</option>
|
||||||
<th>开始</th>
|
<option value="7">7详情赞助</option>
|
||||||
<th>结束</th>
|
<option value="8">8温馨通道</option>
|
||||||
<th>状态</th>
|
<option value="9">9友情链接</option>
|
||||||
<th>操作</th>
|
<option value="10">10头部菜单</option>
|
||||||
</tr></thead>
|
<option value="11">11页脚链接</option>
|
||||||
|
</select>
|
||||||
<tbody id="demoList">
|
|
||||||
{volist name="slider" id="vo"}
|
|
||||||
<tr>
|
|
||||||
<th>{$vo.id}</th>
|
|
||||||
<th>{$vo.slid_name}</th>
|
|
||||||
<th>{notempty name="$vo.slid_img"}{if $vo.slid_type == '头部菜单'}<div><i class="layui-icon {$vo.slid_img}"></i></div>{else /}<img src="{$vo.slid_img}" height="40" width="80" />{/if}{/notempty}</th>
|
|
||||||
<th>{$vo.slid_type}</th>
|
|
||||||
<th><a href="{$vo.slid_href}" target="_blank">{$vo.slid_href}</a></th>
|
|
||||||
<th>{$vo.slid_color}</th>
|
|
||||||
<th>{$vo.slid_start|date='Y-m-d'}</th>
|
|
||||||
<th>{$vo.slid_over|date='Y-m-d'}</th>
|
|
||||||
<th>{$vo.slid_status ?'显示':'禁止'}</th>
|
|
||||||
<th>
|
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" id-data="{$vo.id}"><i class="layui-icon layui-icon-edit"></i></a>
|
|
||||||
{if condition="checkRuleButton('Slider/delete')"}
|
|
||||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" id-data="{$vo.id}"><i class="layui-icon layui-icon-delete"></i></a>
|
|
||||||
{else /}<a class="layui-btn layui-btn-disabled layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i></a>{/if}
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
{/volist}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<table id="slider" lay-filter="slider"></table>
|
||||||
|
<script type="text/html" id="imgTpl">
|
||||||
|
{{# if(d.slid_type == "头部菜单"){ }}<i class="layui-icon {{d.slid_img}}"></i>{{# } else { }} {{# if(d.slid_img == "") { }}无{{# } else { }} <img src="{{d.slid_img}}" height="40" width="80">{{# } }} {{# } }}
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></a>
|
||||||
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i></a>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -69,11 +52,108 @@
|
|||||||
base: '/static/admin/' //静态资源所在路径
|
base: '/static/admin/' //静态资源所在路径
|
||||||
}).extend({
|
}).extend({
|
||||||
index: 'lib/index' //主入口模块
|
index: 'lib/index' //主入口模块
|
||||||
}).use(['index','layer','table','form'], function(){
|
}).use(['index','layer','table','util','form'], function(){
|
||||||
var $ = layui.jquery
|
var $ = layui.jquery
|
||||||
,layer = layui.layer
|
,layer = layui.layer
|
||||||
,table = layui.table
|
,table = layui.table
|
||||||
,form = layui.form;
|
,form = layui.form;
|
||||||
|
var util = layui.util;
|
||||||
|
|
||||||
|
//第一个实例
|
||||||
|
table.render({
|
||||||
|
elem: '#slider'
|
||||||
|
,url: "{:url('slider/list')}" //数据接口
|
||||||
|
,page: true //开启分页
|
||||||
|
,cols: [[ //表头
|
||||||
|
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
|
||||||
|
,{field: 'slid_type', title: '位置', width:120}
|
||||||
|
,{field: 'slid_img', title: '图片/icon', width:150, templet: '#imgTpl'}
|
||||||
|
,{field: 'slid_name', title: '名称', width:180}
|
||||||
|
,{field: 'slid_href', title: 'URL', minWidth: 250}
|
||||||
|
,{field: 'slid_color', title: '颜色', width: 80}
|
||||||
|
,{field: 'slid_start', title: '开始', width: 150, sort: true}
|
||||||
|
,{field: 'slid_over', title: '结束', width: 150, sort: true}
|
||||||
|
,{field: 'slid_status', title: '状态', width: 135}
|
||||||
|
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
|
||||||
|
]]
|
||||||
|
,limit: 15
|
||||||
|
,text: '对不起,加载出现异常!'
|
||||||
|
});
|
||||||
|
|
||||||
|
form.on('select(slid-type)', function(data){
|
||||||
|
$.post("{:url('slider/list')}", {"slid_type":data.value}, function (data){
|
||||||
|
if (data.code == -1){
|
||||||
|
layer.open({content:data.msg,icon:5,anim:6});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
//执行重载
|
||||||
|
table.reload('slider', {
|
||||||
|
where: {slid_type: data.value}
|
||||||
|
,page: {
|
||||||
|
curr: 1 //重新从第 1 页开始
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听行工具事件
|
||||||
|
table.on('tool(slider)', function(obj){
|
||||||
|
var data = obj.data;
|
||||||
|
var id = data.id;
|
||||||
|
//console.log(obj)
|
||||||
|
if(obj.event === 'del'){
|
||||||
|
layer.confirm('真的删除行么', {icon: 3, title:'删除链接?'}, function(index){
|
||||||
|
//提交 Ajax 成功后,静态更新表格中的数据
|
||||||
|
$.post("{:url('slider/delete')}", {"id":data.id}, function(data){
|
||||||
|
if (data.code == 0) {
|
||||||
|
layer.msg(data.msg,{icon:6,time:2000}, function(){
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.open({title:'删除失败',content:data.msg,icon:5,anim:6});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
layer.close(index);
|
||||||
|
} else if(obj.event === 'edit'){
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑链接',
|
||||||
|
content: 'edit.html?id='+ id,
|
||||||
|
maxmin: true,
|
||||||
|
area : ['500px' , '600px'],
|
||||||
|
btn: ['确定', '取消'],
|
||||||
|
yes: function(index, layero){
|
||||||
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||||
|
,submitID = 'LAY-slider-submit'
|
||||||
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||||
|
//监听提交
|
||||||
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||||
|
var field = data.field; //获取提交的字段
|
||||||
|
//提交 Ajax 成功后,静态更新表格中的数据
|
||||||
|
$.ajax({
|
||||||
|
type:"post",
|
||||||
|
url:"{:url('slider/edit')}",
|
||||||
|
data:{"id":id,"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_color":field.slid_color,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img},
|
||||||
|
daType:"json",
|
||||||
|
success:function (data){
|
||||||
|
if (data.code == 0) {
|
||||||
|
layer.msg(data.msg,{icon:6,time:2000}, function(){
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.open({title:'添加失败',content:data.msg,icon:5,anim:6});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
layer.close(index);
|
||||||
|
});
|
||||||
|
submit.trigger('click');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//添加幻灯
|
//添加幻灯
|
||||||
$('#slid-add').on('click', function(){
|
$('#slid-add').on('click', function(){
|
||||||
layer.open({
|
layer.open({
|
||||||
@ -81,7 +161,7 @@
|
|||||||
title: '添加链接',
|
title: '添加链接',
|
||||||
content: 'add.html',
|
content: 'add.html',
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
area : ['460px' , '530px'],
|
area : ['500px' , '600px'],
|
||||||
btn: ['确定', '取消'],
|
btn: ['确定', '取消'],
|
||||||
yes: function(index, layero){
|
yes: function(index, layero){
|
||||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||||
@ -122,88 +202,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//编辑广告
|
|
||||||
$('a[lay-event=edit]').on('click', function(){
|
|
||||||
var id = $(this).attr('id-data');
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '编辑链接',
|
|
||||||
content: 'edit.html?id='+ id,
|
|
||||||
maxmin: true,
|
|
||||||
area : ['460px' , '530px'],
|
|
||||||
btn: ['确定', '取消'],
|
|
||||||
yes: function(index, layero){
|
|
||||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
|
||||||
,submitID = 'LAY-slider-submit'
|
|
||||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
|
||||||
|
|
||||||
//监听提交
|
|
||||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
|
||||||
var field = data.field; //获取提交的字段
|
|
||||||
//console.log(field);
|
|
||||||
|
|
||||||
//提交 Ajax 成功后,静态更新表格中的数据
|
|
||||||
$.ajax({
|
|
||||||
type:"post",
|
|
||||||
url:"{:url('slider/edit')}",
|
|
||||||
data:{"id":id,"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_color":field.slid_color,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img},
|
|
||||||
daType:"json",
|
|
||||||
success:function (data){
|
|
||||||
if (data.code == 0) {
|
|
||||||
layer.msg(data.msg,{
|
|
||||||
icon:6,
|
|
||||||
time:2000
|
|
||||||
}, function(){
|
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.open({
|
|
||||||
title:'添加失败',
|
|
||||||
content:data.msg,
|
|
||||||
icon:5,
|
|
||||||
anim:6
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layer.close(index);
|
|
||||||
});
|
|
||||||
submit.trigger('click');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//删除幻灯
|
|
||||||
$('a[lay-event=del]').on('click', function(){
|
|
||||||
var id = $(this).attr('id-data');
|
|
||||||
layer.confirm('确定删除?', {icon: 3, title:'删除幻灯'}, function(index){
|
|
||||||
//提交 Ajax 成功后,静态更新表格中的数据
|
|
||||||
$.ajax({
|
|
||||||
type:"post",
|
|
||||||
url:"{:url('slider/delete')}",
|
|
||||||
data:{"id":id},
|
|
||||||
daType:"json",
|
|
||||||
success:function (data){
|
|
||||||
if (data.code == 0) {
|
|
||||||
layer.msg(data.msg,{
|
|
||||||
icon:6,
|
|
||||||
time:2000
|
|
||||||
}, function(){
|
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.open({
|
|
||||||
title:'删除失败',
|
|
||||||
content:data.msg,
|
|
||||||
icon:5,
|
|
||||||
anim:6
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layer.close(index);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
* @Author: TaoLer <alipey_tao@qq.com>
|
||||||
|
* @Date: 2021-12-06 16:04:50
|
||||||
|
* @LastEditTime: 2022-05-01 17:10:55
|
||||||
|
* @LastEditors: TaoLer
|
||||||
|
* @Description: 链接投放优化设置
|
||||||
|
* @FilePath: \TaoLer\app\common\model\Slider.php
|
||||||
|
* Copyright (c) 2020~2022 http://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
namespace app\common\model;
|
namespace app\common\model;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
@ -35,7 +44,7 @@ class Slider extends Model
|
|||||||
$sliders = Cache::get('slider'.$type);
|
$sliders = Cache::get('slider'.$type);
|
||||||
if(!$sliders){
|
if(!$sliders){
|
||||||
$sliders = $this::where(['slid_status'=>1,'delete_time'=>0,'slid_type'=>$type])->whereTime('slid_over','>=',time())->select()->toArray();
|
$sliders = $this::where(['slid_status'=>1,'delete_time'=>0,'slid_type'=>$type])->whereTime('slid_over','>=',time())->select()->toArray();
|
||||||
Cache::set('slider'.$type,$sliders,3600);
|
Cache::tag('tagSlider')->set('slider'.$type,$sliders,3600);
|
||||||
}
|
}
|
||||||
return $sliders;
|
return $sliders;
|
||||||
}
|
}
|
||||||
@ -46,6 +55,7 @@ class Slider extends Model
|
|||||||
$result = $this::save($data);
|
$result = $this::save($data);
|
||||||
|
|
||||||
if($result) {
|
if($result) {
|
||||||
|
Cache::tag('tagSlider')->clear();
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 'add_error';
|
return 'add_error';
|
||||||
@ -58,6 +68,7 @@ class Slider extends Model
|
|||||||
$slider = $this::find($data['id']);
|
$slider = $this::find($data['id']);
|
||||||
$result = $slider->save($data);
|
$result = $slider->save($data);
|
||||||
if($result) {
|
if($result) {
|
||||||
|
Cache::tag('tagSlider')->clear();
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 'edit_error';
|
return 'edit_error';
|
||||||
|
@ -32,7 +32,7 @@ class User extends BaseController
|
|||||||
//发帖list
|
//发帖list
|
||||||
public function artList()
|
public function artList()
|
||||||
{
|
{
|
||||||
$article = Article::withCount('comments')->where('user_id',$this->uid)->order('update_time','desc')->paginate(10);
|
$article = Article::withCount('comments')->where(['user_id'=>$this->uid])->order('update_time','desc')->paginate(10);
|
||||||
//var_dump($article);
|
//var_dump($article);
|
||||||
$count = $article->total();
|
$count = $article->total();
|
||||||
$res = [];
|
$res = [];
|
||||||
@ -198,9 +198,9 @@ class User extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
//用户发贴
|
//用户发贴
|
||||||
$arts = Db::name('user')->alias('u')->join('article a','u.id = a.user_id')->field('u.id,a.id,a.title,a.pv,a.is_hot,a.create_time,a.delete_time')->where('a.delete_time',0)->where('a.user_id',$id)->order(['a.create_time'=>'desc'])->cache(3600)->select();
|
$arts = Db::name('user')->alias('u')->join('article a','u.id = a.user_id')->field('u.id,a.id,a.title,a.pv,a.is_hot,a.create_time,a.delete_time,a.status')->where(['a.delete_time'=>0,'a.status'=>1])->where('a.user_id',$id)->order(['a.create_time'=>'desc'])->cache(3600)->select();
|
||||||
//用户回答
|
//用户回答
|
||||||
$reys = Db::name('comment')->alias('c')->join('article a','c.article_id = a.id')->field('a.id,a.title,c.content,c.create_time,c.delete_time')->where(['a.delete_time'=>0,'c.delete_time'=>0])->where('c.user_id',$id)->order(['c.create_time'=>'desc'])->cache(3600)->select();
|
$reys = Db::name('comment')->alias('c')->join('article a','c.article_id = a.id')->field('a.id,a.title,c.content,c.create_time,c.delete_time,c.status')->where(['a.delete_time'=>0,'c.delete_time'=>0,'c.status'=>1])->where('c.user_id',$id)->order(['c.create_time'=>'desc'])->cache(3600)->select();
|
||||||
|
|
||||||
View::assign(['u'=>$u,'arts'=>$arts,'reys'=>$reys,'jspage'=>'']);
|
View::assign(['u'=>$u,'arts'=>$arts,'reys'=>$reys,'jspage'=>'']);
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
|
4
vendor/composer/installed.php
vendored
4
vendor/composer/installed.php
vendored
@ -5,7 +5,7 @@
|
|||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'bb712c71c521dd5acc4656bb49ff90285de07458',
|
'reference' => '334c91212372abf2e9a2441668700e9a794b635d',
|
||||||
'name' => 'taoser/taoler',
|
'name' => 'taoser/taoler',
|
||||||
'dev' => true,
|
'dev' => true,
|
||||||
),
|
),
|
||||||
@ -160,7 +160,7 @@
|
|||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'bb712c71c521dd5acc4656bb49ff90285de07458',
|
'reference' => '334c91212372abf2e9a2441668700e9a794b635d',
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'taoser/think-addons' => array(
|
'taoser/think-addons' => array(
|
||||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// This file is automatically generated at:2022-04-29 17:39:41
|
// This file is automatically generated at:2022-05-04 14:24:24
|
||||||
declare (strict_types = 1);
|
declare (strict_types = 1);
|
||||||
return array (
|
return array (
|
||||||
0 => 'taoser\\addons\\Service',
|
0 => 'taoser\\addons\\Service',
|
||||||
|
@ -12,16 +12,16 @@
|
|||||||
<ul class="fly-list">
|
<ul class="fly-list">
|
||||||
{volist name="artList['data']" id="art"}
|
{volist name="artList['data']" id="art"}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('user/home',['id'=>$art.user.id])}" class="fly-avatar">
|
<a href="{:url('user/home',['id'=>$art.user.id])}" class="fly-avatar"><img src="{$art.user.user_img}" alt="{$art.user.name}"></a>
|
||||||
<img src="{$art.user.user_img}" alt="{$art.user.name}">
|
|
||||||
</a>
|
|
||||||
<h2>
|
<h2>
|
||||||
{if config('taoler.config.cate_show') == 1}<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename}</a>{/if}
|
{if config('taoler.config.cate_show') == 1}<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename}</a>{/if}
|
||||||
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="fly-list-info">
|
<div class="fly-list-info">
|
||||||
<a href="{:url('user/home',['id'=>$art.user.id])}" link>
|
<a href="{:url('user/home',['id'=>$art.user.id])}" link>
|
||||||
{if config('taoler.config.area_show') == 1}<span class="layui-badge layui-bg-green " title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</span>{/if}
|
{if config('taoler.config.area_show') == 1}
|
||||||
|
<span class="layui-badge layui-bg-green " title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</span>
|
||||||
|
{/if}
|
||||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||||
<i>{$art.create_time|date='Y-m-d'}</i>
|
<i>{$art.create_time|date='Y-m-d'}</i>
|
||||||
</a>
|
</a>
|
||||||
@ -32,12 +32,13 @@
|
|||||||
{$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'}
|
{$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'}
|
||||||
</span>
|
</span>
|
||||||
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览"></i> {$art.pv}</span>
|
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览"></i> {$art.pv}</span>
|
||||||
<span class="fly-list-nums">
|
<span class="fly-list-nums"><i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}</span>
|
||||||
<i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fly-list-badge">
|
<div class="fly-list-badge">
|
||||||
{if ($art.is_hot == 1)}<i class="layui-icon layui-icon-fire layui-hide-md" style="font-size: 20px; color: #FF5722;"></i><span class="layui-badge layui-bg-red layui-hide-xs">{:lang('hot')}</span> {/if}
|
{if ($art.is_hot == 1)}
|
||||||
|
<i class="layui-icon layui-icon-fire layui-hide-md" style="font-size: 20px; color: #FF5722;"></i>
|
||||||
|
<span class="layui-badge layui-bg-red layui-hide-xs">{:lang('hot')}</span>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{/volist}
|
{/volist}
|
||||||
@ -65,7 +66,7 @@
|
|||||||
|
|
||||||
<div class="fly-panel">
|
<div class="fly-panel">
|
||||||
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
||||||
<a href="" class="fly-link fly-joinad ">{:lang('i want to join')}</a>
|
<a href="" class="fly-link fly-joinad">{:lang('i want to join')}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="fly-panel-main">
|
<div class="fly-panel-main">
|
||||||
{volist name="ad_comm" id="vo"}
|
{volist name="ad_comm" id="vo"}
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
<div class="detail-body photos" style="font-size: 18px;line-height: 200%;" id="content">{$article.content}</div>
|
<div class="detail-body photos" style="font-size: 18px;line-height: 200%;" id="content">{$article.content}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fly-panel detail-box" >
|
|
||||||
{//管理}
|
{//管理}
|
||||||
{if (($article.upzip !== '') || session('?user_name'))}
|
{if (($article.upzip !== '') || session('?user_name'))}
|
||||||
|
<div class="fly-panel detail-box" >
|
||||||
<div class="detail-assist">
|
<div class="detail-assist">
|
||||||
{notempty name="$article.upzip"}
|
{notempty name="$article.upzip"}
|
||||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||||
@ -40,7 +41,6 @@
|
|||||||
{else /}
|
{else /}
|
||||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" style="background-color:#ccc;">{:lang('cancel topping')}</span>
|
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" style="background-color:#ccc;">{:lang('cancel topping')}</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if($article.is_hot == 0)}
|
{if($article.is_hot == 0)}
|
||||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1"><i class="layui-icon layui-icon-fire"></i></span>
|
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1"><i class="layui-icon layui-icon-fire"></i></span>
|
||||||
{else /}
|
{else /}
|
||||||
@ -58,8 +58,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,9 +46,9 @@
|
|||||||
<div class="detail-body photos" id="content">{$article.content}</div>
|
<div class="detail-body photos" id="content">{$article.content}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fly-panel detail-box" >
|
|
||||||
{//管理}
|
{//管理}
|
||||||
{if (($article.upzip !== '') || session('?user_name'))}
|
{if (($article.upzip !== '') || session('?user_name'))}
|
||||||
|
<div class="fly-panel detail-box" >
|
||||||
<div class="detail-assist">
|
<div class="detail-assist">
|
||||||
{notempty name="$article.upzip"}
|
{notempty name="$article.upzip"}
|
||||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||||
@ -78,8 +78,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
{//评论}
|
{//评论}
|
||||||
<div class="fly-panel detail-box" id="flyReply">
|
<div class="fly-panel detail-box" id="flyReply">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user