Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
abef6b0f
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
abef6b0f
编写于
6月 05, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
数据列表优化
上级
49e1db1c
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
622 addition
and
231 deletion
+622
-231
application/admin/controller/Common.php
application/admin/controller/Common.php
+18
-19
application/admin/controller/Goods.php
application/admin/controller/Goods.php
+3
-3
application/admin/form/Goods.php
application/admin/form/Goods.php
+59
-5
application/admin/view/default/goods/module/operate.html
application/admin/view/default/goods/module/operate.html
+2
-2
application/admin/view/default/public/form.html
application/admin/view/default/public/form.html
+60
-16
application/common.php
application/common.php
+19
-29
application/module/FormHandle.php
application/module/FormHandle.php
+0
-148
application/module/FormHandleModule.php
application/module/FormHandleModule.php
+405
-0
application/module/ViewIncludeModule.php
application/module/ViewIncludeModule.php
+1
-1
application/tags.php
application/tags.php
+16
-0
public/static/common/css/common.css
public/static/common/css/common.css
+8
-0
public/static/common/js/common.js
public/static/common/js/common.js
+17
-7
sourcecode/alipay/pages/plugins/distribution/user/user.acss
sourcecode/alipay/pages/plugins/distribution/user/user.acss
+1
-0
sourcecode/alipay/pages/plugins/membershiplevelvip/user/user.acss
...de/alipay/pages/plugins/membershiplevelvip/user/user.acss
+1
-0
sourcecode/baidu/pages/plugins/distribution/user/user.css
sourcecode/baidu/pages/plugins/distribution/user/user.css
+1
-0
sourcecode/toutiao/pages/plugins/distribution/user/user.ttss
sourcecode/toutiao/pages/plugins/distribution/user/user.ttss
+1
-0
sourcecode/toutiao/pages/plugins/membershiplevelvip/user/user.ttss
...e/toutiao/pages/plugins/membershiplevelvip/user/user.ttss
+1
-0
sourcecode/weixin/pages/plugins/distribution/user/user.wxss
sourcecode/weixin/pages/plugins/distribution/user/user.wxss
+1
-0
sourcecode/weixin/pages/plugins/membershiplevelvip/user/user.wxss
...de/weixin/pages/plugins/membershiplevelvip/user/user.wxss
+1
-0
thinkphp/library/think/session/driver/Redis.php
thinkphp/library/think/session/driver/Redis.php
+7
-1
未找到文件。
application/admin/controller/Common.php
浏览文件 @
abef6b0f
...
...
@@ -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;
}
/**
...
...
application/admin/controller/Goods.php
浏览文件 @
abef6b0f
...
...
@@ -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
,
...
...
application/admin/form/Goods.php
浏览文件 @
abef6b0f
...
...
@@ -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
application/admin/view/default/goods/module/operate.html
浏览文件 @
abef6b0f
<!-- 操作栏 -->
<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
application/admin/view/default/public/form.html
浏览文件 @
abef6b0f
此差异已折叠。
点击以展开。
application/common.php
浏览文件 @
abef6b0f
...
...
@@ -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-0
2
* @date 2020-06-0
5
* @desc description
* @param [string] $name [模块名称]
* @param [string] $group [模块组(admin,index)]
* @param [mixed] $params [参数数据]
* @param [array] $params [输入参数]
*/
function
Form
TableLoad
(
$name
,
$group
=
'admin'
,
$params
=
[])
function
Form
ModulePath
(
$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\ViewInclude
Module
'
;
if
(
!
class_exists
(
$module
))
{
return
'模块视图控制器未定义['
.
$module
.
']'
;
...
...
application/module/FormHandle.php
已删除
100644 → 0
浏览文件 @
49e1db1c
<?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
application/module/FormHandleModule.php
0 → 100644
浏览文件 @
abef6b0f
<?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
application/module/ViewInclude.php
→
application/module/ViewInclude
Module
.php
浏览文件 @
abef6b0f
...
...
@@ -20,7 +20,7 @@ use think\Controller;
* @date 2020-05-25
* @desc description
*/
class
ViewInclude
extends
Controller
class
ViewInclude
Module
extends
Controller
{
/**
* 构造方法
...
...
application/tags.php
浏览文件 @
abef6b0f
...
...
@@ -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
public/static/common/css/common.css
浏览文件 @
abef6b0f
...
...
@@ -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
public/static/common/js/common.js
浏览文件 @
abef6b0f
...
...
@@ -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
*/
...
...
sourcecode/alipay/pages/plugins/distribution/user/user.acss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
sourcecode/alipay/pages/plugins/membershiplevelvip/user/user.acss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
sourcecode/baidu/pages/plugins/distribution/user/user.css
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item
{
padding-bottom
:
30
rpx
;
width
:
165
rpx
;
}
.head-item
.avatar
{
padding
:
10
rpx
;
...
...
sourcecode/toutiao/pages/plugins/distribution/user/user.ttss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
sourcecode/toutiao/pages/plugins/membershiplevelvip/user/user.ttss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
sourcecode/weixin/pages/plugins/distribution/user/user.wxss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
sourcecode/weixin/pages/plugins/membershiplevelvip/user/user.wxss
浏览文件 @
abef6b0f
...
...
@@ -9,6 +9,7 @@
}
.head-item {
padding-bottom: 30rpx;
width: 165rpx;
}
.head-item .avatar {
padding: 10rpx;
...
...
thinkphp/library/think/session/driver/Redis.php
浏览文件 @
abef6b0f
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录