切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
Ackleys
6 years ago
提交者
Karson
6 years ago
提交
b46b338dcf72668ba86681c5edc24ebb6b12708c
2 个父辈
fdd68b5b
5c981879
!94 在生成CURD时,增加一个配置参数,来屏蔽前台提交过来的某些数据.
Merge pull request !94 from Ackleys/master
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
36 行增加
和
0 行删除
application/admin/library/traits/Backend.php
application/common/controller/Backend.php
application/admin/library/traits/Backend.php
查看文件 @
b46b338
...
...
@@ -6,6 +6,31 @@ trait Backend
{
/**
* 排除前台提交过来的字段
* @param $params
* @return array
*/
private
function
preExcludeFields
(
$params
)
{
if
(
is_array
(
$this
->
excludeFields
))
{
foreach
(
$this
->
excludeFields
as
$field
)
{
if
(
key_exists
(
$field
,
$params
))
{
unset
(
$params
[
$field
]);
}
}
}
else
{
if
(
key_exists
(
$this
->
excludeFields
,
$params
))
{
unset
(
$params
[
$this
->
excludeFields
]);
}
}
return
$params
;
}
/**
* 查看
*/
public
function
index
()
...
...
@@ -74,6 +99,9 @@ trait Backend
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
$params
=
$this
->
preExcludeFields
(
$params
);
if
(
$this
->
dataLimit
&&
$this
->
dataLimitFieldAutoFill
)
{
$params
[
$this
->
dataLimitField
]
=
$this
->
auth
->
id
;
}
...
...
@@ -118,6 +146,9 @@ trait Backend
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
$params
=
$this
->
preExcludeFields
(
$params
);
try
{
//是否采用模型验证
if
(
$this
->
modelValidate
)
{
...
...
application/common/controller/Backend.php
查看文件 @
b46b338
...
...
@@ -94,6 +94,11 @@ class Backend extends Controller
protected
$selectpageFields
=
'*'
;
/**
* 前台提交过来,需要排除的字段数据
*/
protected
$excludeFields
=
""
;
/**
* 导入文件首行类型
* 支持comment/name
* 表示注释或字段名
...
...
请
注册
或
登录
后发表评论