提交 abef6b0f 编写于 作者: D devil

数据列表优化

上级 49e1db1c
......@@ -14,6 +14,7 @@ use think\facade\Hook;
use think\Controller;
use app\service\AdminPowerService;
use app\service\ConfigService;
use app\module\FormHandleModule;
/**
* 管理员公共控制器
......@@ -247,27 +248,25 @@ class Common extends Controller
*/
public function FormTableInit()
{
// 当前操作名称
$module = request()->module();
$controller = request()->controller();
// 数据处理
$res = FormTableLoad($controller, $module, $this->data_request);
if($res['code'] == 0)
// 获取表格模型
$module = FormModulePath($this->data_request);
if(!empty($module))
{
$this->form_table = $res['data']['table'];
$this->form_where = $res['data']['where'];
$this->form_params = $res['data']['params'];
$this->assign('form_table', $this->form_table);
$this->assign('form_params', $this->form_params);
} else {
$this->form_error = $res['msg'];
$this->assign('form_error', $this->form_error);
// 调用表格处理
$res = (new FormHandleModule())->Run($module, $this->data_request);
if($res['code'] == 0)
{
$this->form_table = $res['data']['table'];
$this->form_where = $res['data']['where'];
$this->form_params = $res['data']['params'];
$this->assign('form_table', $this->form_table);
$this->assign('form_params', $this->form_params);
} else {
$this->form_error = $res['msg'];
$this->assign('form_error', $this->form_error);
}
}
//print_r($this->data_request);die;
}
/**
......
......@@ -57,10 +57,10 @@ class Goods extends Common
$params = $this->data_request;
// 条件
$where = GoodsService::GetAdminIndexWhere($params);
//$where = GoodsService::GetAdminIndexWhere($params);
// 总数
$total = GoodsService::GoodsTotal($where);
$total = GoodsService::GoodsTotal($this->form_where);
// 分页
$page_params = array(
......@@ -74,7 +74,7 @@ class Goods extends Common
// 获取数据列表
$data_params = [
'where' => $where,
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'is_category' => 1,
......
......@@ -25,6 +25,11 @@ use app\service\BrandService;
*/
class Goods
{
// 基础条件
public $condition_base = [
['is_delete_time', '=', 0],
];
/**
* 入口
* @author Devil
......@@ -43,14 +48,32 @@ class Goods
'status_field' => 'is_shelves',
'is_search' => 1,
'search_url' => MyUrl('admin/goods/index'),
],
// 表单配置
'form' => [
[
'view_type' => 'checkbox',
'is_checked' => 0,
'checked_text' => '反选',
'not_checked_text' => '全选',
'align' => 'center',
'width' => 80,
],
[
'view_type' => 'radio',
'align' => 'center',
'width' => 50,
],
[
'label' => '商品ID',
'view_type' => 'field',
'view_key' => 'id',
'width' => 80,
'search_config' => [
'form_type' => 'input',
'form_name' => 'id',
'where_type' => '=',
],
],
[
'label' => '商品信息',
......@@ -61,7 +84,7 @@ class Goods
'form_type' => 'input',
'form_name' => 'title|simple_desc|seo_title|seo_keywords|seo_keywords',
'where_type' => 'like',
'placeholder' => '请输入名称/简述/SEO信息'
'placeholder' => '请输入商品名称/简述/SEO信息'
],
],
[
......@@ -99,7 +122,6 @@ class Goods
'label' => '上下架',
'view_type' => 'status',
'view_key' => 'is_shelves',
'key_field' => 'id',
'post_url' => MyUrl('admin/goods/statusshelves'),
'is_form_su' => 1,
'align' => 'center',
......@@ -117,7 +139,6 @@ class Goods
'label' => '首页推荐',
'view_type' => 'status',
'view_key' => 'is_home_recommended',
'key_field' => 'id',
'post_url' => MyUrl('admin/goods/statushomerecommended'),
'align' => 'center',
'search_config' => [
......@@ -147,8 +168,9 @@ class Goods
'search_config' => [
'form_type' => 'module',
'template' => 'lib/module/goods_category',
'form_name' => 'category_id',
'form_name' => 'id',
'where_type' => 'in',
'where_custom' => 'WhereValueGoodsCategory',
'data' => GoodsService::GoodsCategoryAll(),
],
],
......@@ -185,4 +207,36 @@ class Goods
],
];
}
/**
* 商品分类条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-03
* @desc description
* @param [string] $name [字段名称]
* @param [array] $params [输入参数]
*/
public function WhereValueGoodsCategory($value, $params = [])
{
if(!empty($value))
{
// 是否为数组
if(!is_array($value))
{
$value = [$value];
}
// 获取分类下的所有分类 id
$category_ids = GoodsService::GoodsCategoryItemsIds($value, 1);
// 获取商品 id
$goods_ids = Db::name('GoodsCategoryJoin')->where(['category_id'=>$category_ids])->column('goods_id');
// 避免空条件造成无效的错觉
return empty($goods_ids) ? [0] : $goods_ids;
}
return $value;
}
}
\ No newline at end of file
<!-- 操作栏 -->
<button class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/goods/detail', ['id'=>$module_data['id']])}}">
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/goods/detail', ['id'=>$module_data['id']])}}">
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
......@@ -7,7 +7,7 @@
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>
<button class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/goods/delete')}}" data-id="{{$module_data.id}}">
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/goods/delete')}}" data-id="{{$module_data.id}}">
<i class="am-icon-trash-o"></i>
<span>删除</span>
</button>
\ No newline at end of file
......@@ -21,7 +21,7 @@
* @desc description
* @param [string] $key [缓存 key]
* @param [int] $type [操作类型(0清除, 1验证)]
* @param [int] $expire_time [过期时间(默认30秒+30秒)]
* @param [int] $expire_time [过期时间(默认30秒)]
*/
function SecurityPreventViolence($key, $type = 1, $expire_time = 30)
{
......@@ -41,7 +41,7 @@ function SecurityPreventViolence($key, $type = 1, $expire_time = 30)
$status = false;
if($count <= $max)
{
cache($mkey, $count, $expire_time+30);
cache($mkey, $count, $expire_time);
$status = true;
}
......@@ -56,42 +56,32 @@ function SecurityPreventViolence($key, $type = 1, $expire_time = 30)
}
/**
* 模块动态表格加载方法
* 获取动态表格 form 路径
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @date 2020-06-05
* @desc description
* @param [string] $name [模块名称]
* @param [string] $group [模块组(admin,index)]
* @param [mixed] $params [参数数据]
* @param [array] $params [输入参数]
*/
function FormTableLoad($name, $group = 'admin', $params = [])
function FormModulePath($params = [])
{
// 模块
$module = '\app\\'.$group.'\form\\'.$name;
if(!class_exists($module))
{
return DataReturn('动态表格模块未定义['.$module.']', -1);
}
// 参数变量
$path = '';
$controller = request()->controller();
// 调用方法
$action = 'Run';
$obj = new $module();
if(!method_exists($obj, $action))
// 是否插件调用
if($controller == 'Plugins')
{
return DataReturn('动态表格方法未定义['.$module.'->'.$action.'()]', -1);
if(!empty($params['pluginsname']) && !empty($params['pluginscontrol']))
{
$path = '\app\plugins\\'.$params['pluginsname'].'\form\\'.ucfirst($params['pluginscontrol']);
}
} else {
$path = '\app\\'.request()->module().'\form\\'.$controller;
}
$table = $obj->$action($params);
// 处理数据
$res = (new app\module\FormHandle())->Run($table, $params);
$data = [
'table' => $table,
'where' => $res['where'],
'params' => $res['params'],
];
return DataReturn('success', 0, $data);
return $path;
}
/**
......@@ -107,7 +97,7 @@ function FormTableLoad($name, $group = 'admin', $params = [])
function ModuleInclude($template, $params = [])
{
// 应用控制器
$module = '\app\module\ViewInclude';
$module = '\app\module\ViewIncludeModule';
if(!class_exists($module))
{
return '模块视图控制器未定义['.$module.']';
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\module;
use think\Controller;
/**
* 动态表格处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
*/
class FormHandle
{
/**
* 条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
* @param [array] $data [动态表格配置信息]
* @param [array] $params [输入参数]
*/
public function Run($data, $params = [])
{
$w = [];
$p = [];
if(!empty($data['form']))
{
foreach($data['form'] as $k=>&$v)
{
// 基础数据处理
// 条件处理
if(isset($v['search_config']) && !empty($v['search_config']['form_type']) && !empty($v['search_config']['form_name']))
{
$key = 'fp'.$k;
$name = $v['search_config']['form_name'];
$type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type'];
switch($type)
{
// 单个值
case '=' :
case '<' :
case '>' :
case '<=' :
case '>=' :
case 'like' :
if(array_key_exists($key, $params) && $params[$key] !== null && $params[$key] !== '')
{
// 参数值
$value = urldecode($params[$key]);
$p[$key] = $value;
// 条件
$w[] = [$name, $type, $value];
}
break;
// in
case 'in' :
if(array_key_exists($key, $params) && $params[$key] !== null && $params[$key] !== '')
{
// 参数值
$value = urldecode($params[$key]);
if(!is_array($value))
{
$value = explode(',', $value);
}
$p[$key] = $value;
// 条件
$w[] = [$name, $type, $value];
}
break;
// 区间值
case 'section' :
$key_min = $key.'_min';
$key_max = $key.'_max';
if(array_key_exists($key_min, $params) && $params[$key_min] !== null && $params[$key_min] !== '')
{
// 参数值
$value = urldecode($params[$key_min]);
$p[$key_min] = $value;
// 条件
$w[] = [$name, '>=', $value];
}
if(array_key_exists($key_max, $params) && $params[$key_max] !== null && $params[$key_max] !== '')
{
// 参数值
$value = urldecode($params[$key_max]);
$p[$key_max] = $value;
// 条件
$w[] = [$name, '<=', $value];
}
break;
// 时间
case 'datetime' :
case 'date' :
$key_start = $key.'_start';
$key_end = $key.'_end';
if(array_key_exists($key_start, $params) && $params[$key_start] !== null && $params[$key_start] !== '')
{
// 参数值
$value = urldecode($params[$key_start]);
$p[$key_start] = $value;
// 条件
$w[] = [$name, '>=', strtotime($value)];
}
if(array_key_exists($key_end, $params) && $params[$key_end] !== null && $params[$key_end] !== '')
{
// 参数值
$value = urldecode($params[$key_end]);
$p[$key_end] = $value;
// 条件
$w[] = [$name, '<=', strtotime($value)];
}
break;
}
}
}
}
return [
'where' => $w,
'params' => $p,
];
}
}
?>
\ No newline at end of file
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\module;
use think\Controller;
/**
* 动态表格处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
*/
class FormHandleModule
{
// 模块对象
public $module_obj;
// form 配置数据
public $form_data;
// 外部参数
public $out_params;
// 条件参数
public $where_params;
// 搜索条件
public $where;
/**
* 运行入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
* @param [string] $module [模块位置]
* @param [mixed] $params [参数数据]
*/
public function Run($module, $params = [])
{
// 参数
$this->out_params = $params;
// 模块是否存在
if(!class_exists($module))
{
return DataReturn('表格模块未定义['.$module.']', -1);
}
// 调用方法
$action = 'Run';
$this->module_obj = new $module();
if(!method_exists($this->module_obj, $action))
{
return DataReturn('表格方法未定义['.$module.'->'.$action.'()]', -1);
}
// 获取表格配置数据
$this->form_data = $this->module_obj->$action($this->out_params);
if(empty($this->form_data['base']) || empty($this->form_data['form']))
{
return DataReturn('表格配置有误['.$module.'][base|form]', -1);
}
// 数据唯一主字段
if(empty($this->form_data['base']['key_field']))
{
return DataReturn('表格唯一字段配置有误['.$module.']base->[key_field]', -1);
}
// 基础条件
$this->BaseWhereHandle();
// 表格处理数据
$this->FormDataHandle();
// 数据返回
$data = [
'table' => $this->form_data,
'where' => $this->where,
'params' => $this->where_params,
];
return DataReturn('success', 0, $data);
}
/**
* 表格数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
*/
public function FormDataHandle()
{
if(!empty($this->form_data['form']))
{
foreach($this->form_data['form'] as $k=>&$v)
{
// 基础处理
if(!empty($v['view_type']))
{
switch($v['view_type'])
{
// 状态操作
// 复选框
// 单选框
case 'status' :
case 'checkbox' :
case 'radio' :
// 未指定唯一字段名称则使用基础中的唯一字段
if(empty($v['key_field']))
{
$v['key_field'] = $this->form_data['base']['key_field'];
}
// 复选框
if($v['view_type'] == 'checkbox')
{
// 选择/未选中文本
if(empty($v['checked_text']))
{
$v['checked_text'] = '反选';
}
if(empty($v['not_checked_text']))
{
$v['not_checked_text'] = '全选';
}
// 是否选中 默认否
$v['is_checked'] = isset($v['is_checked']) ? intval($v['is_checked']) : 0;
// view key 默认 form_ids_checkbox
if(empty($v['view_key']))
{
$v['view_key'] = 'form_checkbox_value';
}
// 提交参数处理
if(isset($this->out_params[$v['view_key']]))
{
$value = urldecode($this->out_params[$v['view_key']]);
if(!is_array($value))
{
$value = explode(',', $value);
}
$this->where_params[$v['view_key']] = $value;
}
}
// 单选框
if($v['view_type'] == 'radio')
{
// 单选标题
if(empty($v['label']))
{
$v['label'] = '单选';
}
// view key 默认 form_ids_radio
if(empty($v['view_key']))
{
$v['view_key'] = 'form_radio_value';
}
// 提交参数处理
if(isset($this->out_params[$v['view_key']]))
{
$value = urldecode($this->out_params[$v['view_key']]);
$this->where_params[$v['view_key']] = $value;
}
}
break;
}
}
// 条件处理
if(!empty($v['search_config']) && !empty($v['search_config']['form_type']) && !empty($v['search_config']['form_name']))
{
// 基础数据处理
// 显示名称
$label = empty($v['label']) ? '' : $v['label'];
// 唯一 formkey
$form_key = 'fp'.$k;
$v['form_key'] = $form_key;
// 根据组件类型处理
switch($v['search_config']['form_type'])
{
// 单个输入
case 'input' :
// 提示信息处理
if(empty($v['search_config']['placeholder']))
{
$v['search_config']['placeholder'] = '请输入'.$label;
}
break;
// 选择
case 'select' :
// 提示信息处理
if(empty($v['search_config']['placeholder']))
{
$v['search_config']['placeholder'] = '请选择'.$label;
}
// 选择数据 key=>name
if(empty($v['search_config']['data_key']))
{
$v['search_config']['data_key'] = 'id';
}
if(empty($v['search_config']['data_name']))
{
$v['search_config']['data_key'] = 'name';
}
break;
// 区间
case 'section' :
// 提示信息处理
if(empty($v['search_config']['placeholder_min']))
{
$v['search_config']['placeholder_min'] = '最小值';
}
if(empty($v['search_config']['placeholder_max']))
{
$v['search_config']['placeholder_max'] = '最大值';
}
break;
// 时间
case 'datetime' :
case 'date' :
// 提示信息处理
if(empty($v['search_config']['placeholder_start']))
{
$v['search_config']['placeholder_start'] = '开始';
}
if(empty($v['search_config']['placeholder_end']))
{
$v['search_config']['placeholder_end'] = '结束';
}
break;
}
// 搜索条件数据处理
// 表单字段名称
$name = $v['search_config']['form_name'];
// 条件类型
$type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type'];
// 是否自定义条件处理方法
$custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : '';
// 根据条件类型处理
switch($type)
{
// 单个值
case '=' :
case '<' :
case '>' :
case '<=' :
case '>=' :
case 'like' :
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
{
// 参数值
$value = urldecode($this->out_params[$form_key]);
$this->where_params[$form_key] = $value;
// 条件值处理
$value = $this->WhereValueHandle($value, $custom);
// 是否 like 条件
if($type == 'like')
{
$value = '%'.$value.'%';
}
// 条件
$this->where[] = [$name, $type, $value];
}
break;
// in
case 'in' :
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
{
// 参数值
$value = urldecode($this->out_params[$form_key]);
if(!is_array($value))
{
$value = explode(',', $value);
}
$this->where_params[$form_key] = $value;
// 条件
$this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)];
}
break;
// 区间值
case 'section' :
$key_min = $form_key.'_min';
$key_max = $form_key.'_max';
if(array_key_exists($key_min, $this->out_params) && $this->out_params[$key_min] !== null && $this->out_params[$key_min] !== '')
{
// 参数值
$value = urldecode($this->out_params[$key_min]);
$this->where_params[$key_min] = $value;
// 条件
$this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])];
}
if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '')
{
// 参数值
$value = urldecode($this->out_params[$key_max]);
$this->where_params[$key_max] = $value;
// 条件
$this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])];
}
break;
// 时间
case 'datetime' :
case 'date' :
$key_start = $form_key.'_start';
$key_end = $form_key.'_end';
if(array_key_exists($key_start, $this->out_params) && $this->out_params[$key_start] !== null && $this->out_params[$key_start] !== '')
{
// 参数值
$value = urldecode($this->out_params[$key_start]);
$this->where_params[$key_start] = $value;
// 条件
$this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])];
}
if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '')
{
// 参数值
$value = urldecode($this->out_params[$key_end]);
$this->where_params[$key_end] = $value;
// 条件
$this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])];
}
break;
}
}
}
}
}
/**
* 条件值处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-04
* @desc description
* @param [mixed] $value [条件值]
* @param [mixed] $custom [自定义处理方法名称]
* @param [array] $params [输入参数]
*/
function WhereValueHandle($value, $custom = '', $params = [])
{
// 模块是否自定义方法处理条件
if(!empty($custom) && method_exists($this->module_obj, $custom))
{
return $this->module_obj->$custom($value, $params);
}
// 默认直接返回值
return $value;
}
/**
* 基础条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-05
* @desc description
*/
function BaseWhereHandle()
{
// 是否定义基础条件属性
if(property_exists($this->module_obj, 'condition_base') && is_array($this->module_obj->condition_base))
{
$this->where = $this->module_obj->condition_base;
}
}
}
?>
\ No newline at end of file
......@@ -20,7 +20,7 @@ use think\Controller;
* @date 2020-05-25
* @desc description
*/
class ViewInclude extends Controller
class ViewIncludeModule extends Controller
{
/**
* 构造方法
......
......@@ -32,5 +32,21 @@ return array (
'log_write' =>
array (
),
'plugins_service_order_status_change_history_success_handle' =>
array (
0 => 'app\\plugins\\neworderemail\\Hook',
),
'plugins_service_order_pay_launch_handle' =>
array (
0 => 'app\\plugins\\neworderemail\\Hook',
),
'plugins_admin_js' =>
array (
0 => 'app\\plugins\\orderremind\\Hook',
),
'plugins_admin_view_common_bottom' =>
array (
0 => 'app\\plugins\\orderremind\\Hook',
),
);
?>
\ No newline at end of file
......@@ -527,4 +527,12 @@ button.colorpicker-submit img {
.form-table-search-time > i {
position: absolute;
margin: 4px 0px 0px -15px;
}
/**
* 表格-复选框/单选框
*/
.form-table-operate-radio .am-radio,
.form-table-operate-checkbox .am-checkbox {
margin-top: 0;
}
\ No newline at end of file
......@@ -1632,16 +1632,26 @@ function TableContainerInit()
// 公共数据操作
$(function()
{
// 浏览器窗口实时事件
$(window).resize(function()
{
// 表格初始化
TableContainerInit();
});
// 表格初始化
TableContainerInit();
// 表格复选框操作 全选/反选
$('.form-table-operate-checkbox-submit').on('click', function()
{
var value = parseInt($(this).attr('data-value')) || 0;
if(value == 1)
{
var not_checked_text = $(this).data('not-checked-text') || '全选';
$(this).text(not_checked_text);
$('.form-table-operate-checkbox').find('input[type="checkbox"]').uCheck('uncheck');
} else {
var checked_text = $(this).data('checked-text') || '反选';
$(this).text(checked_text);
$('.form-table-operate-checkbox').find('input[type="checkbox"]').uCheck('check');
}
$(this).attr('data-value', value == 1 ? 0 : 1);
});
/**
* 页面加载 loading
*/
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
......
......@@ -124,7 +124,13 @@ class Redis implements SessionHandlerInterface
*/
public function destroy($sessID)
{
return $this->handler->delete($this->config['session_name'] . $sessID) > 0;
if(method_exists($this->handler, 'delete'))
{
return $this->handler->delete($this->config['session_name'] . $sessID) > 0;
} elseif(method_exists($this->handler, 'del')) {
return $this->handler->del($this->config['session_name'] . $sessID) > 0;
}
return false;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册