Переглянути джерело

新服务器数据库mysql.cnf 配置严格配置去除

NoNZero 8 роки тому
батько
коміт
0cd005a8ea

+ 6 - 1
protected/class/itemmeasurenum.php

@@ -21,7 +21,12 @@ class ItemMeasureNumpofper
         $this->__itemMeasureNum->pmid = $postArray['pmid'];
         $this->__itemMeasureNum->isdel = 0;
         $this->__itemMeasureNum->deltime = 0;
-        $this->__itemMeasureNum->categoryid = $postArray['categoryid'];
+        if(isset($postArray['categoryid'])){
+          $this->__itemMeasureNum->categoryid = $postArray['categoryid'];
+        }else{
+          $this->__itemMeasureNum->categoryid = 0;
+        }
+        $this->__itemMeasureNum->deluid = 0;
         $this->__itemMeasureNum->tips = $postArray['tips'];
         $this->__itemMeasureNum->numpname = $postArray['numpname'];
         $this->__itemMeasureNum->intime = time();

+ 115 - 58
protected/class/numofperact.php

@@ -7,15 +7,19 @@ Doo::loadModel('numofper');
  *
  * @author zongheng
  */
-class NumofperAct {
+class NumofperAct
+{
 
     private $__numofperact;
 
-    function __construct() {
+    function __construct()
+    {
         $this->__numofperact = new Numofper();
     }
 
-    public function insert($pid, $uid, $tenderid, $stid, $phaseno, $currcontractval, $currchangeval, $stopnowtotal, $currdone, $curralltotal, $times = 0) {
+    public function insert($pid, $uid, $tenderid, $stid, $phaseno, $currcontractval, $currchangeval, $stopnowtotal, $currdone, $curralltotal, $times = 0)
+    {
+        $this->__numofperact->iszero = 0;
         $this->__numofperact->uid = $uid;
         $this->__numofperact->pid = $pid;
         $this->__numofperact->pmid = $tenderid;
@@ -33,7 +37,8 @@ class NumofperAct {
         return $this->__numofperact->insert();
     }
 
-    public function redoRow($pid, $tenderid, $stid, $phaseno, $times) {
+    public function redoRow($pid, $tenderid, $stid, $phaseno, $times)
+    {
         $this->__numofperact->pid = $pid;
         $this->__numofperact->pmid = $tenderid;
         $this->__numofperact->stid = $stid;
@@ -50,72 +55,89 @@ class NumofperAct {
         return $this->__numofperact->insert();
     }
 
-    public function getRowByMpid($mpid) {
+    public function getRowByMpid($mpid)
+    {
         return $this->__numofperact->getOne(array('where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
     }
 
-    public function getCountTotalnum($pmid) {
+    public function getCountTotalnum($pmid)
+    {
         return $this->__numofperact->count(array('where' => 'pmid=? and currstatus != \'checkno\' ', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getCountTotalnum2($pmid) {
+    public function getCountTotalnum2($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'numpname', 'where' => 'pmid=?', 'param' => array($pmid), 'groupby' => 'numpname', 'desc' => 'numpname', 'asArray' => TRUE));
     }
 
-    public function getMaxStatusTimes($pmid, $numpname) {
+    public function getMaxStatusTimes($pmid, $numpname)
+    {
         return $this->__numofperact->getOne(array('select' => 'currstatus', 'where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
     }
 
     // for API
-    public function getMaxTimes($pmid, $numpname) {
+    public function getMaxTimes($pmid, $numpname)
+    {
         return $this->__numofperact->getOne(array('select' => 'times,currstatus', 'where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
     }
 
-    public function getCountTotalplus($pmid) {
+    public function getCountTotalplus($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(curralltotal) as totalplus', 'where' => 'pmid=?', 'groupby' => 'numpname', 'desc' => 'times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getStopNow($pmid) {
+    public function getStopNow($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(stopnowtotal) as sntotal', 'where' => 'pmid=?', 'groupby' => 'numpname', 'desc' => 'times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getStopNowTotal($pmid) {
+    public function getStopNowTotal($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'stopnowtotal as sntotal', 'where' => 'pmid=?', 'groupby' => 'pmid,numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getStopNowSt($stid) {
+    public function getStopNowSt($stid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(stopnowtotal) as sntotal', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getStopNowT($pmid) {
+    public function getStopNowT($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(stopnowtotal) as sntotal', 'where' => 'pmid=?', 'param' => array($pmid), 'DESC' => 'audittime', 'asArray' => TRUE));
     }
 
-    public function getCurrDoneSt($stid) {
+    public function getCurrDoneSt($stid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currdone) as currdone', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getCurrDonePmid($pmid) {
+    public function getCurrDonePmid($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'currdone as currdone', 'where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getCurrTotal($pmid) {
+    public function getCurrTotal($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currcontractval) as currtotal', 'where' => 'pmid=?', 'groupby' => 'numpname', 'desc' => 'times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getCurrAlltotal($pmid) {
+    public function getCurrAlltotal($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'currdone as currtotal', 'where' => 'pmid=?', 'param' => array($pmid), 'groupby' => 'pmid,numpname', 'desc' => 'numpname', 'asArray' => TRUE));
     }
 
-    public function getCurrdoneNew($pmid) {
+    public function getCurrdoneNew($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'currdone as currtotal', 'where' => 'pmid=?', 'param' => array($pmid), 'desc' => 'mpid', 'asArray' => TRUE));
     }
 
-    public function getCountTotalSTID($stid) {
+    public function getCountTotalSTID($stid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(curralltotal) as totalplus', 'where' => 'stid=? and currstatus != \'checkno\'', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getCountTotalSTID2($stid) {
+    public function getCountTotalSTID2($stid)
+    {
         $pdArray = NULL;
         $pdArray = $this->getPMID($stid);
         if ($pdArray)
@@ -127,73 +149,90 @@ class NumofperAct {
     }
 
 // 根据条件STID获取分组后的PMID
-    public function getPMID($stid) {
+    public function getPMID($stid)
+    {
         return $this->__numofperact->find(array('select' => 'pmid', 'where' => 'stid=? and currstatus != \'checkno\'', 'groupby' => 'pmid', 'param' => array($stid), 'asArray' => TRUE));
     }
 
 // 根据条件STID获取分组后的PMID
-    public function getMaxNumORTimes($pmid) {
+    public function getMaxNumORTimes($pmid)
+    {
         $pmidArray = $this->__numofperact->getOne(array('where' => 'pmid=?', 'param' => array($pmid), 'desc' => 'mpid', 'asArray' => TRUE));
         return $pmidArray['curralltotal'];
     }
 
-    public function getNumByStid($stid) {
+    public function getNumByStid($stid)
+    {
         return $this->__numofperact->find(array('where' => 'stid=?', 'param' => array($stid), 'desc' => 'mpid', 'asArray' => TRUE));
     }
 
-    public function getRowByPmid($pmid) {
+    public function getRowByPmid($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'pmid=? and currstatus != \'checkno\'', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getGroupByLastOne($pmid) {
+    public function getGroupByLastOne($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'pmid=? and currstatus!=\'checkno\'', 'groupby' => 'numpname', 'desc' => 'numpname,times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getGroupByLastOne2($pmid) {
+    public function getGroupByLastOne2($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'pmid=?', 'groupby' => 'numpname', 'desc' => 'numpname,times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getRowByPmid2($pmid) {
+    public function getRowByPmid2($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getRowTender($pmid) {
+    public function getRowTender($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'pmid=?', 'orderby' => 'numpname', 'param' => array($pmid), 'desc' => 'mpid', 'asArray' => TRUE));
     }
 
-    public function getRowTender2($pmid) {
+    public function getRowTender2($pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid=?', 'orderby' => 'numpname', 'param' => array($pmid), 'desc' => 'mpid', 'asArray' => TRUE));
     }
 
-    public function getRowTenderCurr($pmid) {
+    public function getRowTenderCurr($pmid)
+    {
         return $this->__numofperact->find(array('where' => 'numpname=(SELECT max(numpname) FROM jl_measure_numofper where pmid=?) and pmid=?', 'orderby' => 'numpname', 'param' => array($pmid, $pmid), 'desc' => 'mpid', 'asArray' => TRUE));
     }
 
-    public function getAlluserMeasureAudit($bid, $num) {
+    public function getAlluserMeasureAudit($bid, $num)
+    {
         return $this->__numofperact->getOne(array('select' => 'mpid', 'where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE));
     }
 
-    public function getNumOfStatus($bid, $num) {
+    public function getNumOfStatus($bid, $num)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE));
     }
 
-    public function getCurrStatus($mpid) {
+    public function getCurrStatus($mpid)
+    {
         return $this->__numofperact->getOne(array('where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
     }
 
-    public function getRow($pmid, $numpname, $times = 0) {
+    public function getRow($pmid, $numpname, $times = 0)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function hasTheTimesRow($pmid, $numpname, $times = 0) {
+    public function hasTheTimesRow($pmid, $numpname, $times = 0)
+    {
         return $this->__numofperact->count(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function getMaxRowStatus($pmid, $numpname) {
+    public function getMaxRowStatus($pmid, $numpname)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
     }
 
-    public function getChecknoRow($pmid, $numpname) {
+    public function getChecknoRow($pmid, $numpname)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=?', 'desc' => 'times', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
     }
 
@@ -201,56 +240,68 @@ class NumofperAct {
 //	return $this->__numofperact->getOne(array('where' => 'numpname=(SELECT max(numpname) FROM jl_measure_numofper where pid=? and  pmid=? and stid=?)', 'param' => array($pid, $pmid, $stid), 'asArray' => TRUE));
 //    }
 
-    public function getLastStatus($pid, $pmid) {
+    public function getLastStatus($pid, $pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=? and currstatus != \'checkno\'', 'desc' => 'numpname', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
-    public function getLastStatus2($pid, $pmid) {
+    public function getLastStatus2($pid, $pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'groupby' => 'pmid,numpname,times', 'desc' => 'times', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
-    public function getLastStatus3($pid, $pmid) {
+    public function getLastStatus3($pid, $pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'desc' => 'numpname', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
-    public function getLastRow($pid, $pmid) {
+    public function getLastRow($pid, $pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'groupby' => 'numpname,times', 'desc' => 'mpid', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
-    public function getChangTotal($pid) {
+    public function getChangTotal($pid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currchangeval) as changtotal', 'where' => 'pid=? and currstatus != \'checkno\'', 'param' => array($pid), 'asArray' => TRUE))['changtotal'];
     }
 
-    public function getCurrDone($pid) {
+    public function getCurrDone($pid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currdone) as currdone', 'where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE))['currdone'];
     }
 
-    public function getCurrDoneNow($pid) {
+    public function getCurrDoneNow($pid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currdone) as currdone', 'where' => 'pid=? and currstatus!=\'checkno\'', 'param' => array($pid), 'asArray' => TRUE))['currdone'];
     }
 
-    public function getCheckedCurrdone($stid) {
+    public function getCheckedCurrdone($stid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currdone) as currdone', 'where' => 'stid = ?', 'param' => array($stid), 'asArray' => TRUE))['currdone'];
     }
 
-    public function getMaxCurrStatus($pid, $pmid, $stid) {
+    public function getMaxCurrStatus($pid, $pmid, $stid)
+    {
         return $this->__numofperact->getOne(array('where' => 'numpname = (SELECT max(numpname) FROM jl_measure_numofper where pid = ? and pmid = ? and stid = ?)', 'param' => array($pid, $pmid, $stid), 'asArray' => TRUE));
     }
 
     //标段下最新一期
-    public function getLastNew($pmid) {
+    public function getLastNew($pmid)
+    {
         return $this->__numofperact->getOne(array('select' => 'stopnowtotal, currdone', 'where' => 'pmid = ?', 'groupby' => 'pmid, numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
 //	return $this->__numofperact->getOne(array('select' => 'stopnowtotal, currdone', 'where' => 'pmid = ? and currstatus!=\'checkno\'', 'orderby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
     //标段下最新一期
-    public function getLastNew2($pmid) {
+    public function getLastNew2($pmid)
+    {
         return $this->__numofperact->getOne(array('where' => 'pmid = ?', 'groupby' => 'pmid, numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
 //	return $this->__numofperact->getOne(array('select' => 'stopnowtotal, currdone', 'where' => 'pmid = ? and currstatus!=\'checkno\'', 'orderby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
     //更新数据
-    public function updateNumofper($tenderid, $phaseno, $itemArray, $times = 0) {
+    public function updateNumofper($tenderid, $phaseno, $itemArray, $times = 0)
+    {
         if (!is_array($itemArray)) {
             return FALSE;
         }
@@ -263,7 +314,8 @@ class NumofperAct {
     }
 
     //更新数据
-    public function updateAuditStatus($tenderid, $phaseno, $statuno = 'checking', $times = 0) {
+    public function updateAuditStatus($tenderid, $phaseno, $statuno = 'checking', $times = 0)
+    {
         $this->__numofperact->currstatus = $statuno;
         $this->__numofperact->audittime = time();
         return $this->__numofperact->update(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($tenderid, $phaseno, $times)));
@@ -272,25 +324,30 @@ class NumofperAct {
 //    public function getCurrdoneSTID($stid) {
 //	return $this->__numofperact->getOne(array('select' => 'sum(currdone) as totalplus', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
 //    }
-    public function getCurrdoneSTID($stid) {
+    public function getCurrdoneSTID($stid)
+    {
         return $this->__numofperact->getOne(array('select' => 'sum(currdone) as totalplus', 'where' => 'stid=?  and currstatus!=\'checkno\'', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getCurrDoneSMontht($stid) {
+    public function getCurrDoneSMontht($stid)
+    {
         return $this->__numofperact->find(array('select' => 'sum(currdone) as currdone,FROM_UNIXTIME(audittime,"%Y-%m") as month', 'where' => 'stid=?'
-                    , 'param' => array($stid), 'groupby' => 'FROM_UNIXTIME(audittime,"%Y-%m")', 'asc' => 'audittime', 'asArray' => TRUE));
+        , 'param' => array($stid), 'groupby' => 'FROM_UNIXTIME(audittime,"%Y-%m")', 'asc' => 'audittime', 'asArray' => TRUE));
     }
 
-    public function getStopNowStMonth($stid) {
+    public function getStopNowStMonth($stid)
+    {
         return $this->__numofperact->find(array('select' => 'sum(stopnowtotal) as sntotal,FROM_UNIXTIME(audittime,"%Y-%m") as month', 'where' => 'stid=? '
-                    , 'param' => array($stid), 'groupby' => 'FROM_UNIXTIME(audittime,"%Y-%m")', 'asc' => 'audittime', 'asArray' => TRUE));
+        , 'param' => array($stid), 'groupby' => 'FROM_UNIXTIME(audittime,"%Y-%m")', 'asc' => 'audittime', 'asArray' => TRUE));
     }
 
-    public function getCountTimes($pmid, $numpname, $times) {
+    public function getCountTimes($pmid, $numpname, $times)
+    {
         return $this->__numofperact->count(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times)));
     }
 
-    public function getCountNumpname($pmid, $numpname) {
+    public function getCountNumpname($pmid, $numpname)
+    {
         return $this->__numofperact->count(array('where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname)));
     }
 

+ 8 - 1
protected/controller/ClientController.php

@@ -328,6 +328,9 @@ class ClientController extends DooController
                     if ($value['audittime'] > 0) {
                         $value['audittime'] = date('Y-m-d', $value['audittime']);
                     }
+                    if(!isset($value['auditcontent'])){
+                      $value['auditcontent'] = '';
+                    }
                     $auditInfo[] = array('uid' => $userArray['userid'], 'name' => $userArray['name'], 'company' => $userArray['company'], 'jobs' => $userArray['jobs'], 'avatar' => $this->auth->getAvatar($value['auditoruid']), 'mastatus' => $this->statusArray[$value['mastatus']], 'CheckerMemo' => $value['auditcontent'], 'onlineaudit' => $value['onlineaudit'], 'audittime' => $value['audittime']);
                 }
             }
@@ -410,7 +413,11 @@ class ClientController extends DooController
                     $uinfoArray[$key]['mastatus'] = $this->statusArray[$value['mastatus']];
                     $uinfoArray[$key]['uid'] = $value['auditoruid'];
                     $uinfoArray[$key]['avatar'] = $this->auth->getAvatar($value['auditoruid']);
-                    $uinfoArray[$key]['CheckerMemo'] = $value['auditcontent'];
+                    if(isset($value['auditcontent'])){
+                      $uinfoArray[$key]['CheckerMemo'] = $value['auditcontent'];
+                    }else {
+                      $uinfoArray[$key]['CheckerMemo'] = '';
+                    }
                     $uinfoArray[$key]['onlineaudit'] = $value['onlineaudit'];
                     if ($value['audittime'] > 0) {
                         $uinfoArray[$key]['audittime'] = date('Y-m-d', $value['audittime']);

+ 28 - 19
protected/model/fileup.php

@@ -5,7 +5,8 @@ Doo::loadCore('db/DooModel');
 /**
  * 用户表
  */
-class fileup extends DooModel {
+class fileup extends DooModel
+{
 
     public $aid;
     public $pid;
@@ -24,26 +25,34 @@ class fileup extends DooModel {
     public $_primarykey = 'aid';
     public $_fields = array('aid', 'pid', 'stid', 'mpid', 'pmid', 'numpname', 'times', 'auditoruid', 'filepath', 'ziphashcode', 'filehashcode', 'isnew', 'intime');
 
-    public function __construct() {
-	parent::setupModel(__CLASS__);
+    public function __construct()
+    {
+        parent::setupModel(__CLASS__);
     }
 
-    public function createFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode, $isnew, $times = 0) {
-	$this->pid = $pid;
-	$this->stid = $stid;
-	$this->mpid = $mpid;
-	$this->pmid = $pmid;
-	$this->numpname = $numpname;
-	if ($times > 0)
-	    $this->times = $times;
-	$this->auditoruid = $auditoruid;
-	$this->filepath = $filepath;
-	if ($ziphashcode > 0)
-	    $this->ziphashcode = $ziphashcode;
-	$this->filehashcode = $filehashcode;
-	$this->isnew = $isnew;
-	$this->intime = time();
-	return $this->insert();
+    public function createFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode, $isnew, $times = 0)
+    {
+        $this->pid = $pid;
+        $this->stid = $stid;
+        $this->mpid = $mpid;
+        $this->pmid = $pmid;
+        $this->numpname = $numpname;
+        if ($times > 0) {
+            $this->times = $times;
+        } else {
+            $this->times = 0;
+        }
+        $this->auditoruid = $auditoruid;
+        $this->filepath = $filepath;
+        if ($ziphashcode > 0) {
+            $this->ziphashcode = $ziphashcode;
+        } else {
+            $this->ziphashcode = '';
+        }
+        $this->filehashcode = $filehashcode;
+        $this->isnew = $isnew;
+        $this->intime = time();
+        return $this->insert();
     }
 
 }