信呼OA版本v2.3.9

This commit is contained in:
雨中磐石
2022-09-05 15:58:07 +08:00
parent e3fcd913e3
commit c09f4dba40
29 changed files with 657 additions and 57 deletions

View File

@@ -22,6 +22,9 @@ class agent_gongClassModel extends agentModel
$where.= " and (`zstart` is null or `zstart`<='{$this->rock->date}')";
$where.= " and (`zsend` is null or `zsend`>='{$this->rock->date}')";
$wdate = m('admin')->getmou('workdate', $uid);
if(!isempt($wdate))$where.=" and `indate`>='$wdate'";
$where .= m('admin')->getcompanywhere(1);
$stotal = m('infor')->rows($where);
return $stotal;

View File

@@ -0,0 +1,31 @@
<?php
/**
通知公告的
*/
class agent_planmClassModel extends agentModel
{
public function gettotal()
{
$stotal = $this->getwdtotal($this->adminid);
$titles = '';
return array('stotal'=>$stotal,'titles'=> $titles);
}
private function getwdtotal($uid)
{
$stotal = m('flow:planm')->getwwctotals($uid);
return $stotal;
}
protected function agenttotals($uid)
{
$a = array(
'mydwc' => $this->getwdtotal($uid)
);
return $a;
}
}

View File

@@ -17,6 +17,16 @@ class companyClassModel extends Model
'name' => '最顶级',
);
$this->getselectdatas($rows, $barr, '0', 0);
$idarr = array();
foreach($barr as $k=>$rs)$idarr[] = $rs['value'];
foreach($rows as $k=>$rs){
if(!in_array($rs['id'], $idarr)){
$barr[] = array(
'name' => $rs['name'],
'value' => $rs['id'],
);
}
}
return $barr;
}
private function getselectdatas($rows,&$barr, $pid='0', $level=0)

File diff suppressed because one or more lines are too long

View File

@@ -101,8 +101,8 @@ class flow_gongClassModel extends flowModel
$h = c('html');
$cont = $h->htmlremove($this->rs['content']);
$cont = $h->substrstr($cont,0, 50);
if(strlen($cont)>40)$cont.='...';
$cont = $h->substrstr($cont,0, 40);
if(strlen($cont)>41)$cont.='...';
if(isempt($cont))$cont = $this->rs['title']; //为空时
$this->push($this->rs['receid'], '通知公告', $cont, $this->rs['title'],1);
@@ -159,6 +159,8 @@ class flow_gongClassModel extends flowModel
if($lx=='my' || $lx=='wexx'){
$whyere= "and (`zstart` is null or `zstart`<='{$this->rock->date}')";
$whyere.= " and (`zsend` is null or `zsend`>='{$this->rock->date}')";
$wdate = $this->adminmodel->getmou('workdate', $uid);
if(!isempt($wdate))$whyere.=" and `indate`>='$wdate'";
}
if($typeid>0){

View File

@@ -0,0 +1,173 @@
<?php
class flow_planmClassModel extends flowModel
{
public function leixingdata()
{
$arr[] = array('value'=>'1','name'=>'年度');
$arr[] = array('value'=>'2','name'=>'季度');
$arr[] = array('value'=>'3','name'=>'月度');
$arr[] = array('value'=>'4','name'=>'周');
$arr[] = array('value'=>'5','name'=>'项目');
$arr[] = array('value'=>'0','name'=>'其他');
return $arr;
}
private function leixingval($lx)
{
$data = $this->leixingdata();
$str = $lx;
foreach($data as $kv=>$rv){
if($rv['value']==$lx){
$str = $rv['name'].'计划';
break;
}
}
return $str;
}
public function flowrsreplace($rs, $lx=0){
$rs['leixing'] = $this->leixingval($rs['leixing']);
$str = '';
if($rs['startdt']>$this->rock->now){
$str = '未开始';
}else if($rs['enddt']<$this->rock->now){
}else{
$str = '执行中';
}
if($rs['state']==1)$str='已完成';
if($rs['state']==2)$str='执行中';
if($rs['state']==0)$str='待执行';
if($rs['enddt']<$this->rock->now)$str.=',<font color=gray>已截止</font>';
if($rs['startdt']>$this->rock->now)$str='未开始';
$rs['state'] = $str;
return $rs;
}
//自定义审核人读取
protected function flowcheckname($num){
$sid = '';
$sna = '';
if($num=='zhixi'){
$ssid = '';
$runrenid = $this->rs['runrenid'];
if(!isempt($runrenid)){
$dbs = m('dept');
$runa = explode(',', $runrenid);
foreach($runa as $id1){
$id1d = str_replace(array('d','u'),'', $id1);
if(contain($id1,'d')){
$drs = $dbs->getone($id1d);
if($drs && !isempt($drs['headid']))$ssid.=','.$drs['headid'].'';
}else{
$ssid.=','.$id1d.'';
}
}
}
if($ssid){
$ssid = substr($ssid, 1);
$rows = $this->adminmodel->getall('id in('.$ssid.') and `status`=1');
if($rows){
foreach($rows as $k=>$rs){
$sid.=','.$rs['id'].'';
$sna.=','.$rs['name'].'';
}
$sid = substr($sid, 1);
$sna = substr($sna, 1);
}
}
}
return array($sid, $sna);
}
protected function flowbillwhere($uid, $lx)
{
$where = '';
if($lx=='bumen'){
$dbs = m('dept');
$detpids= '';
$drows = $dbs->getall($this->rock->dbinstr('headid', $uid)); //读取我负责的部门
foreach($drows as $k=>$rs)$detpids.=','.$rs['id'].'';
if($detpids!=''){
$detpids = substr($detpids,1);
for($i=1;$i<=2;$i++){
$drows = $dbs->getall('`pid` in('.$detpids.')');
foreach($drows as $k=>$rs)$detpids.=','.$rs['id'].'';
if(!$drows)break;
}
}
if(!$detpids){
$where='and 1=2';
}else{
$drows = $dbs->getall('`id` in('.$detpids.')');
$whewea = array();
foreach($drows as $k=>$rs){
$whewea[] = $this->rock->dbinstr('runrenid', 'd'.$rs['id'].'');
}
$where = 'and ('.join(' or ', $whewea).')';
}
}
return $where;
}
//判断是不是再执行人里面。
private $runboolpdid = 0;
public function runboolpd()
{
if($this->rs['status']!=1
|| ($this->rs['enddt']<$this->rock->now && $this->rs['state']==1)
|| $this->rs['startdt']>$this->rock->now)return false;
if($this->runboolpdid>0){
if($this->runboolpdid==1)return true;
if($this->runboolpdid==2)return false;
}
$bo = $this->adminmodel->containjoin($this->rs['runrenid'], $this->adminid);
$this->runboolpdid = $bo ? 1: 2;
return $bo;
}
//是否可执行
protected function flowdatalog($arr)
{
$runbool = $this->runboolpd();
return array(
'modelujs' => $runbool,
);
}
//子表数据替换处理
protected function flowsubdata($rows, $lx=0){
if($lx!=1 || !$rows || !$this->runboolpd())return $rows;
$inputobj = c('input');
foreach($rows as $k=>$rs){
$rows[$k]['zxren'] = $inputobj->inputchangeuser(array(
'type' => 'changedeptusercheck',
'changerange' => $this->rs['runrenid'],
'name' => 'zhixing_zxren_'.$rs['id'].'',
'id' => 'zhixing_zxrenid_'.$rs['id'].'',
'value' => $rs['zxren'],
'valueid' => $rs['zxrenid'],
'title' => '执行人'
));
$rows[$k]['zxtime'] = '<input name="zhixing_zxtime_'.$rs['id'].'" onclick="js.datechange(this,\'datetime\')" readonly value="'.$rs['zxtime'].'" class="inputs datesss">';
}
$zt = $this->rs['state'];
$rows[] = array(
'pitem'=>'执行状态',
'zxren'=>'<select id="ztstate" class="inputs"><option value="0">待执行</option><option value="2"'.(($zt==2)?' selected':'').'>执行中</option><option value="1"'.(($zt==1)?' selected':'').'>已完成</option></select>',
'zxtime'=>'<div align="left"><button type="button" onclick="submittijiao(this)" class="webbtn">保存</button></div>'
);
return $rows;
}
//统计未完成
public function getwwctotals($uid)
{
$where = m('admin')->getjoinstr('runrenid', $uid,0,1);
$where = "`status`=1 and `state`<>1 and `startdt`<'{$this->rock->now}' $where";
return m('planm')->rows($where);
}
}

View File

@@ -203,14 +203,17 @@ class goodsClassModel extends Model
*/
public function getgoodninfo($mid, $glx=0, $mgx=5)
{
$rows = $this->db->getall("select a.`count`,a.couns,a.`price`,b.`unit`,b.`num`,b.`name`,b.`guige`,b.`xinghao` from `[Q]goodn` a left join `[Q]goods` b on a.`aid`=b.`id` where a.`mid`='$mid' order by a.`sort`");
$rows = $this->db->getall("select a.`count`,a.couns,a.`price`,b.`unit`,b.`num`,b.`name`,b.`guige`,b.`xinghao`,a.`lygh` from `[Q]goodn` a left join `[Q]goods` b on a.`aid`=b.`id` where a.`mid`='$mid' order by a.`sort`");
$str = '';
if($glx==1){
foreach($rows as $k1=>$rs1){
if($k1>$mgx)break;
$str.=''.$rs1['name'].'';
if(!isempt($rs1['xinghao']))$str.='('.$rs1['xinghao'].')';
$str .=':'.$rs1['count'].''.$rs1['unit'].';';
$str .=':'.$rs1['count'].''.$rs1['unit'].'';
if($rs1['lygh']=='1')$str.='<font color=blue>(需归还)</font>';
if($rs1['lygh']=='2')$str.='<font color=green>(已归还)</font>';
$str.=';';
}
return $str;
}

View File

@@ -71,6 +71,13 @@ class homeitemsClassModel extends Model
if(in_array('receiptmy', $nubar) && !isset($arr['receiptmy']))$arr['receiptmy'] = m('flow:receipt')->getweitotal($uid);
if(in_array('myhong', $nubar) && !isset($arr['myhong']))$arr['myhong'] = m('official')->rows('`uid`='.$uid.' and `type`=0 and `status`=1 and `thid`=0');//统计未套红的
if(in_array('officidus', $nubar) && !isset($arr['officidus']))$arr['officidus'] = m('officidu')->rows('`status` in(0,3) and `isturn`=1 and '.$this->rock->dbinstr('runrenid',$uid).'');
//未完成工作计划
if(in_array('myplan', $nubar) && !isset($arr['myplan'])){
$obj = m('flow:planm');
if(method_exists($obj,'getwwctotals'))$arr['myplan'] = $obj->getwwctotals($uid);
}
return $arr;
}

View File

@@ -226,7 +226,7 @@ class whereClassModel extends Model
*/
public function checkwhere($modeid, $str)
{
if(isempt($str))return '';
if(isempt($str) || $this->rock->post('yuanwhere')!='1')return '';
$where = $this->rock->jm->base64decode($str);
if($where=='all' || contain($where, '{super}') ||
contain($where, '{allsuper}') ||