Explorar o código

计量支付
在线审批
禅道1015 1005

NoNZero %!s(int64=9) %!d(string=hai) anos
pai
achega
3021eabfde

+ 4 - 0
protected/class/numofperact.php

@@ -213,6 +213,10 @@ class NumofperAct {
         return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'desc' => 'numpname', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
+    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) {
         return $this->__numofperact->getOne(array('select' => 'sum(currchangeval) as changtotal', 'where' => 'pid=? and currstatus != \'checkno\'', 'param' => array($pid), 'asArray' => TRUE))['changtotal'];
     }

+ 6 - 2
protected/controller/RProjectController.php

@@ -274,7 +274,7 @@ class RProjectController extends DooController
 
     public function proDetail()
     {
-        $numStatusArray = $this->numofperact->getLastStatus2($this->params['pid'], $this->params['pmid']);
+        $numStatusArray = $this->numofperact->getLastRow($this->params['pid'], $this->params['pmid']);
         // 项目名称
         $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
         foreach ($mpidArray as $k1 => $v1) {
@@ -305,6 +305,10 @@ class RProjectController extends DooController
         // 期数列表
         $tmpArray = $this->numofperact->getGroupByLastOne2($this->params['pmid']);
         foreach ($tmpArray as $k => $v) {
+            $intTime = $this->numofperact->getMaxTimes($v['pmid'], $v['numpname'])['times'];
+            $nfArray[] = $this->numofperact->getRow($v['pmid'], $v['numpname'], $intTime);
+        }
+        foreach ($nfArray as $k => $v) {
             if ($v['mpid'] == $this->params['mpid']) {
                 $this->data['mpid'] = $v['mpid'];
                 $this->data['MeasureArray2'][] = $v;
@@ -329,7 +333,7 @@ class RProjectController extends DooController
         $maxTimes = $this->numofperact->getMaxTimes($lastRowArray['pmid'], $lastRowArray['numpname']);
 //        $auditUserArray = $this->measureauditact->getAllAudit($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
         $maxtimez = $this->measureauditact->getRowGroupByTimes($this->params['mpid']);
-        $auditUserArray = $this->measureauditact->getRowByMpidTimes($this->params['mpid'],$maxtimez['times']);
+        $auditUserArray = $this->measureauditact->getRowByMpidTimes($this->params['mpid'], $maxtimez['times']);
         $auditArray = $this->measureauditact->getLastNewRowInfo($lastRowArray['pmid'], $lastRowArray['numpname'], $this->auth->getUid());
         if (isset($_POST['act'])) {
             $auditStatusArray = array('checkno', 'checked');