d6570ba4 by sayhoChun

main page and vehicle info handled

1 parent ed43601a
......@@ -87,19 +87,39 @@ if (! class_exists("ApiBoard"))
//자유게시판 리스트
function getListOfBoard(){
$searchText=$this->req["searchText"];
$searchType=$this->req["searchType"];
$where="status=1";
if(!empty($searchText)){
if(empty($search_type)){
$where.=" AND (U.userID LIKE '%{$searchText}%' OR B.title LIKE '%{$searchText}%')";
}
else if($searchType=="작성자"){
$where.=" AND U.userID LIKE '%{$searchText}%'";
}
else if($searchType=="제목"){
$where.=" AND B.title LIKE '%{$searchText}%'";
}
}
$sql="
SELECT COUNT(*)
FROM tblBoard
WHERE status='Y'
FROM tblBoard B
JOIN tblUser U ON B.userFk=U.no
{$where}
ORDER BY boardNo DESC
";
$this->rownum = $this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
$sql="
SELECT *
FROM tblBoard
WHERE status='Y'
SELECT B.*, U.userID
FROM tblBoard B
JOIN tblUser U B.userFk=U.no
{$where}
ORDER BY boardNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
......@@ -117,7 +137,7 @@ if (! class_exists("ApiBoard"))
$sql="
SELECT *
FROM tblBoard
WHERE boardNo='{$boardNo}' AND status='Y'
WHERE boardNo='{$boardNo}' AND status=1
LIMIT 1
";
$result=$this->getRow($sql);
......@@ -173,19 +193,39 @@ if (! class_exists("ApiBoard"))
//고객센터 게시물 리스트
function getListOfCS(){
$searchText=$this->req["searchText"];
$searchType=$this->req["searchType"];
$where="status=1";
if(!empty($searchText)){
if(empty($search_type)){
$where.=" AND (U.userID LIKE '%{$searchText}%' OR CS.title LIKE '%{$searchText}%')";
}
else if($searchType=="작성자"){
$where.=" AND U.userID LIKE '%{$searchText}%'";
}
else if($searchType=="제목"){
$where.=" AND CS.title LIKE '%{$searchText}%'";
}
}
$sql="
SELECT COUNT(*)
FROM tblCustomerService
WHERE status='Y'
FROM tblCustomerService CS
JOIN tblUser U ON CS.userFk=U.no
WHERE status=1
ORDER BY csNo DESC
";
$this->rownum = $this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
$sql="
SELECT *
FORM tblCustomerService
WHERE status='Y'
SELECT CS.*, U.userID
FORM tblCustomerService CS
JOIN tblUser U ON CS.userFk=U.no
WHERE status=1
ORDER BY csNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
......@@ -203,7 +243,7 @@ if (! class_exists("ApiBoard"))
$sql="
SELECT *
FROM tblCustomerService
WHERE csNo='{$csNo}' AND status='Y'
WHERE csNo='{$csNo}' AND status=1
LIMIT 1
";
$result=$this->getRow($sql);
......@@ -229,12 +269,12 @@ if (! class_exists("ApiBoard"))
}
//AS 엄체 리스트
//AS엄체 리스트
function getListOfCompany(){
$sql="
SELECT COUNT(*)
FROM tblCompany
WHERE status='Y'
WHERE status=1
ORDER BY companyNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
......@@ -243,7 +283,7 @@ if (! class_exists("ApiBoard"))
$sql="
SELECT *
FROM tblCompany
WHERE status='Y'
WHERE status=1
ORDER BY companyNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
......@@ -255,13 +295,14 @@ if (! class_exists("ApiBoard"))
return $this->makeResultJson("-1000", "내역이 없습니다.");
}
//AS업체 상세
function getInfoOfCompany(){
$companyNo=$this->req["no"];
$sql="
SELECT *
FROM tblCompany
WHERE companyNo='{$companyNo}' AND status='Y'
WHERE companyNo='{$companyNo}' AND status=1
LIMIT 1
";
$result=$this->getRow($sql);
......
......@@ -17,7 +17,7 @@ if (! class_exists("ApiStatic")){
LIMIT 1
";
$payload = $this->getRow($sql);
return json_encode($payload);
return $this->makeResultJson("1", "", $payload);
}
//기관인증
......@@ -27,7 +27,82 @@ if (! class_exists("ApiStatic")){
FROM tblOrganizationCert
ORDER BY certNo DESC
";
return json_encode($this->getArray($sql));
$list=$this->getArray($sql);
return $this->makeResultJson("1", "", $list);
}
function getMainImage(){
$sql="
SELECT imgPathMain, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
FROM tblMain
LIMIT 1
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
function getMainPhrase(){
$sql="
SELECT phrase1, phrase2
FROM tblMain
LIMIT 1
";
}
//메인페이지 공지사항
function getLatestNotice(){
$sql="
SELECT title
FROM tblNotice
ORDER BY noticeNo DESC
LIMIT 1
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
//메인페이지 이벤트
function getLatestEvent(){
$sql="
SELECT title
FROM tblEvent
ORDER BY eventNo DESC
LIMIT 1
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
function getKCBriefInfo(){
$sql="
SELECT address, telephone, fax, eMail
FROM tblKCSpecialVehicleInfo
";
}
function getListOfVehicle(){
$vehicleType=$this->req["vehicleType"];
$sql="
SELECT name, imgPathVehicle
FROM tblVehicle
WHERE vehicleType='{$vehicleType}' AND status=1
ORDER BY regDate DESC
";
$result=$this->getArray($sql);
return $this->makeResultJson("1", "", $result);
}
function getInfoOfVehicle(){
$vehicleNo=$this->req["vehicleNo"];
$sql="
SELECT *
FROM tblVehicle
WHERE vehicleNo='{$vehicleNo}'
";
$reusult=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
}
......
......@@ -542,6 +542,25 @@ if (! class_exists("ApiUser"))
return $this->makeResultJson("1", "", $userInfo, $addData);
}
function delUser(){
$userNo=$this->appUser["no"];
$sql="
UPDATE tblUser
SET expireDate=DATE_FORMAT(NOW() + interval 3 MONTH, '%Y%m%d')
WHERE userNo='{$userNo}' AND status=1
";
}
function delCancel(){
$userNo=$this->appUser["no"];
$sql="
UPDATE tblUser
SET expireDate=NULL
WHERE userNo='{$userNo}' AND status=1
";
}
......