production spec including like handled
Showing
1 changed file
with
196 additions
and
6 deletions
... | @@ -61,7 +61,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -61,7 +61,7 @@ if (! class_exists("ApiBoard")) |
61 | //자유게시판 게시물 작성 | 61 | //자유게시판 게시물 작성 |
62 | function saveBoard(){ | 62 | function saveBoard(){ |
63 | $title=$this->req["title"]; | 63 | $title=$this->req["title"]; |
64 | $userFk=$this->req["userFk"]; | 64 | $userFk = $this->appUser["no"]; |
65 | $imgPathBoard1=$this->req["imgPathBoard1"]; | 65 | $imgPathBoard1=$this->req["imgPathBoard1"]; |
66 | $imgPathBoard2=$this->req["imgPathBoard2"]; | 66 | $imgPathBoard2=$this->req["imgPathBoard2"]; |
67 | $imgPathBoard3=$this->req["imgPathBoard3"]; | 67 | $imgPathBoard3=$this->req["imgPathBoard3"]; |
... | @@ -144,7 +144,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -144,7 +144,7 @@ if (! class_exists("ApiBoard")) |
144 | //고객센터 게시물 저장 | 144 | //고객센터 게시물 저장 |
145 | function saveCS(){ | 145 | function saveCS(){ |
146 | $title=$this->req["title"]; | 146 | $title=$this->req["title"]; |
147 | $userFk=$this->req["userFk"]; | 147 | $userFk = $this->appUser["no"]; |
148 | $targetType=$this->req["targetType"]; | 148 | $targetType=$this->req["targetType"]; |
149 | $imgPathCS1=$this->req["imgPathCS1"]; | 149 | $imgPathCS1=$this->req["imgPathCS1"]; |
150 | $imgPathCS2=$this->req["imgPathCS2"]; | 150 | $imgPathCS2=$this->req["imgPathCS2"]; |
... | @@ -166,6 +166,8 @@ if (! class_exists("ApiBoard")) | ... | @@ -166,6 +166,8 @@ if (! class_exists("ApiBoard")) |
166 | NOW() | 166 | NOW() |
167 | ) | 167 | ) |
168 | "; | 168 | "; |
169 | $this->update($sql); | ||
170 | return $this->makeResultJson("1", "저장되었습니다"); | ||
169 | 171 | ||
170 | } | 172 | } |
171 | 173 | ||
... | @@ -208,7 +210,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -208,7 +210,7 @@ if (! class_exists("ApiBoard")) |
208 | 210 | ||
209 | if($result != null){ | 211 | if($result != null){ |
210 | $sql=" | 212 | $sql=" |
211 | SELECT | 213 | SELECT U.userID, C.* |
212 | FROM tblComment C | 214 | FROM tblComment C |
213 | JOIN tblUser U ON C.userFk=U.userNo | 215 | JOIN tblUser U ON C.userFk=U.userNo |
214 | WHERE targetFk='{$csNo}' AND commentType='CS' | 216 | WHERE targetFk='{$csNo}' AND commentType='CS' |
... | @@ -266,11 +268,11 @@ if (! class_exists("ApiBoard")) | ... | @@ -266,11 +268,11 @@ if (! class_exists("ApiBoard")) |
266 | 268 | ||
267 | if($result != null){ | 269 | if($result != null){ |
268 | $sql=" | 270 | $sql=" |
269 | SELECT | 271 | SELECT U.userID, C.* |
270 | FROM tblComment C | 272 | FROM tblComment C |
271 | JOIN tblUser U ON C.userFk=U.userNo | 273 | JOIN tblUser U ON C.userFk=U.userNo |
272 | WHERE targetFk='{$companyNo}' AND commentType='CP' | 274 | WHERE targetFk='{$companyNo}' AND commentType='CP' |
273 | ORDER BY commentNo DESC | 275 | ORDER BY C.ommentGroup ASC, C.gOrder ASC |
274 | "; | 276 | "; |
275 | $commentList=$this->getArray($sql); | 277 | $commentList=$this->getArray($sql); |
276 | 278 | ||
... | @@ -287,7 +289,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -287,7 +289,7 @@ if (! class_exists("ApiBoard")) |
287 | function saveComment(){ | 289 | function saveComment(){ |
288 | $commentType=$this->req["commentType"]; | 290 | $commentType=$this->req["commentType"]; |
289 | $targetFk=$this->req["targetFk"]; | 291 | $targetFk=$this->req["targetFk"]; |
290 | $userFk=$this->req["userFk"]; | 292 | $userFk = $this->appUser["no"];; |
291 | $content=$this->req["content"]; | 293 | $content=$this->req["content"]; |
292 | $parentNo=$this->req["parentNo"]; //부모 댓글의 기본키 | 294 | $parentNo=$this->req["parentNo"]; //부모 댓글의 기본키 |
293 | 295 | ||
... | @@ -350,6 +352,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -350,6 +352,7 @@ if (! class_exists("ApiBoard")) |
350 | WHERE commentGroup='{$childGroup}' AND gOrder > '{$childOrder}' + 1 AND status=1 | 352 | WHERE commentGroup='{$childGroup}' AND gOrder > '{$childOrder}' + 1 AND status=1 |
351 | "; | 353 | "; |
352 | $this->update($sql); | 354 | $this->update($sql); |
355 | return $this->makeResultJson("1", "저장되었습니다"); | ||
353 | } | 356 | } |
354 | else{ //부모에게 자식이 없을 때 | 357 | else{ //부모에게 자식이 없을 때 |
355 | $sql=" | 358 | $sql=" |
... | @@ -375,6 +378,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -375,6 +378,7 @@ if (! class_exists("ApiBoard")) |
375 | WHERE commentGroup=(SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1) AND gOrder > (SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1) AND status=1 | 378 | WHERE commentGroup=(SELECT commentGroup FROM tblComment WHERE commentNo='{$parentNo}' AND status=1) AND gOrder > (SELECT gOrder + 1 FROM tblComment WHERE commentNo='{$parentNo}' AND status=1) AND status=1 |
376 | "; | 379 | "; |
377 | $this->update($sql); | 380 | $this->update($sql); |
381 | return $this->makeResultJson("1", "저장되었습니다"); | ||
378 | } | 382 | } |
379 | 383 | ||
380 | } | 384 | } |
... | @@ -382,6 +386,192 @@ if (! class_exists("ApiBoard")) | ... | @@ -382,6 +386,192 @@ if (! class_exists("ApiBoard")) |
382 | 386 | ||
383 | } | 387 | } |
384 | 388 | ||
389 | //제작사양서 저장 | ||
390 | function saveProductionSpec(){ | ||
391 | $userFk = $this->appUser["no"]; | ||
392 | $requestDate=$this->req["requestDate"]; | ||
393 | $companyName=$this->req["companyName"]; | ||
394 | $vehicleTON=$this->req["vehicleTON"]; | ||
395 | $vehicleText=$this->req["vehicleText"]; | ||
396 | $vehicleType=$this->req["vehicleType"]; | ||
397 | $productName=$thie->req["productName"]; | ||
398 | $telephone=$this->req["telephone"]; | ||
399 | $managerFk=$this->req["managerFk"]; | ||
400 | $type=$this->req["type"]; | ||
401 | $internalLength=$this->req["internalLength"]; | ||
402 | $internalHeight=$this->req["internalHeight"]; | ||
403 | $internalWidth=$this->req["internalWidth"]; | ||
404 | $alCoil=$this->req["alCoil"]; | ||
405 | $floor=$this->req["floor"]; | ||
406 | $floorValue=$this->req["floorValue"]; | ||
407 | $tent=$this->req["tent"]; | ||
408 | $sideBoard=$this->req["sideBoard"]; | ||
409 | $windStopper=$this->req["windStopper"]; | ||
410 | $freezer=$this->req["freezer"]; | ||
411 | $gate=$this->req["gate"]; | ||
412 | $load=$this->req["load"]; | ||
413 | $eTrackGate=$this->req["eTrackGate"]; | ||
414 | $eTrackWing=$this->req["eTrackWing"]; | ||
415 | $turnBuckle=$this->req["turnBuckle"]; | ||
416 | $toolBucket=$this->req["toolBucket"]; | ||
417 | $bumperFootHold=$this->req["bumperFootHold"]; | ||
418 | $wingProtector=$this->req["wingProtector"]; | ||
419 | $axis=$this->req["axis"]; | ||
420 | $axisValue=$this->req["axisValue"]; | ||
421 | $specialAddition=$this->req["specialAddition"]; | ||
422 | |||
423 | $sql=" | ||
424 | INSERT INTO tblProductionSpec(userFk, requestDate, companyName, vehicleTON, vehicleText, vehicleType, productName, telephone, managerFk, type, internalLength, internalHeight, internalWidth, alCoil, | ||
425 | floor, floorValue, tent, sideBoard, windStopper, freezer, gate, load, eTrackGate, eTrackWing, turnBuckle, toolBucket, bumperFootHold, wingProtector, axis, axisValue, specialAddition) | ||
426 | VALUES | ||
427 | ( | ||
428 | '{$userFk}', | ||
429 | '{$requestDate}', | ||
430 | '{$companyName}', | ||
431 | '{$vehicleTON}', | ||
432 | '{$vehicleText}', | ||
433 | '{$vehicleType}', | ||
434 | '{$productName}', | ||
435 | '{$telephone}', | ||
436 | '{$managerFk}', | ||
437 | '{$type}', | ||
438 | '{$internalLength}', | ||
439 | '{$internalHeight}', | ||
440 | '{$internalWidth}', | ||
441 | '{$alCoil}', | ||
442 | '{$floor}', | ||
443 | '{$floorValue}', | ||
444 | '{$tent}', | ||
445 | '{$sideBoard}', | ||
446 | '{$windStopper}', | ||
447 | '{$freezer}', | ||
448 | '{$gate}', | ||
449 | '{$load}', | ||
450 | '{$eTrackGate}', | ||
451 | '{$eTrackWing}', | ||
452 | '{$turnBuckle}', | ||
453 | '{$toolBucket}', | ||
454 | '{$bumperFootHold}', | ||
455 | '{$wingProtector}', | ||
456 | '{$axis}', | ||
457 | '{$axisValue}', | ||
458 | '{$specialAddition}', | ||
459 | 1, | ||
460 | NOW() | ||
461 | ) | ||
462 | "; | ||
463 | $this->update($sql); | ||
464 | return $this->makeResultJson("1", "저장되었습니다"); | ||
465 | } | ||
466 | |||
467 | //내 제작사양서 | ||
468 | function getListOfMyProductionSpec(){ | ||
469 | $userFk=$this->appUser["no"]; | ||
470 | $sql=" | ||
471 | SELECT companyName, requestDate | ||
472 | FROM tblProductionSpec | ||
473 | WHERE userFk='{$userFk}' | ||
474 | ORDER BY productionNO DESC | ||
475 | "; | ||
476 | $list=$this->getArray($sql); | ||
477 | |||
478 | if(sizeof($list)>0) | ||
479 | return $this->makeResultJson("1", "", $list); | ||
480 | else | ||
481 | return $this->makeResultJson("-1000", "내역이 없습니다."); | ||
482 | } | ||
483 | |||
484 | //제작사양서 리스트(검색) | ||
485 | function getListOfProductionSpec(){ | ||
486 | $dateFormer=$this->req["dateFormer"]; | ||
487 | $dateLatter=$this->req["dateLatter"]; | ||
488 | $managerFk=$this->req["managerFk"]; | ||
489 | |||
490 | $where="status=1"; | ||
491 | if(!empty($dateFormer)){ | ||
492 | $where .= " AND DATE_FORMAT(requestDate, '%Y%m%d') >= DATE_FORMAT('{$dateFormer}', '%Y%m%d')"; | ||
493 | } | ||
494 | if(!empty($dateLatter)){ | ||
495 | $where .= " AND DATE_FORMAT(requestDate, '%Y%m%d') <= DATE_FORMAT('{$dateLatter}', '%Y%m%d')"; | ||
496 | } | ||
497 | if(!empty($managerFk)){ | ||
498 | $where .= " AND managerFk='{$managerFk}'"; | ||
499 | } | ||
500 | |||
501 | $sql=" | ||
502 | SELECT companyName, requestDate | ||
503 | FROM tblProduntionSpec | ||
504 | {$where} | ||
505 | ORDER BY productionNo DESC | ||
506 | "; | ||
507 | $list=$this->getArray($sql); | ||
508 | |||
509 | if(sizeof($list)>0) | ||
510 | return $this->makeResultJson("1", "", $list); | ||
511 | else | ||
512 | return $this->makeResultJson("-1000", "내역이 없습니다."); | ||
513 | } | ||
514 | |||
515 | //제작사양서 상세정보 | ||
516 | function getInfoOfProductionSpec(){ | ||
517 | $productionNo=$this->req["productionNo"]; | ||
518 | $sql=" | ||
519 | SELECT * | ||
520 | FROM tblProductionSpec | ||
521 | WHERE productionNo='{$productionNo}' | ||
522 | "; | ||
523 | $info=$this->getRow($sql); | ||
524 | return $this->makeResultJson("1", "", $info); | ||
525 | } | ||
526 | |||
527 | //담당자 리스트 | ||
528 | function getListOfManager(){ | ||
529 | $sql=" | ||
530 | SELECT name | ||
531 | FROM tblManager | ||
532 | WHERE status=1 | ||
533 | ORDER BY name ASC | ||
534 | "; | ||
535 | $list=$this->getArray($sql); | ||
536 | return $this->makeResultJson("1", "", $list); | ||
537 | } | ||
538 | |||
539 | //좋아요 | ||
540 | function productionLike(){ | ||
541 | $userNo=$this->appUser["userNo"]; | ||
542 | $productionNo=$this->req["productionNo"]; | ||
543 | |||
544 | $sql=" | ||
545 | INSERT INTO tblLike(userNo, productionNo, regDate) | ||
546 | VALUES('{$userNo}', '{$productionNo}', NOW()) | ||
547 | "; | ||
548 | $this->update($sql); | ||
549 | return $this->makeResultJson("1", "등록되었습니다"); | ||
550 | } | ||
551 | |||
552 | //좋아요 취소 | ||
553 | function productionLikeCancel(){ | ||
554 | $userNo=$this->req["userNo"]; | ||
555 | $productionNo=$this->req["productionNo"]; | ||
556 | |||
557 | $sql="DELETE FROM tblLike WHERE userNo='{$userNo}' AND productionNo='{$productionNo}'"; | ||
558 | $this->update($sql); | ||
559 | return $this->makeResultJson("1", "취소되었습니다"); | ||
560 | } | ||
561 | |||
562 | //제작사양서 보관함 리스트(좋아요 리스트) | ||
563 | function productionLikeList(){ | ||
564 | $userNo=$this->appUser["no"]; | ||
565 | |||
566 | $sql=" | ||
567 | SELECT companyName, requestDate | ||
568 | FROM tblProductionSpec PS | ||
569 | JOIN tblLike L ON PS.productionNo=L.productionNo | ||
570 | WHERE L.userNo='{$userNo}' | ||
571 | "; | ||
572 | } | ||
573 | |||
574 | |||
385 | 575 | ||
386 | 576 | ||
387 | 577 | ... | ... |
-
Please register or sign in to post a comment