切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
8 years ago
提交
241c6fc370190d0d698ada0df0a52ed2bcf7925a
1 个父辈
5cb04aab
修复普通搜索无法执行搜索的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
15 行增加
和
35 行删除
application/admin/library/traits/Backend.php
application/admin/library/traits/Backend.php
查看文件 @
241c6fc
...
...
@@ -11,7 +11,7 @@ trait Backend
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'htmlspecialchars'
]);
$this
->
request
->
filter
([
'strip_tags'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
...
...
@@ -45,7 +45,6 @@ trait Backend
{
if
(
$this
->
request
->
isPost
())
{
$this
->
code
=
-
1
;
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
...
...
@@ -65,24 +64,19 @@ trait Backend
$result
=
$this
->
model
->
save
(
$params
);
if
(
$result
!==
false
)
{
$this
->
code
=
1
;
$this
->
success
()
;
}
else
{
$this
->
msg
=
$this
->
model
->
getError
(
);
$this
->
error
(
$this
->
model
->
getError
()
);
}
}
catch
(
\think\exception\PDOException
$e
)
{
$this
->
msg
=
$e
->
getMessage
(
);
$this
->
error
(
$e
->
getMessage
()
);
}
}
else
{
$this
->
msg
=
__
(
'Parameter %s can not be empty'
,
''
);
}
return
;
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
return
$this
->
view
->
fetch
();
}
...
...
@@ -97,7 +91,6 @@ trait Backend
$this
->
error
(
__
(
'No Results were found'
));
if
(
$this
->
request
->
isPost
())
{
$this
->
code
=
-
1
;
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
...
...
@@ -111,30 +104,25 @@ trait Backend
if
(
$this
->
modelValidate
)
{
$name
=
basename
(
str_replace
(
'\\'
,
'/'
,
get_class
(
$this
->
model
)));
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.
add
'
:
true
)
:
$this
->
modelValidate
;
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.
edit
'
:
true
)
:
$this
->
modelValidate
;
$row
->
validate
(
$validate
);
}
$result
=
$row
->
save
(
$params
);
if
(
$result
!==
false
)
{
$this
->
code
=
1
;
$this
->
success
()
;
}
else
{
$this
->
msg
=
$row
->
getError
(
);
$this
->
error
(
$row
->
getError
()
);
}
}
catch
(
think\exception\PDOException
$e
)
{
$this
->
msg
=
$e
->
getMessage
(
);
$this
->
error
(
$e
->
getMessage
()
);
}
}
else
{
$this
->
msg
=
__
(
'Parameter %s can not be empty'
,
''
);
}
return
;
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
$this
->
view
->
assign
(
"row"
,
$row
);
return
$this
->
view
->
fetch
();
...
...
@@ -145,17 +133,15 @@ trait Backend
*/
public
function
del
(
$ids
=
""
)
{
$this
->
code
=
-
1
;
if
(
$ids
)
{
$count
=
$this
->
model
->
destroy
(
$ids
);
if
(
$count
)
{
$this
->
code
=
1
;
$this
->
success
()
;
}
}
return
;
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'ids'
));
}
/**
...
...
@@ -163,7 +149,6 @@ trait Backend
*/
public
function
multi
(
$ids
=
""
)
{
$this
->
code
=
-
1
;
$ids
=
$ids
?
$ids
:
$this
->
request
->
param
(
"ids"
);
if
(
$ids
)
{
...
...
@@ -176,21 +161,16 @@ trait Backend
$count
=
$this
->
model
->
where
(
$this
->
model
->
getPk
(),
'in'
,
$ids
)
->
update
(
$values
);
if
(
$count
)
{
$this
->
code
=
1
;
$this
->
success
()
;
}
}
else
{
$this
->
msg
=
__
(
'You have no permission'
);
$this
->
error
(
__
(
'You have no permission'
)
);
}
}
else
{
$this
->
msg
=
__
(
'Parameter %s can not be empty'
,
''
);
}
}
return
;
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'ids'
));
}
}
...
...
请
注册
或
登录
后发表评论