Browse Source

标段与标段类型添加创建时间

禅道任务#847
NoNZero 9 years ago
parent
commit
d9ef7880ab

+ 100 - 75
protected/class/actmeasure.php

@@ -7,128 +7,153 @@ Doo::loadModel('measure');
  *
  * @author zongheng
  */
-class actMeasure {
+class actMeasure
+{
 
     private $__mmeasure;
 
-    function __construct() {
-	$this->__mmeasure = new Measure();
+    function __construct()
+    {
+        $this->__mmeasure = new Measure();
     }
 
-    public function insertMeasure($uid, $pid, $stid, $pmname) {
-	if (!isset($uid))
-	    return FALSE;
-	$this->__mmeasure->uid = filter_var($uid, FILTER_VALIDATE_INT);
-	$this->__mmeasure->pid = filter_var($pid, FILTER_VALIDATE_INT);
-	$this->__mmeasure->stid = filter_var($stid, FILTER_VALIDATE_INT);
-	$this->__mmeasure->pmname = filter_var($pmname, FILTER_SANITIZE_STRING);
-	return $this->__mmeasure->insert();
+    public function insertMeasure($uid, $pid, $stid, $pmname)
+    {
+        if (!isset($uid))
+            return FALSE;
+        $this->__mmeasure->uid = filter_var($uid, FILTER_VALIDATE_INT);
+        $this->__mmeasure->pid = filter_var($pid, FILTER_VALIDATE_INT);
+        $this->__mmeasure->stid = filter_var($stid, FILTER_VALIDATE_INT);
+        $this->__mmeasure->pmname = filter_var($pmname, FILTER_SANITIZE_STRING);
+        $this->__mmeasure->intime = time();
+        return $this->__mmeasure->insert();
     }
 
-    public function getAllbyStid($stid) {
-	if (!$stid)
-	    return FALSE;
-	return $this->__mmeasure->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
+    public function getAllbyStid($stid)
+    {
+        if (!$stid)
+            return FALSE;
+        return $this->__mmeasure->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getRowUser($uid) {
-	return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
+    public function getRowUser($uid)
+    {
+        return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function getGroupProject($uid) {
-	return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'groupby' => 'pid', 'asArray' => TRUE));
+    public function getGroupProject($uid)
+    {
+        return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'groupby' => 'pid', 'asArray' => TRUE));
     }
 
-    public function getRowUserStid($uid) {
-	return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'groupby' => 'stid', 'asArray' => TRUE));
+    public function getRowUserStid($uid)
+    {
+        return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'groupby' => 'stid', 'asArray' => TRUE));
     }
 
-    public function getPmidRow($uid) {
-	return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
+    public function getPmidRow($uid)
+    {
+        return $this->__mmeasure->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function getRowBy($stid) {
-	if (!$stid)
-	    return FALSE;
-	return $this->__mmeasure->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
+    public function getRowBy($stid)
+    {
+        if (!$stid)
+            return FALSE;
+        return $this->__mmeasure->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getRowByPmid($pmid) {
-	if (!$pmid)
-	    return FALSE;
-	return $this->__mmeasure->getOne(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getRowByPmid($pmid)
+    {
+        if (!$pmid)
+            return FALSE;
+        return $this->__mmeasure->getOne(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getRowByPids($pid) {
-	if (!$pid)
-	    return FALSE;
-	return $this->__mmeasure->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    public function getRowByPids($pid)
+    {
+        if (!$pid)
+            return FALSE;
+        return $this->__mmeasure->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
-    public function getRowByPid($pid) {
-	if (!$pid)
-	    return FALSE;
-	return $this->__mmeasure->getOne(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    public function getRowByPid($pid)
+    {
+        if (!$pid)
+            return FALSE;
+        return $this->__mmeasure->getOne(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
-    public function getRowsByPid($pid) {
-	if (!$pid)
-	    return FALSE;
-	return $this->__mmeasure->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    public function getRowsByPid($pid)
+    {
+        if (!$pid)
+            return FALSE;
+        return $this->__mmeasure->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
-    public function getCountByUid($uid, $pid) {
-	if (!$uid)
-	    return FALSE;
-	return $this->__mmeasure->count(array('where' => 'uid=? and pid=?', 'param' => array($uid, $pid), 'asArray' => TRUE));
+    public function getCountByUid($uid, $pid)
+    {
+        if (!$uid)
+            return FALSE;
+        return $this->__mmeasure->count(array('where' => 'uid=? and pid=?', 'param' => array($uid, $pid), 'asArray' => TRUE));
     }
 
-    public function getMearsureCount($pid) {
-	return $this->__mmeasure->count(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    public function getMearsureCount($pid)
+    {
+        return $this->__mmeasure->count(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
-    public function getTotalWithPid($pid) {
-	if (!$pid)
-	    return FALSE;
-	return $this->__mmeasure->getOne(array('select' => 'sum(contracttotal) as total', 'where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE))['total'];
+    public function getTotalWithPid($pid)
+    {
+        if (!$pid)
+            return FALSE;
+        return $this->__mmeasure->getOne(array('select' => 'sum(contracttotal) as total', 'where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE))['total'];
     }
 
-    public function getRowWithUidGroupByPid($uid) {
-	return $this->__mmeasure->find(array('select' => 'pid', 'where' => 'uid=?', 'param' => array($uid), 'groupby' => 'pid', 'asArray' => TRUE));
+    public function getRowWithUidGroupByPid($uid)
+    {
+        return $this->__mmeasure->find(array('select' => 'pid', 'where' => 'uid=?', 'param' => array($uid), 'groupby' => 'pid', 'asArray' => TRUE));
     }
 
-    public function updateCon($pmid, $con) {
-	$this->__mmeasure->contracttotal = $con;
-	return $this->__mmeasure->update(array('where' => 'pmid=?', 'param' => array($pmid)));
+    public function updateCon($pmid, $con)
+    {
+        $this->__mmeasure->contracttotal = $con;
+        return $this->__mmeasure->update(array('where' => 'pmid=?', 'param' => array($pmid)));
     }
 
-    public function getTotal($stid) {
-	if (!$stid)
-	    return FALSE;
-	return $this->__mmeasure->getOne(array('select' => 'sum(contracttotal) as total', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
+    public function getTotal($stid)
+    {
+        if (!$stid)
+            return FALSE;
+        return $this->__mmeasure->getOne(array('select' => 'sum(contracttotal) as total', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getCountMeasure($stid) {
-	return $this->__mmeasure->count(array('where' => 'stid=?', 'param' => array($stid)));
+    public function getCountMeasure($stid)
+    {
+        return $this->__mmeasure->count(array('where' => 'stid=?', 'param' => array($stid)));
     }
 
-    public function getAll() {
-	return $this->__mmeasure->find(array('asArray' => TRUE));
+    public function getAll()
+    {
+        return $this->__mmeasure->find(array('asArray' => TRUE));
     }
 
-    public function getRowPmid($pmid) {
-	return $this->__mmeasure->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getRowPmid($pmid)
+    {
+        return $this->__mmeasure->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getAllbyStidSum($stid) {
-	if (!$stid)
-	    return FALSE;
-	return $this->__mmeasure->find(array('select' => 'sum(contracttotal) as contracttotal', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
+    public function getAllbyStidSum($stid)
+    {
+        if (!$stid)
+            return FALSE;
+        return $this->__mmeasure->find(array('select' => 'sum(contracttotal) as contracttotal', 'where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function updateName($pmid, $pmname) {
-	$this->__mmeasure->pmname = $pmname;
-	return $this->__mmeasure->update(array('where' => 'pmid=?', 'param' => array($pmid)));
+    public function updateName($pmid, $pmname)
+    {
+        $this->__mmeasure->pmname = $pmname;
+        return $this->__mmeasure->update(array('where' => 'pmid=?', 'param' => array($pmid)));
     }
 
 }

+ 48 - 35
protected/class/contractact.php

@@ -7,51 +7,62 @@ Doo::loadModel('contract');
  *
  * @author zongheng
  */
-class Contractact {
+class Contractact
+{
 
     private $__mcontract;
 
-    function __construct() {
-	$this->__mcontract = new Contract();
+    function __construct()
+    {
+        $this->__mcontract = new Contract();
     }
 
-    public function insertContract($pid, $uid, $stname) {
-	if (!isset($pid))
-	    return FALSE;
-	$this->__mcontract->pid = filter_var($pid, FILTER_VALIDATE_INT);
-	$this->__mcontract->uid = filter_var($uid, FILTER_VALIDATE_INT);
-	$this->__mcontract->stname = filter_var($stname, FILTER_SANITIZE_STRING);
-	$this->__mcontract->stkey = $this->create_randomstr(10);
-	return $this->__mcontract->insert();
+    public function insertContract($pid, $uid, $stname)
+    {
+        if (!isset($pid))
+            return FALSE;
+        $this->__mcontract->pid = filter_var($pid, FILTER_VALIDATE_INT);
+        $this->__mcontract->uid = filter_var($uid, FILTER_VALIDATE_INT);
+        $this->__mcontract->stname = filter_var($stname, FILTER_SANITIZE_STRING);
+        $this->__mcontract->stkey = $this->create_randomstr(10);
+        $this->__mcontract->intime = time();
+        return $this->__mcontract->insert();
     }
 
-    public function getAll() {
-	return $this->__mcontract->find(array('asArray' => TRUE));
+    public function getAll()
+    {
+        return $this->__mcontract->find(array('asArray' => TRUE));
     }
 
-    public function getPidWithKey($stkey) {
-	return $this->__mcontract->getOne(array('where' => 'stkey=?', 'param' => array($stkey), 'asArray' => TRUE));
+    public function getPidWithKey($stkey)
+    {
+        return $this->__mcontract->getOne(array('where' => 'stkey=?', 'param' => array($stkey), 'asArray' => TRUE));
     }
 
-    public function getRowByPid($pid) {
-	return $this->__mcontract->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    public function getRowByPid($pid)
+    {
+        return $this->__mcontract->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
-    public function getRowByStid($stid) {
-	return $this->__mcontract->getOne(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
+    public function getRowByStid($stid)
+    {
+        return $this->__mcontract->getOne(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
     }
 
-    public function getRow($uid) {
-	return $this->__mcontract->find(array('where' => 'uid=?', 'groupby' => 'pid', 'param' => array($uid), 'asArray' => TRUE));
+    public function getRow($uid)
+    {
+        return $this->__mcontract->find(array('where' => 'uid=?', 'groupby' => 'pid', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function getUserRow($uid) {
-	return $this->__mcontract->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
+    public function getUserRow($uid)
+    {
+        return $this->__mcontract->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function updateStName($stid, $stname) {
-	$this->__mcontract->stname = filter_var($stname, FILTER_SANITIZE_STRING);
-	return $this->__mcontract->update(array('where' => 'stid=?', 'param' => array($stid)));
+    public function updateStName($stid, $stname)
+    {
+        $this->__mcontract->stname = filter_var($stname, FILTER_SANITIZE_STRING);
+        return $this->__mcontract->update(array('where' => 'stid=?', 'param' => array($stid)));
     }
 
     /**
@@ -59,13 +70,14 @@ class Contractact {
      * @param $password 密码
      * @param $random 随机数
      */
-    function random($length, $chars = '0123456789') {
-	$hash = '';
-	$max = strlen($chars) - 1;
-	for ($i = 0; $i < $length; $i++) {
-	    $hash .= $chars[mt_rand(0, $max)];
-	}
-	return $hash;
+    function random($length, $chars = '0123456789')
+    {
+        $hash = '';
+        $max = strlen($chars) - 1;
+        for ($i = 0; $i < $length; $i++) {
+            $hash .= $chars[mt_rand(0, $max)];
+        }
+        return $hash;
     }
 
     /**
@@ -73,8 +85,9 @@ class Contractact {
      * @param string $lenth 长度
      * @return string 字符串
      */
-    function create_randomstr($lenth = 6) {
-	return $this->random($lenth, '123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ');
+    function create_randomstr($lenth = 6)
+    {
+        return $this->random($lenth, '123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ');
     }
 
 }

+ 95 - 57
protected/controller/ClientController.php

@@ -21,13 +21,15 @@ Doo::loadModel('users');
  *
  * @author NoNZero
  */
-class ClientController extends DooController {
+class ClientController extends DooController
+{
 
     private $data, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile;
     private $statusArray = array('uncheck' => '1', 'checking' => '2', 'checked' => '3', 'checkno' => '4');
     private $fileTypeArray = array('台帐附件');
 
-    public function __construct() {
+    public function __construct()
+    {
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->client = new client();
         $this->auth = new Auth();
@@ -44,7 +46,8 @@ class ClientController extends DooController {
         $this->itemfile = new ItemFile();
     }
 
-    public function ClientSignin() {
+    public function ClientSignin()
+    {
         if (isset($_POST['zhname']) && isset($_POST['zhpass'])) {
             echo json_encode(array('status' => FALSE, 'msg' => '登录失败,请更新软件。'), JSON_UNESCAPED_UNICODE);
             die;
@@ -75,13 +78,14 @@ class ClientController extends DooController {
                     die;
                 }
             } catch (Exception $exc) {
-                
+
             }
     }
 
     // 创建标段
     // 参数:用户ID,创建名称,KEY
-    function ClientCreatmeasure() {
+    function ClientCreatmeasure()
+    {
         if (isset($this->params['uid']) && $this->params['uid'] && isset($this->params['bname']) && $this->params['bname'] && $this->params['ckey'] && isset($this->params['ckey'])) {
             $retval = $this->contractact->getPidWithKey($this->params['ckey']);
             if (isset($retval['pid'])) {
@@ -112,7 +116,8 @@ class ClientController extends DooController {
     }
 
 // 编制人审核第一期时 开始审核第一期时候调用
-    public function ClientPeriod() {
+    public function ClientPeriod()
+    {
         // TODO:上报数据
         // TODO:每期更新数据时候和上传时候要查询当前进行期数的第几次一并写入数据库
         if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno']) && isset($_POST['MD5_JL'])) {
@@ -203,7 +208,8 @@ class ClientController extends DooController {
      * 查询标段的审核状态可以根据业主的审核依据来查询
      * 如果除业主意外的人审核状态为未通过怎么处理
      */
-    public function getMAStatus() {
+    public function getMAStatus()
+    {
         // curr:当前期数,status:当前状态,total:总期数
         // 参数catid
         if (isset($this->params['tenderid'])) {
@@ -258,7 +264,8 @@ class ClientController extends DooController {
         }
     }
 
-    public function getUserSearch() {
+    public function getUserSearch()
+    {
         if (isset($_POST['uemail']) && filter_var($_POST['uemail'], FILTER_VALIDATE_EMAIL)) {
             $retval = $this->users->getOne(array('where' => 'uemail=?', 'param' => array($_POST['uemail']), 'asArray' => TRUE));
             if (isset($retval['uid'])) {
@@ -287,7 +294,8 @@ class ClientController extends DooController {
      * sectionid:标段ID periodid:期数
      * TODO:如果审核人的期数或者次数与标段期数或者次数存在不对应情况的处理
      */
-    public function getAlluserMeasure() {
+    public function getAlluserMeasure()
+    {
         if (isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
 //            error_log(var_export($this->params, TRUE), 3, '/opt/html/jlzftest/data/' . time());
             // 先判断是否存在期数问题
@@ -335,7 +343,8 @@ class ClientController extends DooController {
 //
     //
     // 配置审核人时候还没有创建标段所以没有MPID存在
-    function addAuditMeasure() {
+    function addAuditMeasure()
+    {
         //  必须检查期数是否存在
         //  标段ID 当前登录 审核人ID
         //  检测是否重复写入 && ($_POST['creatoruid'] > 0)
@@ -367,7 +376,8 @@ class ClientController extends DooController {
     /**
      * 删除审核用户
      */
-    function delAuditMeasure() {
+    function delAuditMeasure()
+    {
         if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
             // 判断当前标段期数审核状态,决定是否继续执行
             $IntMaxTimes = $this->measureauditact->getMaxTimesInt($this->params['tenderid'], $this->params['phaseno']); // 根据标段PMID,期数numpname,获取目前重做次数
@@ -395,7 +405,8 @@ class ClientController extends DooController {
     }
 
 // 查询状态变更为审核中,已审核中为查询依据
-    function checkMeasureStatus() {
+    function checkMeasureStatus()
+    {
         if (isset($_POST['sectionid']) && isset($_POST['periodid'])) {
             $mpArray = $this->numofperact->getRow($_POST['sectionid'], $_POST['periodid']);
             $maArray = $this->measureauditact->getAlluserMeasureAudit($_POST['sectionid'], $_POST['periodid']);
@@ -420,7 +431,8 @@ class ClientController extends DooController {
     // 根据用户查询参与的标段信息
     //  参数为1时,当提交的附件中有重做记录时,提取记录未经过排重处理,出现重复结果。
     //  api/client/user/get/15/allproject 此接口也有同样问题
-    function getAuditProject() {
+    function getAuditProject()
+    {
         // TODO:可以通过SQL直接查询出来
         if (isset($_POST['audituid']) && isset($_POST['RequestType'])) {
             $downfileurl = NULL;
@@ -486,19 +498,19 @@ class ClientController extends DooController {
             }
             if ($_POST['RequestType'] == 2) {
                 /**
-                  {
-                  "downurl": "http://d.jl.smartcost.com.cn/data/2015/0608/20150608043245691/ProjectFile.rmf", 最新一期最新一次的文件
-                  "proName": "巫溪县前进桥",						项目名称
-                  "stName": "巫溪县 前进桥(终)",						合同段名称
-                  "MD5_Jl": "7cf05dccc6ad45b2d78f476a3388c3b2",				最新一期最新一次的文件hash code
-                  "tenderstatus": "2",							标段状态
-                  "tenderid": "234",							标段ID
-                  "pnameid": "79",							项目ID
-                  "ptypeid": "96",							合同段ID
-                  "audituidstatus": "2",							当前用户审核状态
-                  "bianzhirenuid": "59",							编制人UID
-                  "tenderName": "巫溪县 前进桥 终"						标段名称
-                  }
+                 * {
+                 * "downurl": "http://d.jl.smartcost.com.cn/data/2015/0608/20150608043245691/ProjectFile.rmf", 最新一期最新一次的文件
+                 * "proName": "巫溪县前进桥",                        项目名称
+                 * "stName": "巫溪县 前进桥(终)",                        合同段名称
+                 * "MD5_Jl": "7cf05dccc6ad45b2d78f476a3388c3b2",                最新一期最新一次的文件hash code
+                 * "tenderstatus": "2",                            标段状态
+                 * "tenderid": "234",                            标段ID
+                 * "pnameid": "79",                            项目ID
+                 * "ptypeid": "96",                            合同段ID
+                 * "audituidstatus": "2",                            当前用户审核状态
+                 * "bianzhirenuid": "59",                            编制人UID
+                 * "tenderName": "巫溪县 前进桥 终"                        标段名称
+                 * }
                  */
                 // TODO::不同角色提取条件不同是否使用audituid 作为当前用户提取条件,容易产生冲突
                 if (!isset($_POST['audituid']) || !($_POST['audituid'] > 0)) {
@@ -574,7 +586,7 @@ class ClientController extends DooController {
                      */
                     $intNum = $this->numofperact->getCountNumpname($spvalue['pmid'], $spvalue['numpname']);
                     // 如果期数是第一期期数必须大于一,否则减一为无效数据 ,为0表示这期为做上报没有产生记录
-                    if (( $spvalue['numpname'] > 1) && ($intNum == 0)) {// 提取上一期的数据
+                    if (($spvalue['numpname'] > 1) && ($intNum == 0)) {// 提取上一期的数据
                         // 提取期数减一
                         $intLastTimes = $this->numofperact->getMaxTimes($spvalue['pmid'], $spvalue['numpname'] - 1)['times'];
                         $numstatusArray = $this->numofperact->getRow($spvalue['pmid'], $spvalue['numpname'] - 1, $intLastTimes); //获取上一期最新一次的状态
@@ -606,7 +618,8 @@ class ClientController extends DooController {
     }
 
 //二维数组去掉重复值 并保留键值
-    function array_unique_fb($array2D) {
+    function array_unique_fb($array2D)
+    {
         $key = array();
         foreach ($array2D as $k => $v) {
             if (empty($key))
@@ -624,7 +637,8 @@ class ClientController extends DooController {
         return $temp2;
     }
 
-    function unique_arr($array2D, $stkeep = false, $ndformat = true) {
+    function unique_arr($array2D, $stkeep = false, $ndformat = true)
+    {
         // 判断是否保留一级数组键 (一级数组键可以为非数字)
         if ($stkeep)
             $stArr = array_keys($array2D);
@@ -655,7 +669,8 @@ class ClientController extends DooController {
     }
 
 // 标段期审核接口
-    function auditMeasure() {
+    function auditMeasure()
+    {
         if (isset($_POST['userid']) && isset($_POST['tenderid']) && isset($_POST['phaseno']) && isset($_POST['MD5_JL'])) {
             $auditcontent = iconv('GB2312', 'UTF-8', $_POST['CheckerMemo']);
             $auditArray = $this->measureauditact->getLastNewRowInfo($_POST['tenderid'], $_POST['phaseno'], $_POST['userid']);
@@ -749,7 +764,8 @@ class ClientController extends DooController {
     /**
      * 根据标段ID查询是否需要更新
      */
-    function checkTenderUpdate() {
+    function checkTenderUpdate()
+    {
         if (isset($this->params ['tenderid']) && $this->params['tenderid']) {
             $updateArray = $this->attfile->getFileUpdate($this->params['tenderid']);
             $projectArray = $this->project->getRowByPid($updateArray['pid']);
@@ -773,7 +789,8 @@ class ClientController extends DooController {
     /**
      * 手动创建第二期的审核人
      */
-    function creatTenderNumPnameUser() {
+    function creatTenderNumPnameUser()
+    {
         if (isset($_POST['tenderid']) && isset($_POST['phaseno']) && ($_POST['phaseno'] > 1)) {
             $allMeasureUser = $this->measureauditact->getUserAudit($_POST['tenderid'], $_POST['phaseno'] - 1);
             if (isset($allMeasureUser)) {
@@ -786,7 +803,7 @@ class ClientController extends DooController {
                     try {
                         $this->measureauditact->insertMeasureAudit($value['pid'], $value['creatoruid'], $value['auditoruid'], $value['mpid'], $value['pmid'], $value['stid'], $_POST['phaseno'], $status, $value['last']);
                     } catch (Exception $exc) {
-                        
+
                     }
                 }
                 echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
@@ -804,7 +821,8 @@ class ClientController extends DooController {
     /**
      * 返回指定用户参与的所有项目
      */
-    function getUserALLProject() {
+    function getUserALLProject()
+    {
         if (!isset($this->params['userid']) || !($this->params['userid'] > 0)) {
             echo json_encode(array('status' => FALSE, 'msg' => '返回指定用户参与的所有项目参数错误'), JSON_UNESCAPED_UNICODE);
             die();
@@ -848,7 +866,8 @@ class ClientController extends DooController {
      * TODO: 不通过两次未通过时候操作期数状态为错误位同步状态位 ok
      * TODO: MPID未通过操作不争取 ok
      */
-    function setCheckno() {
+    function setCheckno()
+    {
         if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno']) && isset($_POST['MD5_JL'])) {
             $auditcontent = iconv('GB2312', 'UTF-8', $_POST['CheckerMemo']);
             $auditArray = $this->measureauditact->getRowInfo($this->params['tenderid'], $this->params['phaseno'], $this->params['userid']);
@@ -898,7 +917,8 @@ class ClientController extends DooController {
      * 创建未通过的新一期
      *
      */
-    function createNewAudit() {
+    function createNewAudit()
+    {
         // 插入上次期数相关审核人员
         // TODO:
 //	error_log(var_export($this->params, TRUE), 3, '/opt/html/jiliang_customedProduct/data/' . time());
@@ -933,7 +953,8 @@ class ClientController extends DooController {
         }
     }
 
-    public function getUserInfo() {
+    public function getUserInfo()
+    {
         if (isset($this->params['userid']) && ($this->params['userid'] > 0)) {
             $proArray = $this->profile->getProWithUid($this->params['userid']);
             if (isset($proArray['userid'])) {
@@ -950,7 +971,8 @@ class ClientController extends DooController {
         }
     }
 
-    public function updateTenderName() {
+    public function updateTenderName()
+    {
         if (isset($this->params['BidID']) && isset($this->params['BidNewName'])) {
             if ($this->actmeasure->updateName($this->params['BidID'], iconv('GB2312', 'UTF-8', $this->params['BidNewName']))) {
                 echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
@@ -967,11 +989,12 @@ class ClientController extends DooController {
 
     /**
      *  清单附件上传,单文件上传
-     *  @param int $tenderid 标段ID
-     *  @param int $uid 上传人ID
-     *  @param int $itemid 本地清单ID
+     * @param int $tenderid 标段ID
+     * @param int $uid 上传人ID
+     * @param int $itemid 本地清单ID
      */
-    public function uploadItemFile() {
+    public function uploadItemFile()
+    {
         if (isset($this->params['tenderid']) && isset($this->params['uid'])) {
             if (!isset($_FILES['upitem']) && !isset($_POST['itemid']) && !isset($_POST['Category'])) {
                 $this->msg(0, '上传参数错误');
@@ -1000,7 +1023,8 @@ class ClientController extends DooController {
     /**
      * 获得清单附件列表
      */
-    public function getItemFileList() {
+    public function getItemFileList()
+    {
         if (isset($this->params['tenderid'])) {
             $itemfileArray = $this->itemfile->getItemFileList($this->params['tenderid']);
             $key = array_search(max($itemfileArray), $itemfileArray);
@@ -1020,7 +1044,8 @@ class ClientController extends DooController {
     /**
      * 编辑清单附件描述 文件名?
      */
-    public function updateItemFileDesc() {
+    public function updateItemFileDesc()
+    {
         if (isset($this->params['fileid']) && isset($_POST['FileName']) && isset($_POST['Memo'])) {
             if ($this->itemfile->updateItemFields($this->params['fileid'], $_POST['FileName'], $_POST['Memo']) > 0) {
                 echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
@@ -1038,7 +1063,8 @@ class ClientController extends DooController {
      *   查询指定项目的指定期的全部审核意见。
      *   标段ID,期号
      */
-    public function getAuditOpinion() {
+    public function getAuditOpinion()
+    {
         if (isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
             $retval = $this->measureauditact->getAuditOpinion($this->params['tenderid'], $this->params['phaseno']);
             $iterator = new ArrayIterator($retval);
@@ -1058,34 +1084,41 @@ class ClientController extends DooController {
         }
     }
 
-    function upfile($fildname, $param = 'doc, docx, xls, xlsx, png, zip') {
+    function upfile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
+    {
         return $this->att->uploadMut($fildname, $param);
     }
 
-    function upItemFile($fildname, $param = 'doc, docx, xls, xlsx, png, zip') {
+    function upItemFile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
+    {
         $this->att->setUploadDir();
         return $this->att->uploadMut($fildname, $param);
     }
 
-    function getFileupErrorNo() {
+    function getFileupErrorNo()
+    {
         return $this->att->error();
     }
 
-    function Signout() {
+    function Signout()
+    {
         session_destroy();
     }
 
-    function isLoggedIn() {
+    function isLoggedIn()
+    {
         return isset($_SESSION['user_id']);
     }
 
-    function generateFormHash($salt) {
+    function generateFormHash($salt)
+    {
         $hash = md5(mt_rand(1, 1000000) . $salt);
         $_SESSION['csrf_hash'] = $hash;
         return $hash;
     }
 
-    function isValidFormHash($hash) {
+    function isValidFormHash($hash)
+    {
         return $_SESSION['csrf_hash'] === $hash;
     }
 
@@ -1094,7 +1127,8 @@ class ClientController extends DooController {
      * @param $password 密码
      * @param $random 随机数
      */
-    function random($length, $chars = '0123456789') {
+    function random($length, $chars = '0123456789')
+    {
         $hash = '';
         $max = strlen($chars) - 1;
         for ($i = 0; $i < $length; $i++) {
@@ -1108,11 +1142,13 @@ class ClientController extends DooController {
      * @param string $lenth 长度
      * @return string 字符串
      */
-    function create_randomstr($lenth = 6) {
+    function create_randomstr($lenth = 6)
+    {
         return $this->random($lenth, '123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ');
     }
 
-    function dir_create($path, $mode = 0777) {
+    function dir_create($path, $mode = 0777)
+    {
         if (is_dir($path))
             return TRUE;
         $path = $this->dir_path($path);
@@ -1123,14 +1159,16 @@ class ClientController extends DooController {
         return is_dir($path);
     }
 
-    function dir_path($path) {
+    function dir_path($path)
+    {
         $path = str_replace('\\', '/', $path);
         if (substr($path, -1) != '/')
             $path = $path . '/';
         return $path;
     }
 
-    function msg($isTrue = 0, $msg = null, $retmsg = null) {
+    function msg($isTrue = 0, $msg = null, $retmsg = null)
+    {
         if ($isTrue > 0) {
             echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
             die();

+ 24 - 13
protected/controller/RProjectController.php

@@ -15,11 +15,13 @@ Doo::loadClass('numofperact');
  *
  * @author darkredz
  */
-class RProjectController extends DooController {
+class RProjectController extends DooController
+{
 
     private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审核', 'checking' => '审核中', 'checked' => '已审核', 'checkno' => '未通过');
 
-    public function __construct() {
+    public function __construct()
+    {
         $this->auth = new Auth();
         $this->attfile = new attFile();
         $this->profile = new Profile();
@@ -33,7 +35,8 @@ class RProjectController extends DooController {
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
     }
 
-    public function beforeRun($resource, $action) {
+    public function beforeRun($resource, $action)
+    {
 //	$uGroups = $this->profile->getProWithUid($this->auth->getUid());
 //	$falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
 //	if (!$falg)
@@ -43,12 +46,13 @@ class RProjectController extends DooController {
             $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
             if (!$falg)
                 return Doo::acl()->defaultFailedRoute;
-        }else {
+        } else {
             return Doo::acl()->defaultFailedRoute;
         }
     }
 
-    public function index() {
+    public function index()
+    {
         $mpidArray = $this->measureauditact->getAuditProject($this->auth->getUid());
         if (isset($mpidArray[0]['pid'])) {
             foreach ($mpidArray as $key => $value) {
@@ -71,7 +75,8 @@ class RProjectController extends DooController {
         $this->render('r-project', $this->data);
     }
 
-    public function proOverview() {
+    public function proOverview()
+    {
 //	$this->data['pros'] = $this->project->getAll();
 //	if (isset($_POST['pname']) && $_POST['pname']) {
 //	    $this->project->insertProject($_POST['pname']);
@@ -81,7 +86,8 @@ class RProjectController extends DooController {
         $this->render('w-project-detail', $this->data);
     }
 
-    public function proSection() {
+    public function proSection()
+    {
         $this->data['allproArray'] = $this->project->getAll();
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
         $this->data['conArray'] = $this->contractact->getRowByPid($this->params['pid']);
@@ -134,7 +140,7 @@ class RProjectController extends DooController {
 		    </div>
 		</td>
 		</tr>';
-                        $hetongTotal+=$v['contracttotal'];
+                        $hetongTotal += $v['contracttotal'];
                     }
                 }
             $this->data['conArray'][$key]['htmlstr'] = $html;
@@ -152,7 +158,8 @@ class RProjectController extends DooController {
         $this->render('r-project-section', $this->data, TRUE);
     }
 
-    function proSectionMeasure() {
+    function proSectionMeasure()
+    {
         $this->data['allproArray'] = $this->project->getAll();
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
         $this->data['pid'] = $this->params['pid'];
@@ -182,7 +189,8 @@ class RProjectController extends DooController {
         $this->render('r-project-section-measure', $this->data, TRUE);
     }
 
-    Function fNumber($number) {
+    Function fNumber($number)
+    {
         if ($number == '')
             Return "-";
         $nlen = strlen($number);
@@ -198,7 +206,8 @@ class RProjectController extends DooController {
         Return $fNumber;
     }
 
-    public function welcome() {
+    public function welcome()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
         if ($this->profile->getProWithUid($_SESSION['uid'])['userid'])
@@ -212,7 +221,8 @@ class RProjectController extends DooController {
         $this->render('welcome', $this->data);
     }
 
-    public function prolist() {
+    public function prolist()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
 //	$proArray = new stdClass();
@@ -230,7 +240,8 @@ class RProjectController extends DooController {
         $this->render('s-project', $this->data);
     }
 
-    public function proDetail() {
+    public function proDetail()
+    {
         // 项目名称
         $this->data['allproArray'] = $this->project->getAll();
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);