|
@@ -81,9 +81,9 @@ class Changes
|
|
|
public function getListbyMydetail($pmid='',$uid,$limit)
|
|
|
{
|
|
|
if(empty($pmid)){
|
|
|
- return $this->__change->find(array('where' => '(status="checking" or status="back" or status="uncheck") and cid in(select `jl_change_audit`.cid from `jl_change_audit` where `jl_change_audit`.uid=? and `jl_change_audit`.status="checking")', 'param' => array($uid), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
|
|
|
+ return $this->__change->find(array('where' => '(status="checking" or status="back" or status="uncheck") and cid in(select `jl_change_audit`.cid from `jl_change_audit` where `jl_change_audit`.uid=? and `jl_change_audit`.status="checking") and pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1)', 'param' => array($uid), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
|
|
|
}else{
|
|
|
- return $this->__change->find(array('where' => 'pmid=? and (status="checking" or status="back" or status="uncheck") and cid in(select `jl_change_audit`.cid from `jl_change_audit` where `jl_change_audit`.uid=? and `jl_change_audit`.status="checking")', 'param' => array($pmid,$uid), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
|
|
|
+ return $this->__change->find(array('where' => 'pmid=? and (status="checking" or status="back" or status="uncheck") and cid in(select `jl_change_audit`.cid from `jl_change_audit` where `jl_change_audit`.uid=? and `jl_change_audit`.status="checking") and pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1)', 'param' => array($pmid,$uid), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -152,9 +152,9 @@ class Changes
|
|
|
public function getChangebyPnumPmid($pnum,$pmid,$cid = '')
|
|
|
{
|
|
|
if($cid != ''){
|
|
|
- return $this->__change->getOne(array('where' => 'pnum=? and pmid=? and cid!=? and status!="del"', 'param' => array($pnum,$pmid,$cid), 'asArray' => TRUE));
|
|
|
+ return $this->__change->getOne(array('where' => 'pnum=? and pmid=? and cid!=? and status!="del" and status!="checkno"', 'param' => array($pnum,$pmid,$cid), 'asArray' => TRUE));
|
|
|
}else{
|
|
|
- return $this->__change->getOne(array('where' => 'pnum=? and pmid=? and status!="del"', 'param' => array($pnum,$pmid), 'asArray' => TRUE));
|
|
|
+ return $this->__change->getOne(array('where' => 'pnum=? and pmid=? and status!="del" and status!="checkno"', 'param' => array($pnum,$pmid), 'asArray' => TRUE));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -215,13 +215,13 @@ class Changes
|
|
|
//changeaudit
|
|
|
public function getNeedChangeNumbyUid($uid)
|
|
|
{
|
|
|
- return $this->__changeaudit->count(array('where' => 'uid=? and status="checking"', 'param' => array($uid), 'asArray' => TRUE));
|
|
|
+ return $this->__changeaudit->count(array('where' => 'uid=? and status="checking" and pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1)', 'param' => array($uid), 'asArray' => TRUE));
|
|
|
}
|
|
|
|
|
|
public function getPmidGroup($uid)
|
|
|
{
|
|
|
// return $this->__changeaudit->find(array('where' => 'uid=? and cid in (SELECT `jl_change`.`cid` FROM `jl_change` WHERE `jl_change`.status!="uncheck")', 'param' => array($uid), 'groupby' => 'pmid', 'asArray' => TRUE));
|
|
|
- $sql = 'SELECT a.* FROM `jl_change_audit` as a join `jl_project_measure` as b on a.pmid=b.pmid WHERE a.uid='.$uid.' and a.cid in (SELECT `jl_change`.`cid` FROM `jl_change` WHERE `jl_change`.status!="uncheck") GROUP BY a.pmid order by convert(b.pmname using gbk)';
|
|
|
+ $sql = 'SELECT a.* FROM `jl_change_audit` as a join `jl_project_measure` as b on a.pmid=b.pmid WHERE a.uid='.$uid.' and a.cid in (SELECT `jl_change`.`cid` FROM `jl_change` WHERE `jl_change`.status!="uncheck") and a.pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1) GROUP BY a.pmid order by convert(b.pmname using gbk)';
|
|
|
$query = Doo::db ()->query ( $sql );
|
|
|
|
|
|
$result = $query->fetchAll ();
|
|
@@ -232,9 +232,9 @@ class Changes
|
|
|
public function getNumbyMydetail($pmid='',$uid)
|
|
|
{
|
|
|
if(empty($pmid)){
|
|
|
- return $this->__changeaudit->count(array('where' => 'uid=? and status="checking"', 'param' => array($uid), 'asArray' => TRUE));
|
|
|
+ return $this->__changeaudit->count(array('where' => 'uid=? and status="checking" and pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1)', 'param' => array($uid), 'asArray' => TRUE));
|
|
|
}else{
|
|
|
- return $this->__changeaudit->count(array('where' => 'pmid=? and uid=? and status="checking"', 'param' => array($pmid,$uid), 'asArray' => TRUE));
|
|
|
+ return $this->__changeaudit->count(array('where' => 'pmid=? and uid=? and status="checking" and pid in (SELECT `jl_project`.`pid` FROM `jl_project` WHERE `jl_project`.`switch_change`=1)', 'param' => array($pmid,$uid), 'asArray' => TRUE));
|
|
|
}
|
|
|
}
|
|
|
|