Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e599782b
authored
Apr 28, 2019
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1、改返回的错误码
parent
26db6e8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/MessageApiController.php
View file @
e599782b
...
...
@@ -407,7 +407,7 @@ class MessageApiController extends Controller
}
$parent_id_path
=
$db
->
table
(
'lie_msg_classify'
)
->
select
(
'id_path'
)
->
where
(
'cls_id'
,
$parent_id
)
->
first
();
if
(
!
$parent_id_path
)
{
$this
->
Export
(
1
1
1
,
'未查找到根分类!'
);
$this
->
Export
(
1
200
1
,
'未查找到根分类!'
);
}
return
$parent_id_path
->
id_path
;
}
...
...
@@ -417,7 +417,7 @@ class MessageApiController extends Controller
if
(
$classify_model
[
'depth'
]
==
1
)
{
$root_id
=
$db
->
table
(
'lie_msg_classify'
)
->
insertGetId
(
$classify_model
);
if
(
!
$root_id
)
{
$this
->
Export
(
1
11
,
'创建根分类失败!'
);
$this
->
Export
(
1
2002
,
'创建根分类失败!'
);
}
$this
->
Export
(
0
,
'创建根分类成功'
);
}
else
{
...
...
@@ -427,18 +427,18 @@ class MessageApiController extends Controller
try
{
//添加一级/二级分类
$new_cls_id
=
$db
->
table
(
'lie_msg_classify'
)
->
insertGetId
(
$classify_model
);
if
(
!
$new_cls_id
)
{
$this
->
Export
(
1
11
,
'创建分类失败!'
);
$this
->
Export
(
1
2003
,
'创建分类失败!'
);
}
else
{
//补充id路径
$id_path
=
$parent_id_path
.
','
.
strval
(
$new_cls_id
);
$res
=
$db
->
table
(
'lie_msg_classify'
)
->
where
(
'cls_id'
,
$new_cls_id
)
->
update
([
'id_path'
=>
$id_path
]);
if
(
!
$res
)
{
$this
->
Export
(
1
11
,
'更新分类id路径失败!'
);
$this
->
Export
(
1
2004
,
'更新分类id路径失败!'
);
}
}
$db
->
commit
();
}
catch
(
Exception
$e
)
{
$db
->
rollback
();
$this
->
Export
(
1
11
,
'新增分类失败'
);
$this
->
Export
(
1
2005
,
'新增分类失败'
);
}
}
}
...
...
@@ -449,7 +449,7 @@ class MessageApiController extends Controller
$cls_id
=
$in_data
[
'sel_edit_sub_classify'
];
$res
=
$db
->
table
(
'lie_msg_classify'
)
->
where
(
'cls_id'
,
$cls_id
)
->
update
([
'name'
=>
$in_data
[
'edit_classify'
]]);
if
(
!
$res
&&
$res
!==
0
){
$this
->
Export
(
1
11
,
'编辑子分类失败'
);
$this
->
Export
(
1
2006
,
'编辑子分类失败'
);
}
}
else
{
$cls_id
=
$in_data
[
'sel_edit_classify'
];
...
...
@@ -457,16 +457,16 @@ class MessageApiController extends Controller
try
{
$res
=
$db
->
table
(
'lie_msg_classify'
)
->
where
(
'cls_id'
,
$cls_id
)
->
update
([
'name'
=>
$in_data
[
'edit_classify'
]]);
if
(
!
$res
&&
$res
!==
0
){
$this
->
Export
(
1
11
,
'编辑子分类失败'
);
$this
->
Export
(
1
2007
,
'编辑子分类失败'
);
}
$res
=
$db
->
table
(
'lie_msg_classify'
)
->
where
(
'parent_id'
,
$cls_id
)
->
update
([
'parent_name'
=>
$in_data
[
'edit_classify'
]]);
if
(
!
$res
&&
$res
!==
0
){
$this
->
Export
(
1
11
,
'编辑子分类失败'
);
$this
->
Export
(
1
2008
,
'编辑子分类失败'
);
}
$db
->
commit
();
}
catch
(
Exception
$e
)
{
$db
->
rollback
();
$this
->
Export
(
1
11
,
'编辑子分类失败'
);
$this
->
Export
(
1
2009
,
'编辑子分类失败'
);
}
}
}
...
...
@@ -501,7 +501,7 @@ class MessageApiController extends Controller
$parent_name
=
$db
->
table
(
'lie_msg_classify'
)
->
select
(
'name'
)
->
where
(
'cls_id'
,
$classify_model
[
'parent_id'
])
->
first
();
$classify_model
[
'parent_name'
]
=
$parent_name
->
name
;
}
else
{
$this
->
Export
(
1
11
,
'参数错误'
);
$this
->
Export
(
1
2010
,
'参数错误'
);
}
return
$classify_model
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment