Exemplo n.º 1
0
 public function Lists()
 {
     $this->MyAction = 'Lists';
     $Model = new ModelModule();
     if ($this->_POST['searchtxt']) {
         $Searchtxt = '\'' . trim($this->_POST['searchtxt']) . '\'';
         $Data['Data'][0] = $Model->GetOneInfoByKeyID($Searchtxt, 'NO');
         if (!$Data['Data'][0]) {
             $Model = new PropertyModule();
             $Data['Data'] = $Model->GetAllModelLists('tb_model_packages', 'where PackagesNum = ' . $Searchtxt);
         }
         $this->Data = $Data;
     } elseif ($this->_GET['state']) {
         $Page = intval($this->_GET['Page']);
         $Page = $Page ? $Page : 1;
         $PageSize = 10;
         $From = ($Page - 1) * $PageSize;
         $Data['state'] = $this->_GET['state'];
         $Data['Page'] = $Page;
         $Data['Data'] = $Model->GetTaocanLists('', $From, $PageSize, 'ASC');
         $RecordCount = $Model->GetTaocanListsNum('', 'PackagesNum', 'tb_model_packages');
         $Data['RecordCount'] = $RecordCount['Num'];
         $Data['PageCount'] = ceil($RecordCount['Num'] / $PageSize);
         $Data['PageSize'] = $PageSize;
         $this->Data = $Data;
     } else {
         $Page = intval($this->_GET['Page']);
         $Page = $Page ? $Page : 1;
         $PageSize = 10;
         $From = ($Page - 1) * $PageSize;
         $Data['Page'] = $Page;
         $Data['Data'] = $Model->GetLists('', $From, $PageSize, 'ASC');
         $RecordCount = $Model->GetListsNum();
         $Data['RecordCount'] = $RecordCount['Num'];
         $Data['PageCount'] = ceil($RecordCount['Num'] / $PageSize);
         $Data['PageSize'] = $PageSize;
         $this->Data = $Data;
     }
 }
Exemplo n.º 2
0
 public function Lists()
 {
     if ($this->_GET) {
         $ProjectID = _intval($this->_GET['ProjectID']);
         $this->ProjectID = $ProjectID;
         $PropertyModule = new PropertyModule();
         $ProjectModule = new ProjectModule();
         //产品下属性列表
         if ($ProjectID == 1) {
             $ModelClass = new ModelClassModule();
             $ModelClassLists = $ModelClass->GetListsAll();
             $this->ModelClassLists = $ModelClassLists;
             $this->Data = array_merge($PropertyModule->GetAllModelLists(), $PropertyModule->GetAllModelLists('tb_model_packages'));
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($ProjectID);
             $this->ProjectInfo = $ProjectInfo;
             $NO = $this->_GET['NO'];
             if ($NO) {
                 $Model = $PropertyModule->GetOneInfoByNO($NO);
                 if (!$Model) {
                     $Model = $PropertyModule->GetOneInfoByNO($NO, 'PackagesNum', 'tb_model_packages');
                 }
                 $this->Model = $Model;
             }
             if ($this->_GET['State']) {
                 $this->State = $this->_GET['State'];
             } else {
                 $this->State = 0;
             }
         } else {
             $MysqlWhere = ' where ProjectID=' . $ProjectID . ' and ProjectPropertyParentID=0';
             $Data = $PropertyModule->GetProjectPropertyLists($MysqlWhere, 0, 100);
             foreach ($Data as $Key => $Value) {
                 $MysqlWhereTwo = ' where ProjectPropertyParentID=' . $Value['ProjectPropertyID'];
                 $Data[$Key]['Two'] = $PropertyModule->GetProjectPropertyLists($MysqlWhereTwo, 0, 100);
             }
             $this->Data = $Data;
             //一级产品属性
             $ParentMysqlWhere = ' where ProjectID=' . $ProjectID . ' and ProjectPropertyParentID=0';
             $ParentData = $PropertyModule->GetProjectPropertyLists($ParentMysqlWhere, 0, 100);
             $this->ParentData = $ParentData;
             //产品信息
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($ProjectID);
             $this->ProjectInfo = $ProjectInfo;
             //产品属性信息
             $ProjectPropertyID = _intval($this->_GET['ProjectPropertyID']);
             if ($ProjectPropertyID > 0) {
                 $ProjectPropertyInfo = $PropertyModule->GetOneInfoByKeyID($ProjectPropertyID);
                 $this->MyFuWuString = ',' . $ProjectPropertyInfo['MyFuWu'] . ',';
                 $this->OtherFuWuString = ',' . $ProjectPropertyInfo['OtherFuWu'] . ',';
                 $this->ProjectPropertyInfo = $ProjectPropertyInfo;
             }
             //服务
             $FuWuModule = new FuWuModule();
             $this->FuWuList = $FuWuModule->SelectLists();
         }
     }
 }