wzh 5 年之前
父節點
當前提交
b02ec754a0
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      api/application/controllers/Project.php

+ 6 - 1
api/application/controllers/Project.php

@@ -425,21 +425,25 @@ class Project extends Base_Controller {
             $join = [];
             $join[] = ['table'=>'project as P','cond'=>'L.projectid = P.id','type'=>'inner'];
             if ($type == 2) {
+                $sectionWhere = ['manu !='=>0];
                 $join[] = ['table'=>'company as C','cond'=>'L.manu = C.id','type'=>'inner'];
                 $group = 'L.manu,L.projectid';
                 $order = 'convert(C.name using gbk) asc';
                 $fields = 'C.name as company,P.projectname,P.id,C.id as cId';
             }elseif ($type == 3) {
+                $sectionWhere = ['supplier !='=>0];
                 $join[] = ['table'=>'company as C','cond'=>'L.supplier = C.id','type'=>'inner'];
                 $group = 'L.supplier,L.projectid';
                 $order = 'convert(C.name using gbk) asc';
                 $fields = 'C.name as company,P.projectname,P.id,C.id as cId';
             }elseif ($type == 4) {
+                $sectionWhere = ['po !='=>0];
                 $join[] = ['table'=>'company as C','cond'=>'L.po = C.id','type'=>'inner'];
                 $group = 'L.po,L.projectid';
                 $order = 'convert(C.name using gbk) asc';
                 $fields = 'C.name as company,P.projectname,P.id,C.id as cId';
             }else {
+                $sectionWhere = ['upazilla !='=>0];
                 $join[] = ['table'=>'company as C','cond'=>'L.upazilla = C.id','type'=>'inner'];
                 $group = 'L.upazilla,L.projectid';
                 $order = 'convert(C.name using gbk) asc';
@@ -456,7 +460,8 @@ class Project extends Base_Controller {
                     $temp2[$value['cId']] = array('company'=>$value['company'],'cId'=>$value['cId'],'projectList'=>array());
                 }
                 $projectIdArr = array_column($data, 'id');
-                $sectionList = $this->Lamp_model->get_list(['projectid'=>$projectIdArr], 'section as name,projectid',NULL, NULL, 'convert(section using gbk) asc', 'projectid,section');
+                $sectionWhere['projectid'] = $projectIdArr;
+                $sectionList = $this->Lamp_model->get_list($sectionWhere, 'section as name,projectid',NULL, NULL, 'convert(section using gbk) asc', 'projectid,section');
                 foreach ($sectionList as $key => $value) {
                     if (isset($temp[$value['projectid']])) {
                         unset($value['projectid']);