31291c7f by sayhoChun

pk issue handled, organizationCert view handled

1 parent 651414d7
......@@ -116,7 +116,7 @@ if (! class_exists("ApiBoard"))
$this->setPageForDevice($this->rownum);
$sql="
SELECT B.*, U.userID
SELECT B.*, U.userID, U.userNo
FROM tblBoard B
JOIN tblUser U B.userFk=U.no
{$where}
......@@ -144,7 +144,7 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT C.*, U.userID
SELECT C.*, U.userID, U.userNo
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$boardNo}' AND commentType='FB'
......@@ -196,7 +196,7 @@ if (! class_exists("ApiBoard"))
$searchText=$this->req["searchText"];
$searchType=$this->req["searchType"];
$where="status=1";
$where="status=1 AND targetType = 1";
if(!empty($searchText)){
if(empty($search_type)){
......@@ -222,7 +222,7 @@ if (! class_exists("ApiBoard"))
$this->setPageForDevice($this->rownum);
$sql="
SELECT CS.*, U.userID
SELECT CS.*, U.userID, U.userNo
FORM tblCustomerService CS
JOIN tblUser U ON CS.userFk=U.no
WHERE status=1
......@@ -250,7 +250,7 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT U.userID, C.*
SELECT U.userNo, U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$csNo}' AND commentType='CS'
......@@ -271,19 +271,29 @@ if (! class_exists("ApiBoard"))
//AS엄체 리스트
function getListOfCompany(){
$provinceNumber=$this->req["provinceNumber"];
$cityNumber=$this->req["cityNumber"];
$searchText=$this->req["searchText"];
$where="status=1";
if(!empty($provinceNumber)){
$where.=" AND address LIKE (SELECT abbreviation FROM tblZipProvince WHERE provinceNumber='{$provinceNumber}')";
}
$sql="
SELECT COUNT(*)
FROM tblCompany
WHERE status=1
{$where}
ORDER BY companyNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
$sql="
SELECT *
SELECT companyNo, name, telephone
FROM tblCompany
WHERE status=1
{$where}
ORDER BY companyNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
......@@ -309,7 +319,7 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT U.userID, C.*
SELECT U.userNo, U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$companyNo}' AND commentType='CP'
......@@ -509,7 +519,7 @@ if (! class_exists("ApiBoard"))
function getListOfMyProductionSpec(){
$userFk=$this->appUser["no"];
$sql="
SELECT companyName, requestDate
SELECT productionNo, companyName, requestDate
FROM tblProductionSpec
WHERE userFk='{$userFk}'
ORDER BY productionNO DESC
......@@ -540,7 +550,7 @@ if (! class_exists("ApiBoard"))
}
$sql="
SELECT companyName, requestDate
SELECT productionNo, companyName, requestDate
FROM tblProduntionSpec
{$where}
ORDER BY productionNo DESC
......@@ -568,7 +578,7 @@ if (! class_exists("ApiBoard"))
//담당자 리스트
function getListOfManager(){
$sql="
SELECT name
SELECT managerNo, name
FROM tblManager
WHERE status=1
ORDER BY name ASC
......@@ -605,11 +615,13 @@ if (! class_exists("ApiBoard"))
$userNo=$this->appUser["no"];
$sql="
SELECT companyName, requestDate
SELECT productionNo, companyName, requestDate
FROM tblProductionSpec PS
JOIN tblLike L ON PS.productionNo=L.productionNo
WHERE L.userNo='{$userNo}'
";
$result=$this->getArray($sql);
return $this->makeResultJson("1","", $result);
}
......@@ -617,6 +629,7 @@ if (! class_exists("ApiBoard"))
} // 클래스 종료
}
?>
\ No newline at end of file
......
......@@ -16,12 +16,12 @@ if (! class_exists("ApiStatic")){
ORDER BY infoNo DESC
LIMIT 1
";
$payload = $this->getRow($sql);
return $this->makeResultJson("1", "", $payload);
$list = $this->getRow($sql);
return $this->makeResultJson("1", "", $list);
}
//기관인증
function getOrganizationCert(){
function getListOfOrganizationCert(){
$sql="
SELECT *
FROM tblOrganizationCert
......@@ -31,24 +31,29 @@ if (! class_exists("ApiStatic")){
return $this->makeResultJson("1", "", $list);
}
function getMainImage(){
function getInfoOfOrganizationCert(){
$certNo=$this->req["certNo"];
$sql="
SELECT imgPathMain, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
FROM tblMain
SELECT *
FROM tblOrganizationCert
WHERE certNo='{$certNo}'
LIMIT 1
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
$list=$this->getRow($sql);
return $this->makeResultJson("1", "", $list)
}
function getMainPhrase(){
//메인 페이지 정보
function getMain(){
$sql="
SELECT phrase1, phrase2
SELECT imgPathMain, phrase1, phrase2, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
FROM tblMain
LIMIT 1
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
//메인페이지 공지사항
function getLatestNotice(){
$sql="
......@@ -73,6 +78,7 @@ if (! class_exists("ApiStatic")){
return $this->makeResultJson("1", "", $result);
}
//메인 페이지 회사정보
function getKCBriefInfo(){
$sql="
SELECT address, telephone, fax, eMail
......@@ -80,11 +86,12 @@ if (! class_exists("ApiStatic")){
";
}
//탑차 분류별 리스트
function getListOfVehicle(){
$vehicleType=$this->req["vehicleType"];
$sql="
SELECT name, imgPathVehicle
SELECT vehicleNo, name, imgPathVehicle
FROM tblVehicle
WHERE vehicleType='{$vehicleType}' AND status=1
ORDER BY regDate DESC
......@@ -93,6 +100,7 @@ if (! class_exists("ApiStatic")){
return $this->makeResultJson("1", "", $result);
}
//탑차 정보
function getInfoOfVehicle(){
$vehicleNo=$this->req["vehicleNo"];
......@@ -105,6 +113,7 @@ if (! class_exists("ApiStatic")){
return $this->makeResultJson("1", "", $result);
}
//도 리스트
function getListOfProvince(){
$sql="
SELECT `provinceNumber`, `desc`, `abbreviation`
......@@ -115,6 +124,7 @@ if (! class_exists("ApiStatic")){
return $this->makeResultJson("1", "", $result);
}
//시 리스트
function getListOfCity(){
$provinceNumber=$this->req["provinceNumber"];
......