board save query
Showing
2 changed files
with
59 additions
and
4 deletions
... | @@ -58,6 +58,33 @@ if (! class_exists("ApiBoard")) | ... | @@ -58,6 +58,33 @@ if (! class_exists("ApiBoard")) |
58 | return json_encode($this->getArray($sql)); | 58 | return json_encode($this->getArray($sql)); |
59 | } | 59 | } |
60 | 60 | ||
61 | //자유게시판 게시물 작성 | ||
62 | function saveBoard(){ | ||
63 | $title=$this->req["title"]; | ||
64 | $userFk=$this->req["userFk"]; | ||
65 | $imgPathBoard1=$this->req["imgPathBoard1"]; | ||
66 | $imgPathBoard2=$this->req["imgPathBoard2"]; | ||
67 | $imgPathBoard3=$this->req["imgPathBoard3"]; | ||
68 | $content=$this->req["content"]; | ||
69 | |||
70 | $sql=" | ||
71 | INSERT INTO tblBoard(userFk, title, imgPathBoard1, imgPathBoard2, imgPathBoard3, content, status, regDate) | ||
72 | VALUES | ||
73 | ( | ||
74 | '{$userFk}',, | ||
75 | '{$title}', | ||
76 | '{$imgPathBoard1}', | ||
77 | '{$imgPathBoard2}', | ||
78 | '{$imgPathBoard3}', | ||
79 | '{$content}', | ||
80 | 1, | ||
81 | NOW() | ||
82 | ) | ||
83 | "; | ||
84 | $this->update($sql); | ||
85 | return $this->makeResultJson("1", "저장되었습니다"); | ||
86 | } | ||
87 | |||
61 | //자유게시판 리스트 | 88 | //자유게시판 리스트 |
62 | function getListOfBoard(){ | 89 | function getListOfBoard(){ |
63 | $sql=" | 90 | $sql=" |
... | @@ -113,6 +140,34 @@ if (! class_exists("ApiBoard")) | ... | @@ -113,6 +140,34 @@ if (! class_exists("ApiBoard")) |
113 | return $this->makeResultJson("-1000", "내역이 없습니다."); | 140 | return $this->makeResultJson("-1000", "내역이 없습니다."); |
114 | } | 141 | } |
115 | } | 142 | } |
143 | |||
144 | //고객센터 게시물 저장 | ||
145 | function saveCS(){ | ||
146 | $title=$this->req["title"]; | ||
147 | $userFk=$this->req["userFk"]; | ||
148 | $targetType=$this->req["targetType"]; | ||
149 | $imgPathCS1=$this->req["imgPathCS1"]; | ||
150 | $imgPathCS2=$this->req["imgPathCS2"]; | ||
151 | $imgPathCS3=$this->req["imgPathCS3"]; | ||
152 | $content=$this->req["content"]; | ||
153 | |||
154 | $sql=" | ||
155 | INSERT INTO tblCustomerService(userFk, title, targetType, imgPathCS1, imgPathCS2, imgPathCS3, content, status, regDate) | ||
156 | VALUES | ||
157 | ( | ||
158 | '{$userFk}', | ||
159 | '{$title}', | ||
160 | '{$targetType}', | ||
161 | '{$imgPathCS1}', | ||
162 | '{$imgPathCS2}', | ||
163 | '{$imgPathCS3}', | ||
164 | '{$content}', | ||
165 | 1, | ||
166 | NOW() | ||
167 | ) | ||
168 | "; | ||
169 | |||
170 | } | ||
116 | 171 | ||
117 | //고객센터 게시물 리스트 | 172 | //고객센터 게시물 리스트 |
118 | function getListOfCS(){ | 173 | function getListOfCS(){ |
... | @@ -171,6 +226,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -171,6 +226,7 @@ if (! class_exists("ApiBoard")) |
171 | } | 226 | } |
172 | } | 227 | } |
173 | 228 | ||
229 | |||
174 | //AS 엄체 리스트 | 230 | //AS 엄체 리스트 |
175 | function getListOfCompany(){ | 231 | function getListOfCompany(){ |
176 | $sql=" | 232 | $sql=" |
... | @@ -302,9 +358,9 @@ if (! class_exists("ApiBoard")) | ... | @@ -302,9 +358,9 @@ if (! class_exists("ApiBoard")) |
302 | ( | 358 | ( |
303 | '{$userFk}', | 359 | '{$userFk}', |
304 | '{$targetFk}', | 360 | '{$targetFk}', |
305 | (SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모의 그룹 | 361 | (SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), |
306 | (SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모 순서+1 | 362 | (SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), |
307 | (SELECT depth + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), //부모 깊이+1 | 363 | (SELECT depth + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1), |
308 | '{$content}', | 364 | '{$content}', |
309 | '{$commentType}', | 365 | '{$commentType}', |
310 | 1, | 366 | 1, | ... | ... |
-
Please register or sign in to post a comment