d9289dda by sayhoChun

board save query

1 parent d75f5c4b
......@@ -58,6 +58,33 @@ if (! class_exists("ApiBoard"))
return json_encode($this->getArray($sql));
}
//자유게시판 게시물 작성
function saveBoard(){
$title=$this->req["title"];
$userFk=$this->req["userFk"];
$imgPathBoard1=$this->req["imgPathBoard1"];
$imgPathBoard2=$this->req["imgPathBoard2"];
$imgPathBoard3=$this->req["imgPathBoard3"];
$content=$this->req["content"];
$sql="
INSERT INTO tblBoard(userFk, title, imgPathBoard1, imgPathBoard2, imgPathBoard3, content, status, regDate)
VALUES
(
'{$userFk}',,
'{$title}',
'{$imgPathBoard1}',
'{$imgPathBoard2}',
'{$imgPathBoard3}',
'{$content}',
1,
NOW()
)
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다");
}
//자유게시판 리스트
function getListOfBoard(){
$sql="
......@@ -113,6 +140,34 @@ if (! class_exists("ApiBoard"))
return $this->makeResultJson("-1000", "내역이 없습니다.");
}
}
//고객센터 게시물 저장
function saveCS(){
$title=$this->req["title"];
$userFk=$this->req["userFk"];
$targetType=$this->req["targetType"];
$imgPathCS1=$this->req["imgPathCS1"];
$imgPathCS2=$this->req["imgPathCS2"];
$imgPathCS3=$this->req["imgPathCS3"];
$content=$this->req["content"];
$sql="
INSERT INTO tblCustomerService(userFk, title, targetType, imgPathCS1, imgPathCS2, imgPathCS3, content, status, regDate)
VALUES
(
'{$userFk}',
'{$title}',
'{$targetType}',
'{$imgPathCS1}',
'{$imgPathCS2}',
'{$imgPathCS3}',
'{$content}',
1,
NOW()
)
";
}
//고객센터 게시물 리스트
function getListOfCS(){
......@@ -171,6 +226,7 @@ if (! class_exists("ApiBoard"))
}
}
//AS 엄체 리스트
function getListOfCompany(){
$sql="
......@@ -302,9 +358,9 @@ if (! class_exists("ApiBoard"))
(
'{$userFk}',
'{$targetFk}',
(SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모의 그룹
(SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모 순서+1
(SELECT depth + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모 깊이+1
(SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1),
(SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1),
(SELECT depth + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1),
'{$content}',
'{$commentType}',
1,
......
......@@ -29,7 +29,6 @@ if (! class_exists("ApiStatic")){
";
return json_encode($this->getArray($sql));
}
}
}
......