信呼v2.5.1版本

This commit is contained in:
雨中磐石
2022-11-17 16:20:57 +08:00
parent 44100a4ab9
commit f4d68700c7
65 changed files with 1642 additions and 245 deletions

View File

@@ -463,7 +463,7 @@ class adminClassModel extends Model
$where2 = $this->gjoin($rangeno, '', 'where');
$where2 = 'and not('.$where2.')';
}
if($lx==0)$where.=' and `isvcard`=1'; //通讯录显示
//--start--
if(ISMORECOM && $uid>1){
$comid = $this->getcompanyid($uid);
@@ -477,9 +477,12 @@ class adminClassModel extends Model
}else{
$where = 'and ((1 '.$where.') or (`id`='.$uid.'))';
}
$rows = $this->getall("`status`=1 $where $where1 $where2",$fields,'`sort`,`name`');
if($lx==0)$where2.=' and `isvcard`=1'; //通讯录显示
$sql = "select $fields from `[Q]admin` where `status`=1 $where $where1 $where2 order by `sort`,`name`";
$rows = $this->db->getall($sql);
}else{
$rows = $this->getall("`id`='$uid'",$fields,'`sort`,`name`');
$sql = "select $fields from `[Q]admin` where `id`='$uid'";
$rows = $this->db->getall($sql);
}

View File

@@ -13,13 +13,23 @@ class beifenClassModel extends Model
foreach($alltabls as $tabs){
if(in_array($tabs, $nobeifne))continue;
$rows = $this->db->getall('select * from `'.$tabs.'`');
$fields = $this->db->gettablefields($tabs);
$data = array();
$sqla = $this->db->getall('show create table `'.$tabs.'`');
$createsql = $sqla[0]['Create Table'];
$data[$tabs] = array(
'fields' => $fields,
'data' => $rows
//'fields' => $fields,
'createsql' => $createsql,
'data' => $rows,
);
$file = ''.$tabs.'_'.count($fields).'_'.count($rows).'.json';
$fzshu = 0;
if(isset($rows[0]))foreach($rows[0] as $k1=>$v1)$fzshu++;
//if($fzshu==0){
// $fields = $this->db->gettablefields($tabs);
// $fzshu = count($fields);
//}
$file = ''.$tabs.'_'.$fzshu.'_'.count($rows).'.json';
//$str = $this->rock->jm->encrypt(json_encode($data));
$str = json_encode($data);
$bo = $this->rock->createtxt(''.$beidir.'/'.$file.'', $str);
if(!$bo){echo '无权限写入:'.$beidir.'';break;return false;}

View File

@@ -0,0 +1,101 @@
<?php
class flow_collectmClassModel extends flowModel
{
public function flowrsreplace($rs, $lx=0)
{
$state = $rs['state'];
if($state=='0')$rs['state']='<font color=blue>待生成</font>';
if($state=='1')$rs['state']='<font color=green>已生成</font>';
$rs['fenleival'] = $rs['fenlei'];
if($rs['fenlei']=='0')$rs['fenlei']='内部';
if($rs['fenlei']=='1')$rs['fenlei']='<font color=blue>外部</font>';
if($rs['fenleival']=='0'){
$yixs = $this->rows('`type`=3 and `leixing`='.$rs['id'].' and `isturn`=1');
$rs['leixing'] = ''.$rs['leixing'].'/'.$yixs.'';
}
return $rs;
}
//生成收集表格
protected function flowoptmenu($ors, $crs)
{
if($ors['num']=='noupcreate' && $this->rs['fenlei']=='0'){
$where = $this->adminmodel->gjoin($this->rs['runrenid'], 'ud', 'where');
$where = '`status`=1 and `workdate`<=\''.substr($this->rs['startdt'],0,10).'\' and '.$where.'';
$rows = $this->adminmodel->getall($where);
$flow = m('flow')->initflow('collects');
$shu = 0;
foreach($rows as $k=>$rs){
$shu++;
$uarr = array(
'uid' => $rs['id'],
'optdt' => $this->rock->now,
'optid' => $rs['id'],
'optname' => $rs['name'],
'applydt' => $this->rock->date,
'status' => 0,
'type' => 3,
'isturn' => 0,
'comid' => $this->rs['comid'],
'name' => $this->rs['name'],
'startdt' => $this->rs['startdt'],
'enddt' => $this->rs['enddt'],
'leixing' => $this->id,
'psren' => $this->uname,
'psrenid' => $this->rs['uid'],
);
$mid = $flow->insert($uarr);
$flow->loaddata($mid, false);
$flow->submit('保存', $crs['sm']);
$cont = '名称:'.$uarr['name'].'\n评审人'.$uarr['psren'].'\n截止时间'.$uarr['enddt'].'';
$flow->pushs($rs['id'],$cont, '你有信息收集表待完成');
}
$this->update('`state`=1,`leixing`='.$shu.'', $this->id);
}
//复制
if($ors['num']=='noupfuzhi'){
$flow = m('flow')->initflow('collectm');
$uarr = array(
'uid' => $this->adminid,
'optdt' => $this->rock->now,
'optid' => $this->adminid,
'optname' => $this->adminname,
'applydt' => $this->rock->date,
'status' => 0,
'state' => 0,
'type' => 2,
'isturn' => 0,
'comid' => $this->rs['comid'],
'name' => $this->rs['name'],
'startdt' => $this->rock->now,
'enddt' => date('Y-m-d H:i:s', time()+24*3600),
'leixing' => $this->rs['leixing'],
'runren' => $this->rs['runren'],
'runrenid' => $this->rs['runrenid'],
'explain' => $this->rs['explain'],
'fenlei' => $this->rs['fenlei'],
);
$mid = $flow->insert($uarr);
$dsbs = m('plans');
$zrows = $dsbs->getall('mid='.$this->id.'');
foreach($zrows as $k=>$rs1){
$iuarr = $rs1;
unset($iuarr['id']);
$iuarr['mid'] = $mid;
$dsbs->insert($iuarr);
}
$flow->loaddata($mid, false);
$flow->submit('保存', $crs['sm']);
}
}
}

View File

@@ -0,0 +1,159 @@
<?php
class flow_collectsClassModel extends flowModel
{
public $subtable = 'plans';
public function flowfieldarr($farr, $lx)
{
$mid = (int)$this->rock->post('mid','0');
//if($mid==0)$mid = (int)$this->rock->post('id','0');
$this->newfarr = array();
if($mid){
$mrs = $this->getone($mid);
$sid = $mrs['leixing'];
$zrows = m($this->subtable)->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs){
$frs = $farr[0];
$frs['name'] = $rs['pitem'];
$frs['fieldstype'] = $rs['zxren'];
$frs['data'] = $rs['zxrenid'];
$frs['attr'] = '';
$frs['lens'] = '0';
$frs['isbt'] = ($rs['itemid']=='1')?'1':'0';
$frs['islu'] = '1';
$frs['id'] = '0';
$frs['fields'] = 'sitemid_'.$rs['id'].'';
$farr[] = $frs;
$this->newfarr[] = $frs;
}
}
return $farr;
}
//在运行这个,模版处理
public function flowinputtpl($cont, $lx)
{
//pc
if($lx==0){
$str = '';
foreach($this->newfarr as $k=>$rs){
$str.='<tr><td class="ys1" align="right">'.(($rs['isbt']=='1')?'*':'').''.$rs['name'].'</td><td colspan="3" class="ys2">{'.$rs['fields'].'}</td></tr>';
}
$cont = str_replace('{autotpl}', $str, $cont);
}
return $cont;
}
//报错子表信息
protected function flowsubmit($na, $sm)
{
$sid = $this->rs['leixing'];
$dbs = m($this->subtable);
$zrows = $dbs->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs){
$fields = 'sitemid_'.$rs['id'].'';
$where = '`mid`='.$this->id.' and `itemid`='.$rs['id'].'';
$uarr = array(
'pitem' => $rs['pitem'],
'zxren' => $this->rock->post($fields),
'zxrenid' => $this->rock->post($fields.'id'),
'itemid'=> $rs['id'],
'mid' => $this->id,
'comid' => $this->rs['comid'],
'sort' => $rs['sort'],
);
if($dbs->rows($where)==0)$where='';
$dbs->record($uarr, $where);
}
$this->updaterenshu($sid);
}
public function updaterenshu($sid)
{
$zrshu = $this->rows('`leixing`='.$sid.' and `type`=3 and `status`<>5');
$this->update('`leixing`='.$zrshu.'', $sid);
}
protected function flowrsreplaceedit($rs)
{
$this->addotherfield();
$zrows = m($this->subtable)->getall('mid='.$rs['id'].'','*','`sort`');
foreach($zrows as $k=>$rs1){
$rs['sitemid_'.$rs1['itemid'].''] = $rs1['zxren'];
$this->rssust['sitemid_'.$rs1['itemid'].''] = $rs1['zxren'];
}
return $rs;
}
/*
protected function flowgetfields($lx)
{
$zrows = m($this->subtable)->getall('mid='.$this->id.'','*','`sort`');
$arr = array();
foreach($zrows as $k=>$rs1){
$arr['sitemid_'.$rs1['itemid'].''] = $rs1['pitem'];
}
return $arr;
}*/
private function addotherfield()
{
$frs = $this->fieldsarra[0];
$sid = $this->rs['leixing'];
$zrows = m($this->subtable)->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs1){
$frs['name'] = $rs1['pitem'];
$frs['fieldstype'] = $rs1['zxren'];
$frs['islu'] = '1';
$frs['fields'] = 'sitemid_'.$rs1['id'];
$this->fieldsarra[] = $frs;
$this->fieldsarr[] = $frs;
}
}
public function flowrsreplace($rs, $lx=0)
{
if($lx==1 || $lx==3){
$rs = $this->flowrsreplaceedit($rs);
}
return $rs;
}
protected function flowzuofeibill($sm)
{
//$this->update('`leixing`=`leixing`-1', $this->rs['leixing']);
$this->updaterenshu($this->rs['leixing']);
m($this->subtable)->delete('`mid`='.$this->id.'');
}
public function flowxiangfields(&$fields)
{
$fields['base_name'] = '填写人';
$fields['base_deptname'] = '填写人部门';
return $fields;
}
protected function flowbillwhere($uid, $lx)
{
$where = '';
$leixingid = (int)$this->rock->post('leixingid');
if($leixingid>0)$where='and `leixing`='.$leixingid.'';
return array(
'keywhere' => $where,
);
}
}

View File

@@ -11,6 +11,7 @@ class flow_custractClassModel extends flowModel
$this->goodmobj = m('goodm');
$this->wherejoin['custfina'] = 'htid';
$this->wherejoin['custfinb'] = 'htid';
}
//作废或删除时

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
<?php
//健康报备
class flow_yqhealthyClassModel extends flowModel
{
public function flowrsreplace($rs, $lx=0)
{
$rs['stateval']=$rs['state'];
if($rs['state']=='0')$rs['state']='<font color="green">绿码</font>';
if($rs['state']=='1')$rs['state']='<font color="#ff6600">黄码</font>';
if($rs['state']=='2')$rs['state']='<font color="red">红码</font>';
return $rs;
}
}

View File

@@ -7,7 +7,9 @@ class modeClassModel extends Model
}
public function getmodearr($whe='')
{
$arr = $this->getall('status=1 '.$whe.'','`id`,`num`,`name`,`table`,`type`,`isflow`','sort');
$where = 'status=1 '.$whe.'';
if($whe=='all')$where='1=1';
$arr = $this->getall($where,'`id`,`num`,`name`,`table`,`type`,`isflow`,`status`','sort');
$typea = array();
foreach($arr as $k=>$rs){
$arr[$k]['name'] = ''.$rs['id'].'.'.$rs['name'].'('.$rs['num'].')';
@@ -240,4 +242,109 @@ $rstr = "".$hstart."
{
}
public function menulist()
{
$arr['schedule'] = '45';
$arr['hrsalary'] = '184,98,277,276,99,278,102';
$arr['knowtraim'] = '202,199,200,201';
$arr['hrcheck'] = '274,272,273,244,275';
$arr['emailm'] = '157';
$arr['meet'] = '89,150,151,283';
$arr['kqdkjl'] = '59,92,33,58,60,234,86,88,169,170'; //打卡记录
$arr['waichu'] = '160,159'; //打卡记录
$arr['kaoqin'] = '32,61,53,54,197,55,56,152,153,240,241,243,242,36,87,260,57';
$arr['kqdw'] = '93,94';
$arr['jiaban'] = '217';
$arr['daily'] = '76,77,195,78,198,231,192,193,194,196';
$arr['project'] = '79,69,70,72,71,82';
$arr['work'] = '66,65,67,83,68,80,81';
$arr['word'] = '124,125,203';
$arr['wordxie'] = '281';
$arr['wordeil'] = '282';
$arr['knowledge'] = '134,158';
$arr['knowtiku'] = '135,136';
$arr['news'] = '288';
$arr['wenjuan'] = '321';
$arr['wupin'] = '28,247,248,30,249,253,31,251,250,319,261,323,252';
$arr['assetm'] = '137,411,412,413';
$arr['repair'] = '413';
$arr['cheliang'] = '138,143,214,144,146,215,216';
$arr['book'] = '139,141,145';
$arr['seal'] = '165,166,167';
$arr['dangan'] = '336,337,338';
$arr['gongwen'] = '204,239,289,290,232,256,258,291,292,293,306,205,257,259,294,255,233,206,304,305';
$arr['crm'] = '63,37,64,73,104,105,114,118,126,179,262,299,131,132,75,112,113,123,263,317,110,111,108,109,106,119,115,116,117,107,120,121,122,175,176,177,178,264,302,318,300,301,386,387';
$arr['userinfo'] = '85,101,149';
$arr['userract'] = '95';
$arr['userzheng'] = '339';
$arr['hrdemand'] = '265';
$arr['hrmanshi'] = '266';
$arr['hrpositive'] = '96';
$arr['hrredund'] = '97';
$arr['hrtransfer'] = '128';
$arr['hrtrsalary'] = '129';
$arr['reward'] = '130';
$arr['finjishou'] = '311,312,316,369';
$arr['finzhang'] = '308';
$arr['finkemu'] = '309';
$arr['finount'] = '310';
$arr['finfybx'] = '187,191';
$arr['finccbx'] = '188';
$arr['finjkd'] = '189,218';
$arr['finhkd'] = '190';
$arr['finpay'] = '229';
$arr['finkai'] = '230';
$arr['finpiao'] = '279,280';
$arr['finyisu'] = '325,326,329,327,328';
$arr['finbei'] = '330,331,335,333,332,334';
$arr['wxgzh'] = '180,181,284,285,366';
$arr['weixinqy'] = '171,172,155,173,174,370';
$arr['ding'] = '208,209,210,211,212';
$arr['gongcheng'] = '345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,373,374,375,376,377,378,379,380,381,382,383,384,385';
$arr['officidu'] = '361,362,363,364,365';
$arr['gong'] = '90,287';
$arr['jxcbase'] = '388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,417,418';
$arr['planm'] = '410,407,408,409';
$arr['collectm'] = '414,415,416';
$arr['eduxueqi'] = '419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435';
$arr['yqhealthy'] = '436,437';
return $arr;
}
public function yinglist()
{
$arr['kaoqin'] = '29,45,28,30,24,58';
$arr['work'] = '12';
$arr['project'] = '44';
$arr['gongwen'] = '41,42,43';
$arr['emailm'] = '26';
$arr['schedule'] = '21';
$arr['daily'] = '7';
$arr['meet'] = '4';
$arr['hrsalary'] = '38';
$arr['news'] = '52';
$arr['word'] = '20';
$arr['wordxie'] = '50';
$arr['knowledge'] = '27';
$arr['knowtiku'] = '32';
$arr['knowtraim'] = '33';
$arr['crm'] = '18,17,56,19,34,35,36';
$arr['bianjian'] = '59';
$arr['gong'] = '3';
return $arr;
}
}