31291c7f by sayhoChun

pk issue handled, organizationCert view handled

1 parent 651414d7
...@@ -116,7 +116,7 @@ if (! class_exists("ApiBoard")) ...@@ -116,7 +116,7 @@ if (! class_exists("ApiBoard"))
116 $this->setPageForDevice($this->rownum); 116 $this->setPageForDevice($this->rownum);
117 117
118 $sql=" 118 $sql="
119 SELECT B.*, U.userID 119 SELECT B.*, U.userID, U.userNo
120 FROM tblBoard B 120 FROM tblBoard B
121 JOIN tblUser U B.userFk=U.no 121 JOIN tblUser U B.userFk=U.no
122 {$where} 122 {$where}
...@@ -144,7 +144,7 @@ if (! class_exists("ApiBoard")) ...@@ -144,7 +144,7 @@ if (! class_exists("ApiBoard"))
144 144
145 if($result != null){ 145 if($result != null){
146 $sql=" 146 $sql="
147 SELECT C.*, U.userID 147 SELECT C.*, U.userID, U.userNo
148 FROM tblComment C 148 FROM tblComment C
149 JOIN tblUser U ON C.userFk=U.userNo 149 JOIN tblUser U ON C.userFk=U.userNo
150 WHERE targetFk='{$boardNo}' AND commentType='FB' 150 WHERE targetFk='{$boardNo}' AND commentType='FB'
...@@ -196,7 +196,7 @@ if (! class_exists("ApiBoard")) ...@@ -196,7 +196,7 @@ if (! class_exists("ApiBoard"))
196 $searchText=$this->req["searchText"]; 196 $searchText=$this->req["searchText"];
197 $searchType=$this->req["searchType"]; 197 $searchType=$this->req["searchType"];
198 198
199 $where="status=1"; 199 $where="status=1 AND targetType = 1";
200 200
201 if(!empty($searchText)){ 201 if(!empty($searchText)){
202 if(empty($search_type)){ 202 if(empty($search_type)){
...@@ -222,7 +222,7 @@ if (! class_exists("ApiBoard")) ...@@ -222,7 +222,7 @@ if (! class_exists("ApiBoard"))
222 $this->setPageForDevice($this->rownum); 222 $this->setPageForDevice($this->rownum);
223 223
224 $sql=" 224 $sql="
225 SELECT CS.*, U.userID 225 SELECT CS.*, U.userID, U.userNo
226 FORM tblCustomerService CS 226 FORM tblCustomerService CS
227 JOIN tblUser U ON CS.userFk=U.no 227 JOIN tblUser U ON CS.userFk=U.no
228 WHERE status=1 228 WHERE status=1
...@@ -250,7 +250,7 @@ if (! class_exists("ApiBoard")) ...@@ -250,7 +250,7 @@ if (! class_exists("ApiBoard"))
250 250
251 if($result != null){ 251 if($result != null){
252 $sql=" 252 $sql="
253 SELECT U.userID, C.* 253 SELECT U.userNo, U.userID, C.*
254 FROM tblComment C 254 FROM tblComment C
255 JOIN tblUser U ON C.userFk=U.userNo 255 JOIN tblUser U ON C.userFk=U.userNo
256 WHERE targetFk='{$csNo}' AND commentType='CS' 256 WHERE targetFk='{$csNo}' AND commentType='CS'
...@@ -271,19 +271,29 @@ if (! class_exists("ApiBoard")) ...@@ -271,19 +271,29 @@ if (! class_exists("ApiBoard"))
271 271
272 //AS엄체 리스트 272 //AS엄체 리스트
273 function getListOfCompany(){ 273 function getListOfCompany(){
274 $provinceNumber=$this->req["provinceNumber"];
275 $cityNumber=$this->req["cityNumber"];
276 $searchText=$this->req["searchText"];
277
278 $where="status=1";
279
280 if(!empty($provinceNumber)){
281 $where.=" AND address LIKE (SELECT abbreviation FROM tblZipProvince WHERE provinceNumber='{$provinceNumber}')";
282 }
283
274 $sql=" 284 $sql="
275 SELECT COUNT(*) 285 SELECT COUNT(*)
276 FROM tblCompany 286 FROM tblCompany
277 WHERE status=1 287 {$where}
278 ORDER BY companyNo DESC 288 ORDER BY companyNo DESC
279 "; 289 ";
280 $this->rownum=$this->getValue($sql, "rn"); 290 $this->rownum=$this->getValue($sql, "rn");
281 $this->setPageForDevice($this->rownum); 291 $this->setPageForDevice($this->rownum);
282 292
283 $sql=" 293 $sql="
284 SELECT * 294 SELECT companyNo, name, telephone
285 FROM tblCompany 295 FROM tblCompany
286 WHERE status=1 296 {$where}
287 ORDER BY companyNo DESC 297 ORDER BY companyNo DESC
288 LIMIT {$this->startNum}, {$this->endNum} 298 LIMIT {$this->startNum}, {$this->endNum}
289 "; 299 ";
...@@ -309,7 +319,7 @@ if (! class_exists("ApiBoard")) ...@@ -309,7 +319,7 @@ if (! class_exists("ApiBoard"))
309 319
310 if($result != null){ 320 if($result != null){
311 $sql=" 321 $sql="
312 SELECT U.userID, C.* 322 SELECT U.userNo, U.userID, C.*
313 FROM tblComment C 323 FROM tblComment C
314 JOIN tblUser U ON C.userFk=U.userNo 324 JOIN tblUser U ON C.userFk=U.userNo
315 WHERE targetFk='{$companyNo}' AND commentType='CP' 325 WHERE targetFk='{$companyNo}' AND commentType='CP'
...@@ -509,7 +519,7 @@ if (! class_exists("ApiBoard")) ...@@ -509,7 +519,7 @@ if (! class_exists("ApiBoard"))
509 function getListOfMyProductionSpec(){ 519 function getListOfMyProductionSpec(){
510 $userFk=$this->appUser["no"]; 520 $userFk=$this->appUser["no"];
511 $sql=" 521 $sql="
512 SELECT companyName, requestDate 522 SELECT productionNo, companyName, requestDate
513 FROM tblProductionSpec 523 FROM tblProductionSpec
514 WHERE userFk='{$userFk}' 524 WHERE userFk='{$userFk}'
515 ORDER BY productionNO DESC 525 ORDER BY productionNO DESC
...@@ -540,7 +550,7 @@ if (! class_exists("ApiBoard")) ...@@ -540,7 +550,7 @@ if (! class_exists("ApiBoard"))
540 } 550 }
541 551
542 $sql=" 552 $sql="
543 SELECT companyName, requestDate 553 SELECT productionNo, companyName, requestDate
544 FROM tblProduntionSpec 554 FROM tblProduntionSpec
545 {$where} 555 {$where}
546 ORDER BY productionNo DESC 556 ORDER BY productionNo DESC
...@@ -568,7 +578,7 @@ if (! class_exists("ApiBoard")) ...@@ -568,7 +578,7 @@ if (! class_exists("ApiBoard"))
568 //담당자 리스트 578 //담당자 리스트
569 function getListOfManager(){ 579 function getListOfManager(){
570 $sql=" 580 $sql="
571 SELECT name 581 SELECT managerNo, name
572 FROM tblManager 582 FROM tblManager
573 WHERE status=1 583 WHERE status=1
574 ORDER BY name ASC 584 ORDER BY name ASC
...@@ -605,11 +615,13 @@ if (! class_exists("ApiBoard")) ...@@ -605,11 +615,13 @@ if (! class_exists("ApiBoard"))
605 $userNo=$this->appUser["no"]; 615 $userNo=$this->appUser["no"];
606 616
607 $sql=" 617 $sql="
608 SELECT companyName, requestDate 618 SELECT productionNo, companyName, requestDate
609 FROM tblProductionSpec PS 619 FROM tblProductionSpec PS
610 JOIN tblLike L ON PS.productionNo=L.productionNo 620 JOIN tblLike L ON PS.productionNo=L.productionNo
611 WHERE L.userNo='{$userNo}' 621 WHERE L.userNo='{$userNo}'
612 "; 622 ";
623 $result=$this->getArray($sql);
624 return $this->makeResultJson("1","", $result);
613 } 625 }
614 626
615 627
...@@ -617,6 +629,7 @@ if (! class_exists("ApiBoard")) ...@@ -617,6 +629,7 @@ if (! class_exists("ApiBoard"))
617 629
618 630
619 631
632
620 } // 클래스 종료 633 } // 클래스 종료
621 } 634 }
622 ?> 635 ?>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -16,12 +16,12 @@ if (! class_exists("ApiStatic")){ ...@@ -16,12 +16,12 @@ if (! class_exists("ApiStatic")){
16 ORDER BY infoNo DESC 16 ORDER BY infoNo DESC
17 LIMIT 1 17 LIMIT 1
18 "; 18 ";
19 $payload = $this->getRow($sql); 19 $list = $this->getRow($sql);
20 return $this->makeResultJson("1", "", $payload); 20 return $this->makeResultJson("1", "", $list);
21 } 21 }
22 22
23 //기관인증 23 //기관인증
24 function getOrganizationCert(){ 24 function getListOfOrganizationCert(){
25 $sql=" 25 $sql="
26 SELECT * 26 SELECT *
27 FROM tblOrganizationCert 27 FROM tblOrganizationCert
...@@ -31,24 +31,29 @@ if (! class_exists("ApiStatic")){ ...@@ -31,24 +31,29 @@ if (! class_exists("ApiStatic")){
31 return $this->makeResultJson("1", "", $list); 31 return $this->makeResultJson("1", "", $list);
32 } 32 }
33 33
34 function getMainImage(){ 34 function getInfoOfOrganizationCert(){
35 $certNo=$this->req["certNo"];
35 $sql=" 36 $sql="
36 SELECT imgPathMain, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC 37 SELECT *
37 FROM tblMain 38 FROM tblOrganizationCert
39 WHERE certNo='{$certNo}'
38 LIMIT 1 40 LIMIT 1
39 "; 41 ";
40 $result=$this->getRow($sql); 42 $list=$this->getRow($sql);
41 return $this->makeResultJson("1", "", $result); 43 return $this->makeResultJson("1", "", $list)
42 } 44 }
43 45
44 function getMainPhrase(){ 46 //메인 페이지 정보
47 function getMain(){
45 $sql=" 48 $sql="
46 SELECT phrase1, phrase2 49 SELECT imgPathMain, phrase1, phrase2, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
47 FROM tblMain 50 FROM tblMain
48 LIMIT 1 51 LIMIT 1
49 "; 52 ";
53 $result=$this->getRow($sql);
54 return $this->makeResultJson("1", "", $result);
50 } 55 }
51 56
52 //메인페이지 공지사항 57 //메인페이지 공지사항
53 function getLatestNotice(){ 58 function getLatestNotice(){
54 $sql=" 59 $sql="
...@@ -73,6 +78,7 @@ if (! class_exists("ApiStatic")){ ...@@ -73,6 +78,7 @@ if (! class_exists("ApiStatic")){
73 return $this->makeResultJson("1", "", $result); 78 return $this->makeResultJson("1", "", $result);
74 } 79 }
75 80
81 //메인 페이지 회사정보
76 function getKCBriefInfo(){ 82 function getKCBriefInfo(){
77 $sql=" 83 $sql="
78 SELECT address, telephone, fax, eMail 84 SELECT address, telephone, fax, eMail
...@@ -80,11 +86,12 @@ if (! class_exists("ApiStatic")){ ...@@ -80,11 +86,12 @@ if (! class_exists("ApiStatic")){
80 "; 86 ";
81 } 87 }
82 88
89 //탑차 분류별 리스트
83 function getListOfVehicle(){ 90 function getListOfVehicle(){
84 $vehicleType=$this->req["vehicleType"]; 91 $vehicleType=$this->req["vehicleType"];
85 92
86 $sql=" 93 $sql="
87 SELECT name, imgPathVehicle 94 SELECT vehicleNo, name, imgPathVehicle
88 FROM tblVehicle 95 FROM tblVehicle
89 WHERE vehicleType='{$vehicleType}' AND status=1 96 WHERE vehicleType='{$vehicleType}' AND status=1
90 ORDER BY regDate DESC 97 ORDER BY regDate DESC
...@@ -93,6 +100,7 @@ if (! class_exists("ApiStatic")){ ...@@ -93,6 +100,7 @@ if (! class_exists("ApiStatic")){
93 return $this->makeResultJson("1", "", $result); 100 return $this->makeResultJson("1", "", $result);
94 } 101 }
95 102
103 //탑차 정보
96 function getInfoOfVehicle(){ 104 function getInfoOfVehicle(){
97 $vehicleNo=$this->req["vehicleNo"]; 105 $vehicleNo=$this->req["vehicleNo"];
98 106
...@@ -105,6 +113,7 @@ if (! class_exists("ApiStatic")){ ...@@ -105,6 +113,7 @@ if (! class_exists("ApiStatic")){
105 return $this->makeResultJson("1", "", $result); 113 return $this->makeResultJson("1", "", $result);
106 } 114 }
107 115
116 //도 리스트
108 function getListOfProvince(){ 117 function getListOfProvince(){
109 $sql=" 118 $sql="
110 SELECT `provinceNumber`, `desc`, `abbreviation` 119 SELECT `provinceNumber`, `desc`, `abbreviation`
...@@ -115,6 +124,7 @@ if (! class_exists("ApiStatic")){ ...@@ -115,6 +124,7 @@ if (! class_exists("ApiStatic")){
115 return $this->makeResultJson("1", "", $result); 124 return $this->makeResultJson("1", "", $result);
116 } 125 }
117 126
127 //시 리스트
118 function getListOfCity(){ 128 function getListOfCity(){
119 $provinceNumber=$this->req["provinceNumber"]; 129 $provinceNumber=$this->req["provinceNumber"];
120 130
......