ed43601a by sayhoChun

production spec including like handled

1 parent d9289dda
......@@ -61,7 +61,7 @@ if (! class_exists("ApiBoard"))
//자유게시판 게시물 작성
function saveBoard(){
$title=$this->req["title"];
$userFk=$this->req["userFk"];
$userFk = $this->appUser["no"];
$imgPathBoard1=$this->req["imgPathBoard1"];
$imgPathBoard2=$this->req["imgPathBoard2"];
$imgPathBoard3=$this->req["imgPathBoard3"];
......@@ -144,7 +144,7 @@ if (! class_exists("ApiBoard"))
//고객센터 게시물 저장
function saveCS(){
$title=$this->req["title"];
$userFk=$this->req["userFk"];
$userFk = $this->appUser["no"];
$targetType=$this->req["targetType"];
$imgPathCS1=$this->req["imgPathCS1"];
$imgPathCS2=$this->req["imgPathCS2"];
......@@ -166,6 +166,8 @@ if (! class_exists("ApiBoard"))
NOW()
)
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다");
}
......@@ -208,7 +210,7 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT
SELECT U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$csNo}' AND commentType='CS'
......@@ -266,11 +268,11 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT
SELECT U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$companyNo}' AND commentType='CP'
ORDER BY commentNo DESC
ORDER BY C.ommentGroup ASC, C.gOrder ASC
";
$commentList=$this->getArray($sql);
......@@ -287,7 +289,7 @@ if (! class_exists("ApiBoard"))
function saveComment(){
$commentType=$this->req["commentType"];
$targetFk=$this->req["targetFk"];
$userFk=$this->req["userFk"];
$userFk = $this->appUser["no"];;
$content=$this->req["content"];
$parentNo=$this->req["parentNo"]; //부모 댓글의 기본키
......@@ -350,6 +352,7 @@ if (! class_exists("ApiBoard"))
WHERE commentGroup='{$childGroup}' AND gOrder > '{$childOrder}' + 1 AND status=1
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다");
}
else{ //부모에게 자식이 없을 때
$sql="
......@@ -375,6 +378,7 @@ if (! class_exists("ApiBoard"))
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
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다");
}
}
......@@ -382,6 +386,192 @@ if (! class_exists("ApiBoard"))
}
//제작사양서 저장
function saveProductionSpec(){
$userFk = $this->appUser["no"];
$requestDate=$this->req["requestDate"];
$companyName=$this->req["companyName"];
$vehicleTON=$this->req["vehicleTON"];
$vehicleText=$this->req["vehicleText"];
$vehicleType=$this->req["vehicleType"];
$productName=$thie->req["productName"];
$telephone=$this->req["telephone"];
$managerFk=$this->req["managerFk"];
$type=$this->req["type"];
$internalLength=$this->req["internalLength"];
$internalHeight=$this->req["internalHeight"];
$internalWidth=$this->req["internalWidth"];
$alCoil=$this->req["alCoil"];
$floor=$this->req["floor"];
$floorValue=$this->req["floorValue"];
$tent=$this->req["tent"];
$sideBoard=$this->req["sideBoard"];
$windStopper=$this->req["windStopper"];
$freezer=$this->req["freezer"];
$gate=$this->req["gate"];
$load=$this->req["load"];
$eTrackGate=$this->req["eTrackGate"];
$eTrackWing=$this->req["eTrackWing"];
$turnBuckle=$this->req["turnBuckle"];
$toolBucket=$this->req["toolBucket"];
$bumperFootHold=$this->req["bumperFootHold"];
$wingProtector=$this->req["wingProtector"];
$axis=$this->req["axis"];
$axisValue=$this->req["axisValue"];
$specialAddition=$this->req["specialAddition"];
$sql="
INSERT INTO tblProductionSpec(userFk, requestDate, companyName, vehicleTON, vehicleText, vehicleType, productName, telephone, managerFk, type, internalLength, internalHeight, internalWidth, alCoil,
floor, floorValue, tent, sideBoard, windStopper, freezer, gate, load, eTrackGate, eTrackWing, turnBuckle, toolBucket, bumperFootHold, wingProtector, axis, axisValue, specialAddition)
VALUES
(
'{$userFk}',
'{$requestDate}',
'{$companyName}',
'{$vehicleTON}',
'{$vehicleText}',
'{$vehicleType}',
'{$productName}',
'{$telephone}',
'{$managerFk}',
'{$type}',
'{$internalLength}',
'{$internalHeight}',
'{$internalWidth}',
'{$alCoil}',
'{$floor}',
'{$floorValue}',
'{$tent}',
'{$sideBoard}',
'{$windStopper}',
'{$freezer}',
'{$gate}',
'{$load}',
'{$eTrackGate}',
'{$eTrackWing}',
'{$turnBuckle}',
'{$toolBucket}',
'{$bumperFootHold}',
'{$wingProtector}',
'{$axis}',
'{$axisValue}',
'{$specialAddition}',
1,
NOW()
)
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다");
}
//내 제작사양서
function getListOfMyProductionSpec(){
$userFk=$this->appUser["no"];
$sql="
SELECT companyName, requestDate
FROM tblProductionSpec
WHERE userFk='{$userFk}'
ORDER BY productionNO DESC
";
$list=$this->getArray($sql);
if(sizeof($list)>0)
return $this->makeResultJson("1", "", $list);
else
return $this->makeResultJson("-1000", "내역이 없습니다.");
}
//제작사양서 리스트(검색)
function getListOfProductionSpec(){
$dateFormer=$this->req["dateFormer"];
$dateLatter=$this->req["dateLatter"];
$managerFk=$this->req["managerFk"];
$where="status=1";
if(!empty($dateFormer)){
$where .= " AND DATE_FORMAT(requestDate, '%Y%m%d') >= DATE_FORMAT('{$dateFormer}', '%Y%m%d')";
}
if(!empty($dateLatter)){
$where .= " AND DATE_FORMAT(requestDate, '%Y%m%d') <= DATE_FORMAT('{$dateLatter}', '%Y%m%d')";
}
if(!empty($managerFk)){
$where .= " AND managerFk='{$managerFk}'";
}
$sql="
SELECT companyName, requestDate
FROM tblProduntionSpec
{$where}
ORDER BY productionNo DESC
";
$list=$this->getArray($sql);
if(sizeof($list)>0)
return $this->makeResultJson("1", "", $list);
else
return $this->makeResultJson("-1000", "내역이 없습니다.");
}
//제작사양서 상세정보
function getInfoOfProductionSpec(){
$productionNo=$this->req["productionNo"];
$sql="
SELECT *
FROM tblProductionSpec
WHERE productionNo='{$productionNo}'
";
$info=$this->getRow($sql);
return $this->makeResultJson("1", "", $info);
}
//담당자 리스트
function getListOfManager(){
$sql="
SELECT name
FROM tblManager
WHERE status=1
ORDER BY name ASC
";
$list=$this->getArray($sql);
return $this->makeResultJson("1", "", $list);
}
//좋아요
function productionLike(){
$userNo=$this->appUser["userNo"];
$productionNo=$this->req["productionNo"];
$sql="
INSERT INTO tblLike(userNo, productionNo, regDate)
VALUES('{$userNo}', '{$productionNo}', NOW())
";
$this->update($sql);
return $this->makeResultJson("1", "등록되었습니다");
}
//좋아요 취소
function productionLikeCancel(){
$userNo=$this->req["userNo"];
$productionNo=$this->req["productionNo"];
$sql="DELETE FROM tblLike WHERE userNo='{$userNo}' AND productionNo='{$productionNo}'";
$this->update($sql);
return $this->makeResultJson("1", "취소되었습니다");
}
//제작사양서 보관함 리스트(좋아요 리스트)
function productionLikeList(){
$userNo=$this->appUser["no"];
$sql="
SELECT companyName, requestDate
FROM tblProductionSpec PS
JOIN tblLike L ON PS.productionNo=L.productionNo
WHERE L.userNo='{$userNo}'
";
}
......