信呼v2.5.0版本

This commit is contained in:
雨中磐石
2022-09-29 15:34:08 +08:00
parent e6d2c91521
commit 44100a4ab9
37 changed files with 685 additions and 91 deletions

View File

@@ -6,7 +6,7 @@ class flow_assetmClassModel extends flowModel
$this->statearr = c('array')->strtoarray('blue|闲置,#ff6600|在用,red|维修,gray|报废,gray|丢失');
}
public function flowrsreplace($rs)
public function flowrsreplace($rs,$lx=0)
{
if(isset($rs['typeid']))$rs['typeid'] = $this->db->getmou('[Q]option','name',"`id`='".$rs['typeid']."'");
if(isset($rs['ckid']) && $rs['ckid']>0){
@@ -21,6 +21,16 @@ class flow_assetmClassModel extends flowModel
$rs['state'] = '<font color="'.$b[0].'">'.$b[1].'</font>';
}
if(isset($rs['fengmian']) && !isempt($rs['fengmian']))$rs['fengmian'] = '<img src="'.$rs['fengmian'].'" height="100">';
if($lx==1){
$rows = $this->db->getall('select a.runren,a.id,a.optdt from `[Q]planm` a left join `[Q]plans` b on a.id=b.mid where b.itemid='.$rs['id'].' and a.`type`=1');
$str = '';
foreach($rows as $k1=>$rs1){
$url = $this->getxiangurl('assetmly', $rs1['id'],'auto');
$str.=''.$rs1['runren'].'('.$rs1['optdt'].') <a href="'.$url.'">查看</a><br>';
}
$rs['lycount'] = $str;
}
return $rs;
}

View File

@@ -0,0 +1,97 @@
<?php
class flow_assetmlyClassModel extends flowModel
{
public function flowrsreplace($rs, $lx=0)
{
if($lx==2){
$rows = $this->db->getall('select `pitem` from `[Q]plans` where `mid`='.$rs['id'].'');
$s = '';
foreach($rows as $k1=>$rs1)$s.=''.$rs1['pitem'].';';
$rs['contentlist'] = $s;
}
$state = $rs['state'];
if($state!='2'){
if($rs['status']==1)$state = 1;
}
if($state != $rs['state'])$this->update('`state`='.$state.'', $rs['id']);
if($state=='0')$rs['state']='待领取';
if($state=='1')$rs['state']='已领取';
if($state=='2')$rs['state']='已归还';
return $rs;
}
//自定义审核人读取
protected function flowcheckname($num){
$sid = '';
$sna = '';
if($num=='queren'){
$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 flowcheckfinsh($zt)
{
if($zt==1){
$rows = m('plans')->getall('`mid`='.$this->id.'');
foreach($rows as $k=>$rs){
m('assetm')->update(array(
'useid' => $this->rs['runrenid'],
'usename' => $this->rs['runren'],
'state' => 1
),$rs['itemid']);
}
$this->update('`state`=1', $this->id);
}
}
//归还
protected function flowoptmenu($ors, $crs)
{
if($ors['num']=='guihainoup'){
$rows = m('plans')->getall('`mid`='.$this->id.'');
foreach($rows as $k=>$rs){
m('assetm')->update(array(
'useid' => '',
'usename' => '',
'state' => 0
),$rs['itemid']);
}
$this->update('`state`=2', $this->id);
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -167,7 +167,7 @@ class flow_planmClassModel extends flowModel
public function getwwctotals($uid)
{
$where = m('admin')->getjoinstr('runrenid', $uid,0,1);
$where = "`status`=1 and `state`<>1 and `startdt`<'{$this->rock->now}' $where";
$where = "`status`=1 and `state`<>1 and `startdt`<'{$this->rock->now}' and `type`=0 $where";
return m('planm')->rows($where);
}
}

View File

@@ -36,7 +36,7 @@ class flow_scheduleClassModel extends flowModel
$rate = $rs['rate'];
if(isset($this->ratearr[$rate])){
if($rate=='w')$rate='每周'.$rs['rateval'].'';
if($rate=='d')$rate='每天';
if($rate=='d')$rate='每'.$rs['rateval'].'天';
if($rate=='m')$rate='每月'.$rs['rateval'].'号';
$rs['rate'] = $rate;
}