Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sayhoChun
/
kcSpecialVehicle
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
05145a47
authored
2017-02-14 13:23:09 +0900
by
sayhoChun
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
comment reply error handled
1 parent
c6547bcf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
common/classes/ApiBoard.php
common/classes/apiTest.php
common/classes/ApiBoard.php
View file @
05145a4
...
...
@@ -386,7 +386,7 @@ if (! class_exists("ApiBoard"))
FROM tblComment
WHERE commentType='
{
$commentType
}
'
AND commentGroup=(SELECT commentGroup FROM tblComment WHERE commentType='
{
$commentType
}
' AND commentNo='
{
$parentNo
}
' AND status=1)
AND gOrder=(SELECT gOrder
+
1 FROM tblComment WHERE commentType='
{
$commentType
}
' AND commentNo='
{
$parentNo
}
' AND status=1)
AND gOrder=(SELECT gOrder
+
1 FROM tblComment WHERE commentType='
{
$commentType
}
' AND commentNo='
{
$parentNo
}
' AND status=1)
AND depth=(SELECT depth+1 FROM tblComment WHERE commentType='
{
$commentType
}
' AND commentNo='
{
$parentNo
}
' AND status=1)
ORDER BY gOrder DESC
LIMIT 0, 1
...
...
@@ -396,9 +396,9 @@ if (! class_exists("ApiBoard"))
$childGroup
=
$child
[
"commentGroup"
];
$childOrder
=
$child
[
"gOrder"
];
$childDepth
=
$child
[
"depth"
];
if
(
!
empty
(
$childNo
)){
//부모에게 자식이 있을 때
echo
"child exists"
;
$sql
=
"
INSERT INTO tblComment(userFk, targetFk, commentGroup, gOrder, depth, content, commentType, status, regDate)
VALUES
...
...
@@ -416,16 +416,34 @@ if (! class_exists("ApiBoard"))
"
;
$this
->
update
(
$sql
);
$currentNo
=
$this
->
mysql_insert_id
();
$sql
=
"
UPDATE tblComment
SET gOrder=gOrder+1
WHERE commentGroup='
{
$childGroup
}
' AND gOrder >
'
{
$childOrder
}
' + 1
AND status=1
WHERE commentGroup='
{
$childGroup
}
' AND gOrder >
= '
{
$childOrder
}
' + 1 AND commentNo <> '
{
$currentNo
}
'
AND status=1
"
;
$this
->
update
(
$sql
);
$sql
=
"
SELECT COUNT(*) AS count
FROM tblComment
WHERE commentGroup='
{
$childGroup
}
' AND gOrder='
{
$childOrder
}
'+1;
"
;
$count
=
$this
->
getValue
(
$sql
,
"count"
);
if
(
$count
!=
1
){
$sql
=
"
UPDATE tblComment
SET gOrder=gOrder+1
WHERE commentNo='
{
$currentNo
}
'
"
;
$this
->
update
(
$sql
);
}
return
$this
->
makeResultJson
(
"1"
,
"저장되었습니다"
);
}
else
{
//부모에게 자식이 없을 때
echo
"no child"
;
$sql
=
"
INSERT INTO tblComment(userFk, targetFk, commentGroup, gOrder, depth, content, commentType, status, regDate)
VALUES
...
...
@@ -459,10 +477,7 @@ if (! class_exists("ApiBoard"))
$this
->
update
(
$sql
);
return
$this
->
makeResultJson
(
"1"
,
"저장되었습니다"
);
}
}
}
//제작사양서 저장
...
...
common/classes/apiTest.php
View file @
05145a4
...
...
@@ -61,8 +61,8 @@ $(document).ready(function(){
"commentType"
:
"FB"
,
"targetFk"
:
1
,
"userFk"
:
1
,
"content"
:
"
37의 대대댓글"
,
"parentNo"
:
37
"content"
:
"
세 번째 부모"
},
success
:
function
(
data
){
alert
(
data
.
returnmessage
);
...
...
Please
register
or
sign in
to post a comment