';
- }
- s+=''+csd.name+' ';
- types = csd.type;
- }
- $('#mode_{rand}').html(s);
- }
- bools=true;
}
});
function btn(bo, d){
@@ -76,14 +60,17 @@ $(document).ready(function(){
guanflowviewlist = a;
addtabs({num:'flowview'+id+'',url:'main,view,edit,id='+id+',mid='+mid+'',icons:icon,name:name});
},
- changemode:function(){
- var v=this.value;
+ changemodes:function(v){
mid=v;
a.search('and modeid='+v+'');
+ },
+ xuanmode:function(o1){
+ js.selectmode(o1, get('modes_{rand}'), function(sna,val,d){
+ c.changemodes(val);
+ });
}
};
js.initbtn(c);
- $('#mode_{rand}').change(c.changemode);
});
@@ -94,7 +81,10 @@ $(document).ready(function(){
鏂板
- -閫夋嫨妯″潡-
+
+
+ v
+
diff --git a/webmain/main/view/viewAction.php b/webmain/main/view/viewAction.php
index e3bbb7a..84cafad 100644
--- a/webmain/main/view/viewAction.php
+++ b/webmain/main/view/viewAction.php
@@ -19,7 +19,7 @@ class viewClassAction extends Action
}
return array(
'rows'=>$rows,
- 'modearr' => m('mode')->getmodearr(),
+ //'modearr' => m('mode')->getmodearr(),
);
}
diff --git a/webmain/main/xinhu/rock_xinhu_cog.php b/webmain/main/xinhu/rock_xinhu_cog.php
index 33050c6..60f9fb4 100644
--- a/webmain/main/xinhu/rock_xinhu_cog.php
+++ b/webmain/main/xinhu/rock_xinhu_cog.php
@@ -95,6 +95,37 @@ $(document).ready(function(){
js.ajax(js.getajaxurl('tongbudw','{mode}','{dir}'),false, function(ret){
js.msgok(ret);
},'get');
+ },
+ onlinev:function(){
+ var url = get('push_{rand}').value;
+ if(!url){js.msgerror('娌¢厤缃湇鍔$');return;}
+ js.loading('鍔犺浇涓...');
+ js.ajax(js.getajaxurl('getonline','{mode}','{dir}'),false, function(ret){
+ if(ret.success){
+ js.unloading();
+ c.onlinevs(ret.data);
+ }else{
+ js.msgerror(ret.msg);
+ js.tanclose('online');
+ }
+ },'get,json');
+ },
+ onlinevs:function(da){
+ var s = '',i,j,d;
+ for(i=0;i';
+ s+=' ';
+ s+=' '+d.name+'';
+ if(d.pconline)s+=' ';
+ if(d.apponline)s+=' ';
+ s+='
';
+ s+='';
+ }
+ js.tanbody('online','鏈嶅姟绔湪绾夸汉鍛', 450, 300, {
+ html:''+s+'
'
+ });
+ $('#msgview_online').html(da.msg);
}
};
@@ -115,7 +146,8 @@ $(document).ready(function(){
蹇熻缃(鎺ㄨ崘)
- 鑷畾涔夎缃
+ 鑷畾涔夎缃
+ 鍦ㄧ嚎浜哄憳
@@ -147,7 +179,7 @@ $(document).ready(function(){
- 涓嶇煡閬撳湴鍧锛熻鍏堝畨瑁呭苟杩愯鏈嶅姟绔紝 [鍘讳笅杞藉畨瑁咃紝鐪嬪府鍔
+ 涓嶇煡閬撳湴鍧锛熻鍏堝畨瑁呭苟杩愯鏈嶅姟绔紝閰嶇疆wss璇风湅甯姪锛 [鍘讳笅杞藉畨瑁咃紝鐪嬪府鍔
diff --git a/webmain/main/xinhu/xinhuAction.php b/webmain/main/xinhu/xinhuAction.php
index 1dc3289..ba3eaa7 100644
--- a/webmain/main/xinhu/xinhuAction.php
+++ b/webmain/main/xinhu/xinhuAction.php
@@ -27,6 +27,7 @@ class xinhuClassAction extends Action
foreach($rows as $k=>$rs){
$base = ''.DB_BASE.'_company_'.$rs['num'].'';
$this->sevessee($base, 'reimhostsystem');
+ $this->sevessee($base, 'reimpushurlsystem');
$this->sevessee($base, 'reimrecidsystem', $rs['num']);
$this->sevessee($base, 'reimchehuisystem');
$this->sevessee($base, 'reimservertype');
@@ -38,7 +39,14 @@ class xinhuClassAction extends Action
{
$val = $this->option->getval($key);
if($key=='reimrecidsystem')$val.='_'.$bh.'';
- $sql = "update ".$base.".`[Q]option` set `value`='$val',`optdt`='{$this->now}' where `num`='$key'";
+ $table = "".$base.".`[Q]option`";
+ $where = "`num`='$key'";
+ $ors = $this->db->getone($table, $where);
+ if($ors){
+ $sql = "update $table set `value`='$val',`optdt`='{$this->now}' where $where";
+ }else{
+ $sql = "insert into $table set `value`='$val',`optdt`='{$this->now}',`num`='$key'";
+ }
$this->db->query($sql, false);
}
@@ -141,4 +149,37 @@ class xinhuClassAction extends Action
));
return $barr;
}
+
+ public function getonlineAjax()
+ {
+
+ $barr = m('reim')->pushserver('getonline');
+ if(!$barr['success'])return $barr;
+ $data = $barr['data'];
+ if(!$data)return returnerror('鏃犱汉鍛樺湪绾');
+ $ondats = json_decode($data, true);
+ $pc = $ondats['pc'];
+ $app = $ondats['app'];
+ $uar1= explode(',', $pc);
+ $uar2= explode(',', $app);
+ $str = $pc;
+ $on1 = count($uar1);
+ $on2 = count($uar2);
+ if($app){
+ if($str)$str.=',';
+ $str.=$app;
+ }
+ if(!$str)return returnerror('鏃犱汉鍛樺湪绾');
+ if(!$app)$on2 = 0;
+ if(!$pc)$on1 = 0;
+ $rows = m('admin')->getall('id in('.$str.') and `status`=1','id,name,face','sort asc');
+ foreach($rows as $k=>$rs){
+ $rows[$k]['pconline'] = in_array($rs['id'], $uar1);
+ $rows[$k]['apponline'] = in_array($rs['id'], $uar2);
+ }
+ return returnsuccess(array(
+ 'rows' => $rows,
+ 'msg' => 'PC鍦ㄧ嚎'.$on1.'浜猴紝APP鍦ㄧ嚎'.$on2.'浜',
+ ));
+ }
}
\ No newline at end of file
diff --git a/webmain/main/yingyong/rock_yingyong.php b/webmain/main/yingyong/rock_yingyong.php
index b12c553..b26b5c1 100644
--- a/webmain/main/yingyong/rock_yingyong.php
+++ b/webmain/main/yingyong/rock_yingyong.php
@@ -15,8 +15,6 @@ $(document).ready(function(){
}
},{
text:'鍒嗙被',dataIndex:'types',editor:true,sortable:true
- },{
- text:'鍥炬爣棰滆壊',dataIndex:'iconcolor',editor:true
},{
text:'缂栧彿',dataIndex:'num'
},{
diff --git a/webmain/model/adminModel.php b/webmain/model/adminModel.php
index 2329401..e4e0ebd 100644
--- a/webmain/model/adminModel.php
+++ b/webmain/model/adminModel.php
@@ -112,10 +112,12 @@ class adminClassModel extends Model
$tj[] = $this->rock->dbinstr($fids, 'all');
$tj[] = $this->rock->dbinstr($fids, 'u'.$uid);
if($us){
- $dep = explode(',', $us['deptpath']);
- foreach($dep as $deps){
- $_deps = str_replace(array('[',']'), array('',''), $deps);
- $tj[] = $this->rock->dbinstr($fids, 'd'.$_deps);
+ if(!isempt($us['deptpath'])){
+ $dep = explode(',', $us['deptpath']);
+ foreach($dep as $deps){
+ $_deps = str_replace(array('[',']'), array('',''), $deps);
+ $tj[] = $this->rock->dbinstr($fids, 'd'.$_deps);
+ }
}
//鎵鍦ㄧ粍Id
$gids = m('sjoin')->getgroupid($uid);
diff --git a/webmain/model/beifenModel.php b/webmain/model/beifenModel.php
index 7cd44a0..685cfe6 100644
--- a/webmain/model/beifenModel.php
+++ b/webmain/model/beifenModel.php
@@ -91,18 +91,21 @@ class beifenClassModel extends Model
foreach($fields as $k=>$frs){
$fname = $frs['name'];
if($fname=='id')continue;
- $nstr = $this->getfielstr($frs);
+ $nstr = $this->getfielstr($frs);
+ $frs['explain'] = '';
+ $nstr1 = $this->getfielstr($frs);
if(!isset($nowfiel[$fname])){
$str.=',add '.$nstr.'';
}else{
$ofrs = $nowfiel[$fname]; //绯荤粺涓婂瓧娈电被鍨
- $ostr = $this->getfielstr($ofrs);
+ //$ostr = $this->getfielstr($ofrs);
+ $ofrs['explain'] = '';
+ $ostr1 = $this->getfielstr($ofrs);
$lxarr= array('text','mediumtext','bigint');
-
//濡傛灉鑷繁瀛楁闀垮害澶т簬瀹樼綉灏变笉鏇存柊
if($frs['type']==$ofrs['type'] && !isempt($ofrs['lens']) && $ofrs['lens']>$frs['lens']){
- }else if($nstr != $ostr && !in_array($ofrs['type'], $lxarr) ){
+ }else if($nstr1 != $ostr1 && !in_array($ofrs['type'], $lxarr) ){
$str.=',MODIFY '.$nstr.'';
}
}
diff --git a/webmain/model/crmModel.php b/webmain/model/crmModel.php
index cbe304a..3893e7f 100644
--- a/webmain/model/crmModel.php
+++ b/webmain/model/crmModel.php
@@ -31,7 +31,7 @@ class crmClassModel extends Model
}
//璇诲彇鎵鏈夊鎴
- public function custdata()
+ public function custdata($whe='')
{
$limit = (int)$this->rock->get('limit', '10');
$page = (int)$this->rock->get('page', '1');
@@ -41,6 +41,10 @@ class crmClassModel extends Model
$key= $this->rock->jm->base64decode($key);
$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
}
+ if($whe){
+ $whe = str_replace('{uid}', $this->adminid, $whe);
+ $where .= " AND $whe";
+ }
$rows = $this->getrows("`status`=1 ".$where."",'SQL_CALC_FOUND_ROWS id as value,name,id,unitname as subname','`optdt` desc',''.(($page-1)*$limit).','.$limit.'');
$totalCount = $this->db->found_rows();
return array(
diff --git a/webmain/model/fileModel.php b/webmain/model/fileModel.php
index 1d75839..01493eb 100644
--- a/webmain/model/fileModel.php
+++ b/webmain/model/fileModel.php
@@ -120,12 +120,11 @@ class fileClassModel extends Model
if(!file_exists($thumbpath))$thumbpath='';
}
- if(isempt($thumbpath))$thumbpath = arrvalue($rs, 'thumbplat');
- if(!isempt($thumbpath)){
- $thumbpath = str_replace('{FILEURL}', getconfig('rockfile_url'), $thumbpath);
- $thumbpath = $this->rock->gethttppath($thumbpath);
+ $thumbplat = arrvalue($rs, 'thumbplat');
+ if(!isempt($thumbplat)){
+ $thumbpath = str_replace('{FILEURL}', getconfig('rockfile_url'), $thumbplat);
}
- return $thumbpath;
+ return $this->rock->gethttppath($thumbpath);
}
@@ -339,7 +338,10 @@ class fileClassModel extends Model
header('location:'.$filepath.'');
return;
}
-
+ if($this->rock->get('openfrom')=='iosapp'){
+ header('location:'.$filepath.'');
+ return;
+ }
if($filesize > 10*1024*1024 && 1==1 && $fileext!='pdf'){
header('location:'.$filepath.'');
}else{
diff --git a/webmain/model/flow/carmreseModel.php b/webmain/model/flow/carmreseModel.php
index fd05ef4..aa4f04a 100644
--- a/webmain/model/flow/carmreseModel.php
+++ b/webmain/model/flow/carmreseModel.php
@@ -37,7 +37,7 @@ class flow_carmreseClassModel extends flowModel
$db = m('carmrese');
//璇诲彇杞﹁締鏈鍚庡叕閲屾暟
foreach($rows as $k=>$rs){
- $onrs = $db->getone("`status`=1 and `carid`=".$rs['value']." and ifnull(`kmend`,'')<>''", '`kmend`,`kmstart`','`kmend` desc');
+ $onrs = $db->getone("`status`=1 and `carid`=".$rs['value']." and ifnull(`kmend`,0)<>0", '`kmend`,`kmstart`','`kmend` desc');
$km = '';
if($onrs){
$km = $onrs['kmend'];
diff --git a/webmain/model/flow/flow.php b/webmain/model/flow/flow.php
index d1e1b2e..cd712f9 100644
--- a/webmain/model/flow/flow.php
+++ b/webmain/model/flow/flow.php
@@ -5,11 +5,11 @@
* 缃戝潃锛歨ttp://www.rockoa.com/
* 绯荤粺鏂囦欢
*/
- class flowModel extends Model { public $modenum; public $editcont= ''; public $id = 0; public $moders; public $modeid; public $modename; public $sericnum; public $billrs = array(); public $rs = array(); public $urs = array(); public $drs = array(); public $fieldsarr = array(); public $fieldsarra = array(); public $mwhere; public $mtable; public $uname; public $uid = 0; public $optid = 0; public $isflow = 0; public $ismobile= 0; public $minwidth= 100; public $inputwidth= 0; public $atype = ''; public $daochubo= false; public $companyid= 1; protected function flowinit(){} protected function flowchangedata(){} protected function flowchangetodo(){} protected function flowdeletebill($sm){} protected function flowzuofeibill($sm){} protected function flowsubmit($na, $sm){} protected function flowaddlog($arr){} protected function flowdatalog($arr){} protected function flowcheckbefore(){} protected function flowcheckafter($zt, $sm){} protected function flowcheckfinsh($zt){} protected function flowgetfields($lx){} protected function flowgetoptmenu($opt){} protected function flowcheckname($num){} protected function flowcoursejudge($num){} protected function flowoptmenu($ors, $crs){} protected function flowisreadqx(){return false;} protected function flowisdeleteqx(){return false;} protected function flowprintrows($r){return $r;} protected function flowsubdata($r, $lx=0){return $r;} protected function flownexttodo($type){return false;} protected function flowbillwhere($lx, $uid){return '';} protected $flowweixinarr = array(); protected $flowviewufieds = 'uid'; protected $flowcompanyidfieds = 'comid'; protected $flowfieldstype = 0; public function flowrsreplace($rs){return $rs;} public function flowrsreplace_we($row, $rs){return $row;} public function flowwesearchdata($lx){return array();} protected function flowrsreplaceedit($rs){return $rs;} protected $flowstatusarr = array(1); protected $subsubdatastyle = ''; protected $wherejoin = array(); public $defaultorder = ''; public $floweditother = false; public $xiangbordercolor = ''; public $viewmodel,$chaomodel,$billmodel,$todomodel,$todosmodel,$flogmodel,$checksmodel,$cnamemodel,$wheremodel,$adminmodel,$remindmodel,$option,$rssust,$flowarr,$nowcourse,$nextcourse,$flowisend,$pipeiCoursearrc,$pipeiCoursearrs,$pipeiCoursearr,$_tempauoe,$checkiszhuanyi,$checkistui,$lastlogid; public function echomsg($msg) { if(!isajax())exit($msg); showreturn('', $msg, 201); exit(); } public function flowfieldarr($farr, $lx){return $farr;} public function flowinputtpl($cont, $lx){return $cont;} public function flowviewtpl($cont, $lx){return $cont;} public function floweditoffice($frs, $ofrs){} public function initdata($num, $id=null) { $this->initbase($num); $this->viewmodel = m('view'); $this->chaomodel = m('flow_chao'); $this->billmodel = m('flow_bill'); $this->todomodel = m('flow_todo'); $this->todosmodel = m('flowtodo'); $this->flogmodel = m('flow_log'); $this->checksmodel = m('flow_checks'); $this->cnamemodel = m('flowcname'); $this->wheremodel = m('where'); $this->adminmodel = m('admin'); $this->remindmodel = m('remind'); $this->option = m('option'); $this->companyid = $this->adminmodel->getcompanyid(); $this->tfieldsarra(); $this->mwhere = "`table`='$this->mtable' and `mid`=-1"; if(!$this->defaultorder){ $sortdir = arrvalue($this->moders, 'sortdir'); if(!isempt($sortdir))$this->defaultorder = str_replace(' ',',', $sortdir); } $this->flowinit(); if($id==null)return $this; $this->loaddata($id, true); return $this; } public function initbase($num) { if(is_array($num)){ $this->moders= $num; }else{ $this->moders = m('flow_set')->getone(is_numeric($num) ? $num : "`num`='$num'"); if(!$this->moders)$this->echomsg('妯″潡['.$num.']涓嶅瓨鍦紝璇峰埌[娴佺▼妯″潡鍒楄〃]涓嬫坊鍔'); } $this->daochubo = ($this->rock->post('execldown')=='true') ? true :false; $table = $this->moders['table']; $this->modeid = $this->moders['id']; $this->modenum = $this->moders['num']; $this->moders['name'] = $this->lang($this->moders['name']); $this->modename = $this->moders['name']; $this->isflow = (int)$this->moders['isflow']; $this->settable($table); $this->mtable = $table; return $this; } private function tfieldsarra() { $rows = m('flow_element')->getrows("`mid`='$this->modeid' and `iszb`=0",'`name`,`fields`,`isbt`,`iszs`,`fieldstype`,`savewhere`,`data`,`isdr`,`iszb`,`issou`,`islu`,`islb`,`isonly`,`attr`','`sort`'); $this->fieldsarr = array(); if($rows)foreach($rows as $k=>$rs){ if($rs['islu']==1)$this->fieldsarr[] = $rs; } $this->fieldsarra = $rows; } public function inputtitle() { return $this->moders['name']; } public function flowsearchfields() { $arr = array(); if($this->isflow>0){ $arr[] = array('name'=>''.lang('鐢宠浜').'...','fields'=>'uid'); $arr[] = array('name'=>''.lang('鎻愪氦浜').'...','fields'=>'optid'); } return $arr; } public function loaddata($id, $ispd=true) { $this->id = (int)$id; $this->mwhere = "`table`='$this->mtable' and `mid`='$id'"; $swhere = "`id`='$id'"; $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $swhere .= ' and '.$wherestr; } $this->rs = $this->getone($swhere); $this->uname = ''; if(!$this->rs)$this->echomsg('鏁版嵁璁板綍涓嶅瓨鍦ㄤ簡'); $this->rs['base_name'] = ''; $this->rs['base_deptname'] = ''; if(isset($this->rs['uid']))$this->uid = $this->rs['uid']; if(isset($this->rs['comid']))$this->companyid = $this->rs['comid']; if(!isset($this->rs['applydt']))$this->rs['applydt'] = ''; if(!isset($this->rs['status']))$this->rs['status'] = 1; $uisfield = property_exists($this, 'uidfields') ? $this->uidfields : 'optid'; if($this->uid==0 && isset($this->rs[$uisfield]))$this->uid = $this->rs[$uisfield]; $this->optid = isset($this->rs['optid']) ? $this->rs['optid'] : $this->uid; $this->urs = $this->adminmodel->getone($this->uid,'id,name,user,deptid,deptids,deptname,deptallname,face,ranking,superid,superpath,superman,deptpath'); if($this->isempt($this->rs['applydt'])&&isset($this->rs['optdt']))$this->rs['applydt']=substr($this->rs['optdt'],0,10); if($this->urs){ $this->drs = $this->db->getone('[Q]dept',"`id`='".$this->urs['deptid']."'"); $this->uname = $this->urs['name']; $this->rs['base_name'] = $this->uname; if($this->drs){ $this->rs['base_deptname'] = $this->drs['name']; } } $this->sericnum = ''; $this->billrs = $this->billmodel->getone($this->mwhere); if($this->billrs){ $this->sericnum = $this->billrs['sericnum']; if(isempt(arrvalue($this->billrs,'uname'))){ $this->savebill(); } if($this->billrs['status']!=$this->rs['status'])$this->billmodel->update('`status`='.$this->rs['status'].'', $this->billrs['id']); if($this->billrs['isturn']!=$this->rs['isturn'])$this->billmodel->update('`isturn`='.$this->rs['isturn'].'', $this->billrs['id']); if(isempt($this->rs['base_name']))$this->rs['base_name'] = $this->billrs['uname']; if(isempt($this->rs['base_deptname']))$this->rs['base_deptname'] = $this->billrs['udeptname']; }else{ if($this->isflow>0)$this->savebill(); } if($this->isflow>0){ if($this->rs['status']==1 && $this->rs['isturn']=='0'){ $this->update(array('isturn' => 1), $this->id); $this->rs['isturn'] = 1; if($this->billrs)$this->billmodel->update('`isturn`=1', $this->billrs['id']); } } $this->getlogrows = array(); if($ispd)$this->isreadqx(); $this->rssust = $this->rs; $this->flowchangedata(); $this->rs['base_systitle'] = TITLE; $this->rs['base_modename'] = $this->modename; $this->rs['base_sericnum'] = $this->sericnum; $this->rs['base_summary'] = $this->getsummary(); } public function getdaiban() { $s = $this->rock->dbinstr('nowcheckid', $this->adminid); $to = $this->billmodel->rows('`modeid`='.$this->modeid.' and `isdel`=0 and `status` not in(1,2) and '.$s.''); return $to; } public function isreadqx($glx=0) { $bo = false; if($this->adminid==1)$bo=true; if($this->uid==$this->adminid && $this->adminid>0)$bo=true; if(!$bo && $this->isflow>0){ if($this->billrs){ $allcheckid = $this->billrs['allcheckid']; if(contain(','.$allcheckid.',',','.$this->adminid.','))$bo = true; } } if(!$bo){ if($this->urs && contain($this->urs['superpath'],'['.$this->adminid.']'))$bo = true; } if(!$bo){ $tos = $this->todosmodel->rows("".$this->mwhere." and `uid`='$this->adminid'"); if($tos>0)$bo=true; } if(!$bo){ $tos = $this->chaomodel->rows($this->mwhere.' and '.$this->rock->dbinstr('csnameid', $this->adminid).''); if($tos>0)$bo=true; } if(!$bo){ $tos = $this->db->rows('[Q]todo', "`uid`='$this->adminid' and ".$this->mwhere.""); if($tos>0)$bo=true; } if(!$bo)$bo = $this->flowisreadqx(); if(!$bo){ $bo = $this->isreadqxs(); } if(!$bo){ $tos = $this->isjiankongqx(); if($tos>0)$bo=true; } if($glx==1)return $bo; if(!$bo)$this->echomsg('鏃犳潈闄愭煡鐪嬫ā鍧梉'.$this->modenum.'.'.$this->modename.']'.$this->uname.'鐨勬暟鎹紝璇疯仈绯荤鐞嗗憳鍒癧娴佺▼妯″潡鈫掓祦绋嬫ā鍧楁潈闄怾涓嬭缃'); } public function isreadqxs() { $bo = false; $where = $this->viewmodel->viewwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=true; return $bo; } public function iseditqx() { $bo = 0; if($bo==0 && $this->isflow>0){ if($this->billrs && ($this->uid == $this->adminid || $this->optid==$this->adminid)){ if($this->billrs['nstatus']==0 || $this->billrs['nstatus']==2){ $bo = 1; } } if($this->rs['status']==1)$bo=0; } if($bo==0){ $where = $this->viewmodel->editwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } return $bo; } public function isdeleteqx() { $bo = 0; if($bo==0 && $this->isflow>0){ if($this->billrs && ($this->uid == $this->adminid || $this->optid==$this->adminid)){ if($this->billrs['nstatus']==0 || $this->billrs['nstatus']==2){ $bo = 1; } } if($this->rs['status']==1)$bo=0; } if($bo==0){ $where = $this->viewmodel->deletewhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } $isd = $this->flowisdeleteqx(); if(is_numeric($isd) && $isd <= 1)$bo = $isd; return $bo; } public function isjiankongqx() { $bo = 0; if($bo==0){ $where = $this->viewmodel->jiankongwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } return $bo; } public function getfields($lx=0) { $fields = array(); if(!$this->fieldsarra)$this->tfieldsarra(); $farr = $this->fieldsarra; foreach($farr as $k=>$rs)if($rs['iszs']=='1')$fields[$rs['fields']] = $rs['name']; $fters = $this->flowgetfields($lx); if(is_array($fters))$fields = array_merge($fields, $fters); return $fields; } public function getinputurl($num='',$mid=0,$can=array()) { if($num=='')$num = $this->modenum; $xa = 'lu'; if($this->ismobile==1)$xa = 'lum'; $url = 'index.php?a='.$xa.'&m=input&d=flow&num='.$num.'&mid='.$mid.''; if(is_array($can)){ foreach($can as $k=>$v)$url.='&'.$k.'='.$v.''; }else{ $url .= '&'.$can.''; } return $url; } public function replacepbr(&$arr, $k) { $val = arrvalue($arr, $k); if(!c('html')->ishtml($val))$arr[$k] = str_replace("\n",' ', $val); return $arr; } public function getdatalog($lx=0, $isdy=0) { m('log')->addread($this->mtable, $this->id); $this->todosmodel->biaoyidu($this->adminid, $this->modenum, $this->id); $fobj = m('file'); $this->ismobile = $lx; $arr['modename'] = $this->modename; $arr['title'] = $this->modename; $arr['modeid'] = $this->modeid; $arr['modenum'] = $this->modenum; $arr['mid'] = $this->id; $arr['status'] = arrvalue($this->rs,'status'); $arr['logarr'] = $this->getlog(1); $arr['isplview'] = arrvalue($this->moders,'ispl','0'); $arr['isys'] = arrvalue($this->moders,'isys','0'); $contview = ''; $lsds = ($isdy==2) ? $isdy: $lx; $path = ''.P.'/flow/page/view_'.$this->modenum.'_'.$lsds.'.html'; if(COMPANYNUM){ $path1 = ''.P.'/flow/page/view_'.$this->modenum.'_'.COMPANYNUM.'_'.$lsds.'.html'; if(file_exists($path1))$path = $path1; } $fstr = $fobj->getstr($this->mtable, $this->id, 3); $issubtabs = 0; if($fstr != ''){ $this->rs['file_content'] = $fstr; } $subdata = $this->getsuballdata(1); $this->rs['subdatarows'] = $subdata; $data = $this->flowrsreplace($this->rs, ($isdy==2) ? 3 : 1); $dataa = $this->viewjinfields(array($data)); $data = $dataa[0]; if($subdata){ $zbzd = m('flow_element')->getrows("`mid`='$this->modeid' and `iszb`>0 and `iszs`=1 and `fieldstype` in('uploadimg','uploadfile','textarea')",'`name`,`fields`,`fieldstype`,`iszb`','`iszb`,`sort`'); foreach($subdata as $zb=>$da){ $sub = $da['fields']; $data[$sub] = $this->getsubdata($zb,$da['data'],arrvalue($data,'subdatays'.$zb.'',$lx)); $data[''.$sub.'_style'] = 'padding:0'; } } $farrobj = $chufarr= array(); if(method_exists($this, 'flowxiangfields'))$chufarr = $this->flowxiangfields($chufarr); $farrobj['base_sericnum'] = array('name'=>arrvalue($chufarr,'base_sericnum','鍗曞彿')); $farrobj['base_name'] = array('name'=>arrvalue($chufarr,'base_name','鐢宠浜')); $farrobj['base_deptname'] = array('name'=>arrvalue($chufarr,'base_deptname','鐢宠浜洪儴闂')); $farrobj['base_status'] = array('name'=>arrvalue($chufarr,'base_status','娴佺▼鐘舵')); $farrobj['file_content'] = array('name'=>arrvalue($chufarr,'file_content','鐩稿叧鏂囦欢')); foreach($this->fieldsarra as $k=>$rs){ $fid = $rs['fields']; $fty = $rs['fieldstype']; if($fty=='uploadfile'){ $fval = arrvalue($data, $fid); if(isempt($fval))$fval='0'; $data[$fid] = ''; if($fval!='0'){ $data[$fid] = $fobj->getstr('', '', 3, "`id` in($fval)"); } } if($fty=='uploadimg' || $fty=='graph'){ $fval = arrvalue($data, $fid); if(!isempt($fval) && substr($fval,0,4)!=' rock->gethttppath($fval); $fwei = ($fty=='graph') ? 50 : 100; $data[$fid] = ' '; } } if($fty=='textarea'){ $this->replacepbr($data, $fid); } if($fty=='ditumap' && !isempt($rs['data'])){ $wzhi = arrvalue($data, $rs['data']); if(!isempt($wzhi))$data[$fid].='[鏌ョ湅鍦板浘] '; } $farrobj[$fid] = $rs; } $_logarr = $qfields = array(); foreach($arr['logarr'] as $k1=>$rs1)$_logarr[$rs1['id']] = $rs1; $logrows = $this->flogmodel->getrows($this->mwhere.' and `modeid`='.$this->modeid.' and `courseid`>0 and `status`>0 and `valid`=1','*','id desc'); $togdar = array(); foreach($logrows as $k2=>$rs2){ $sie1 = $rs2['courseid'].'_'.$rs2['checkid']; if(isset($togdar[$sie1])){ $logrows[$k2]['show'] = false; }else{ $togdar[$sie1] = true; $logrows[$k2]['show'] = true; } } foreach($logrows as $k2=>$rs2){ if(!$rs2['show'])continue; $rs3 = $_logarr[$rs2['id']]; $_coid = $rs2['courseid']; if(!isempt($rs3['qmimg']))$rs3['name'] = ' '; $key1 = 'course'.$_coid.''; if(!isset($data[''.$key1.'_name'])){ $data[''.$key1.'_name'] = $rs3['name']; $data[''.$key1.'_zt'] = ''.$rs3['statusname'].' '; $data[''.$key1.'_sm'] = $rs3['sm']; $data[''.$key1.'_dt'] = $rs3['checkdt']; }else{ $data[''.$key1.'_name'] .= ','.$rs3['name']; $data[''.$key1.'_sm'] .= ','.$rs3['sm']; $data[''.$key1.'_dt'] = $rs3['checkdt']; } $key2 = ''.$key1.'_all'; if(!isset($data[$key2])){ $qfields[$key2] = $rs2['name']; $data[$key2]=''; } $str1 = $rs3['name'].' '.$rs3['statusname'].' '.$rs3['checkdt'].''; if(!isempt($rs3['sm']))$str1.='锛'.$rs3['sm'].''; if($data[$key2]!='')$data[$key2].=' '; $data[$key2].= $str1; } $ztass = $this->getnowstatus(); $data['base_status'] = $ztass[3]; if(file_exists($path)){ $contview = $this->flowviewtpl(file_get_contents($path), $lx); preg_match_all('/\^(.*?)\^/', $contview, $list); foreach($list[1] as $k=>$nrs){ $fzdrs = arrvalue($farrobj, $nrs); if($fzdrs)$contview = str_replace('^'.$nrs.'^', $fzdrs['name'], $contview); } $contview = $this->rock->reparr($contview, $data); } $arr['isdefaultview'] = 0; foreach($chufarr as $f1=>$v1)$qfields[$f1] = $v1; if($this->isempt($contview) || contain($contview, '$contview$')){ $arr['isdefaultview'] = 1; $_fields = array(); if($this->isflow>0){ $_fields['base_sericnum'] = $farrobj['base_sericnum']['name']; $_fields['base_name'] = $farrobj['base_name']['name']; $_fields['base_deptname'] = $farrobj['base_deptname']['name']; $_fields['base_status'] = $farrobj['base_status']['name']; } $fields = array_merge($_fields, $this->getfields($lx)); if($fstr!='')$fields['file_content'] = $farrobj['file_content']['name']; foreach($subdata as $zb=>$da){ $fields[$da['fields']] = $da['name']; } if($qfields)$fields = array_merge($fields,$qfields); if($lx==0)foreach($fields as $k=>$rs){$data[''.$k.'_style'] = 'width:75%';break;} $_colsr = $this->xiangbordercolor; if($_colsr=='')$_colsr = getconfig('bcolorxiang'); $contvimr = c('html')->xiangtable($fields, $data, $_colsr); $contvimr = ''.$contvimr.'
'; if($lx==1){ $contvimr = ''; if($this->isflow>0 && $this->urs){ $contvimr.='
+ class flowModel extends Model { public $modenum; public $editcont= ''; public $id = 0; public $moders; public $modeid; public $modename; public $sericnum; public $billrs = array(); public $rs = array(); public $urs = array(); public $drs = array(); public $fieldsarr = array(); public $fieldsarra = array(); public $mwhere; public $mtable; public $uname; public $uid = 0; public $optid = 0; public $isflow = 0; public $ismobile= 0; public $minwidth= 100; public $inputwidth= 0; public $atype = ''; public $daochubo= false; public $companyid= 1; protected function flowinit(){} protected function flowchangedata(){} protected function flowchangetodo(){} protected function flowdeletebill($sm){} protected function flowzuofeibill($sm){} protected function flowsubmit($na, $sm){} protected function flowaddlog($arr){} protected function flowdatalog($arr){} protected function flowcheckbefore(){} protected function flowcheckafter($zt, $sm){} protected function flowcheckfinsh($zt){} protected function flowgetfields($lx){} protected function flowgetoptmenu($opt){} protected function flowcheckname($num){} protected function flowcoursejudge($num){} protected function flowoptmenu($ors, $crs){} protected function flowisreadqx(){return false;} protected function flowisdeleteqx(){return false;} protected function flowprintrows($r){return $r;} protected function flowsubdata($r, $lx=0){return $r;} protected function flownexttodo($type){return false;} protected function flowbillwhere($lx, $uid){return '';} protected $flowweixinarr = array(); protected $flowviewufieds = 'uid'; protected $flowcompanyidfieds = 'comid'; protected $flowfieldstype = 0; public function flowrsreplace($rs){return $rs;} public function flowrsreplace_we($row, $rs){return $row;} public function flowwesearchdata($lx){return array();} protected function flowrsreplaceedit($rs){return $rs;} protected $flowstatusarr = array(1); protected $subsubdatastyle = ''; protected $wherejoin = array(); public $defaultorder = ''; public $floweditother = false; public $xiangbordercolor = ''; public $flowlogtable = 'flow_log'; public $viewmodel,$chaomodel,$billmodel,$todomodel,$todosmodel,$flogmodel,$checksmodel,$cnamemodel,$wheremodel,$adminmodel,$remindmodel,$option,$rssust,$flowarr,$nowcourse,$nextcourse,$flowisend,$pipeiCoursearrc,$pipeiCoursearrs,$pipeiCoursearr,$_tempauoe,$checkiszhuanyi,$checkistui,$lastlogid,$tfieldarr,$inputobj; public function echomsg($msg) { if(!isajax())exit($msg); showreturn('', $msg, 201); exit(); } public function flowfieldarr($farr, $lx){return $farr;} public function flowinputtpl($cont, $lx){return $cont;} public function flowviewtpl($cont, $lx){return $cont;} public function floweditoffice($frs, $ofrs){} public function initdata($num, $id=null) { $this->initbase($num); $this->viewmodel = m('view'); $this->chaomodel = m('flow_chao'); $this->billmodel = m('flow_bill'); $this->todomodel = m('flow_todo'); $this->todosmodel = m('flowtodo'); $this->flogmodel = m('flow_log'); $this->checksmodel = m('flow_checks'); $this->cnamemodel = m('flowcname'); $this->wheremodel = m('where'); $this->adminmodel = m('admin'); $this->remindmodel = m('remind'); $this->option = m('option'); $this->companyid = $this->adminmodel->getcompanyid(); $this->tfieldsarra(); $this->mwhere = "`table`='$this->mtable' and `mid`=-1"; if(!$this->defaultorder){ $sortdir = arrvalue($this->moders, 'sortdir'); if(!isempt($sortdir))$this->defaultorder = str_replace(' ',',', $sortdir); } $this->flowinit(); if($id==null)return $this; $this->loaddata($id, true); return $this; } public function initbase($num) { if(is_array($num)){ $this->moders= $num; }else{ $this->moders = m('flow_set')->getone(is_numeric($num) ? $num : "`num`='$num'"); if(!$this->moders)$this->echomsg('妯″潡['.$num.']涓嶅瓨鍦紝璇峰埌[娴佺▼妯″潡鍒楄〃]涓嬫坊鍔'); } $this->daochubo = ($this->rock->post('execldown')=='true') ? true :false; $table = $this->moders['table']; $this->modeid = $this->moders['id']; $this->modenum = $this->moders['num']; $this->moders['name'] = $this->lang($this->moders['name']); $this->modename = $this->moders['name']; $this->isflow = (int)$this->moders['isflow']; $this->settable($table); $this->mtable = $table; return $this; } private function tfieldsarra() { $this->tfieldarr = array(); $rows = m('flow_element')->getrows("`mid`='$this->modeid' and `iszb`=0",'`name`,`fields`,`isbt`,`iszs`,`fieldstype`,`savewhere`,`data`,`isdr`,`iszb`,`issou`,`islu`,`islb`,`isonly`,`attr`','`sort`'); $this->fieldsarr = array(); if($rows)foreach($rows as $k=>$rs){ if($rs['islu']==1)$this->fieldsarr[] = $rs; if(in_array($rs['fieldstype'], array('select','rockcombo','uploadimg')))$this->tfieldarr[] = $rs; } $this->fieldsarra = $rows; } public function inputtitle() { return $this->moders['name']; } public function flowsearchfields() { $arr = array(); if($this->isflow>0){ $arr[] = array('name'=>''.lang('鐢宠浜').'...','fields'=>'uid'); $arr[] = array('name'=>''.lang('鎻愪氦浜').'...','fields'=>'optid'); } return $arr; } public function setLogtable($id) { $logstr = arrvalue($this->moders,'logstr'); $logsv = ''; if(!isempt($logstr)){ $logarr = json_decode($logstr, true); $mins = 1; ksort($logarr); foreach($logarr as $max=>$fval){ $maxs = (int)$max; if($id < $maxs && $id >= $mins)$logsv = $fval; $mins = $maxs; } } $this->flowlogtable = 'flow_log'.$logsv.''; $this->flogmodel->settable($this->flowlogtable); } public function loaddata($id, $ispd=true) { $this->id = (int)$id; $this->mwhere = "`table`='$this->mtable' and `mid`='$id'"; $swhere = "`id`='$id'"; $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $swhere .= ' and '.$wherestr; } $this->rs = $this->getone($swhere); $this->uname = ''; if(!$this->rs)$this->echomsg('鏁版嵁璁板綍涓嶅瓨鍦ㄤ簡'); $this->setLogtable($this->id); $this->rs['base_name'] = ''; $this->rs['base_deptname'] = ''; if(isset($this->rs['uid']))$this->uid = $this->rs['uid']; if(isset($this->rs['comid']))$this->companyid = $this->rs['comid']; if(!isset($this->rs['applydt']))$this->rs['applydt'] = ''; if(!isset($this->rs['status']))$this->rs['status'] = 1; $uisfield = property_exists($this, 'uidfields') ? $this->uidfields : 'optid'; if($this->uid==0 && isset($this->rs[$uisfield]))$this->uid = $this->rs[$uisfield]; $this->optid = isset($this->rs['optid']) ? $this->rs['optid'] : $this->uid; $this->urs = $this->adminmodel->getone($this->uid,'id,name,user,deptid,deptids,deptname,deptallname,face,ranking,superid,superpath,superman,deptpath'); if($this->isempt($this->rs['applydt'])&&isset($this->rs['optdt']))$this->rs['applydt']=substr($this->rs['optdt'],0,10); if($this->urs){ $this->drs = $this->db->getone('[Q]dept',"`id`='".$this->urs['deptid']."'"); $this->uname = $this->urs['name']; $this->rs['base_name'] = $this->uname; if($this->drs){ $this->rs['base_deptname'] = $this->drs['name']; } } $this->sericnum = ''; $this->billrs = $this->billmodel->getone($this->mwhere); if($this->billrs){ $this->sericnum = $this->billrs['sericnum']; if(isempt(arrvalue($this->billrs,'uname'))){ $this->savebill(); } if($this->billrs['status']!=$this->rs['status'])$this->billmodel->update('`status`='.$this->rs['status'].'', $this->billrs['id']); if($this->billrs['isturn']!=$this->rs['isturn'])$this->billmodel->update('`isturn`='.$this->rs['isturn'].'', $this->billrs['id']); if(isempt($this->rs['base_name']))$this->rs['base_name'] = $this->billrs['uname']; if(isempt($this->rs['base_deptname']))$this->rs['base_deptname'] = $this->billrs['udeptname']; }else{ if($this->isflow>0)$this->savebill(); } if($this->isflow>0){ if($this->rs['status']==1 && $this->rs['isturn']=='0'){ $this->update(array('isturn' => 1), $this->id); $this->rs['isturn'] = 1; if($this->billrs)$this->billmodel->update('`isturn`=1', $this->billrs['id']); } } $this->getlogrows = array(); if($ispd)$this->isreadqx(); $this->rssust = $this->rs; $this->flowchangedata(); $this->rs['base_systitle'] = TITLE; $this->rs['base_modename'] = $this->modename; $this->rs['base_sericnum'] = $this->sericnum; $this->rs['base_summary'] = $this->getsummary(); } public function getdaiban() { $s = $this->rock->dbinstr('nowcheckid', $this->adminid); $to = $this->billmodel->rows('`modeid`='.$this->modeid.' and `isdel`=0 and `status` not in(1,2) and '.$s.''); return $to; } public function isreadqx($glx=0) { $bo = false; if($this->adminid==1)$bo=true; if($this->uid==$this->adminid && $this->adminid>0)$bo=true; if(!$bo && $this->isflow>0){ if($this->billrs){ $allcheckid = $this->billrs['allcheckid']; if(contain(','.$allcheckid.',',','.$this->adminid.','))$bo = true; } } if(!$bo){ if($this->urs && contain($this->urs['superpath'],'['.$this->adminid.']'))$bo = true; } if(!$bo){ $tos = $this->todosmodel->rows("".$this->mwhere." and `uid`='$this->adminid'"); if($tos>0)$bo=true; } if(!$bo){ $tos = $this->chaomodel->rows($this->mwhere.' and '.$this->rock->dbinstr('csnameid', $this->adminid).''); if($tos>0)$bo=true; } if(!$bo){ $tos = $this->db->rows('[Q]todo', "`uid`='$this->adminid' and ".$this->mwhere.""); if($tos>0)$bo=true; } if(!$bo)$bo = $this->flowisreadqx(); if(!$bo){ $bo = $this->isreadqxs(); } if(!$bo){ $tos = $this->isjiankongqx(); if($tos>0)$bo=true; } if($glx==1)return $bo; if(!$bo)$this->echomsg('鏃犳潈闄愭煡鐪嬫ā鍧梉'.$this->modenum.'.'.$this->modename.']'.$this->uname.'鐨勬暟鎹紝璇疯仈绯荤鐞嗗憳鍒癧娴佺▼妯″潡鈫掓祦绋嬫ā鍧楁潈闄怾涓嬭缃'); } public function isreadqxs() { $bo = false; $where = $this->viewmodel->viewwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=true; return $bo; } public function iseditqx() { $bo = 0; if($bo==0 && $this->isflow>0){ if($this->billrs && ($this->uid == $this->adminid || $this->optid==$this->adminid)){ if($this->billrs['nstatus']==0 || $this->billrs['nstatus']==2){ $bo = 1; } } if($this->rs['status']==1)$bo=0; } if($bo==0){ $where = $this->viewmodel->editwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } return $bo; } public function isdeleteqx() { $bo = 0; if($bo==0 && $this->isflow>0){ if($this->billrs && ($this->uid == $this->adminid || $this->optid==$this->adminid)){ if($this->billrs['nstatus']==0 || $this->billrs['nstatus']==2){ $bo = 1; } } if($this->rs['status']==1)$bo=0; } if($bo==0){ $where = $this->viewmodel->deletewhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } $isd = $this->flowisdeleteqx(); if(is_numeric($isd) && $isd <= 1)$bo = $isd; return $bo; } public function isjiankongqx() { $bo = 0; if($bo==0){ $where = $this->viewmodel->jiankongwhere($this->moders, $this->adminid, $this->flowviewufieds); $where = str_replace('{asqom}','', $where); $tos = $this->rows("`id`='$this->id' $where "); if($tos>0)$bo=1; } return $bo; } public function getfields($lx=0) { $fields = array(); if(!$this->fieldsarra)$this->tfieldsarra(); $farr = $this->fieldsarra; foreach($farr as $k=>$rs)if($rs['iszs']=='1')$fields[$rs['fields']] = $rs['name']; $fters = $this->flowgetfields($lx); if(is_array($fters))$fields = array_merge($fields, $fters); return $fields; } public function getinputurl($num='',$mid=0,$can=array()) { if($num=='')$num = $this->modenum; $xa = 'lu'; if($this->ismobile==1)$xa = 'lum'; $url = 'index.php?a='.$xa.'&m=input&d=flow&num='.$num.'&mid='.$mid.''; if(is_array($can)){ foreach($can as $k=>$v)$url.='&'.$k.'='.$v.''; }else{ $url .= '&'.$can.''; } return $url; } public function replacepbr(&$arr, $k) { $val = arrvalue($arr, $k); if(!c('html')->ishtml($val))$arr[$k] = str_replace("\n",'
', $val); return $arr; } public function getdatalog($lx=0, $isdy=0) { m('log')->addread($this->mtable, $this->id); $this->todosmodel->biaoyidu($this->adminid, $this->modenum, $this->id); $fobj = m('file'); $this->ismobile = $lx; $arr['modename'] = $this->modename; $arr['title'] = $this->modename; $arr['modeid'] = $this->modeid; $arr['modenum'] = $this->modenum; $arr['mid'] = $this->id; $arr['status'] = arrvalue($this->rs,'status'); $arr['logarr'] = $this->getlog(1); $arr['isplview'] = arrvalue($this->moders,'ispl','0'); $arr['isys'] = arrvalue($this->moders,'isys','0'); $contview = ''; $lsds = ($isdy==2) ? $isdy: $lx; $path = ''.P.'/flow/page/view_'.$this->modenum.'_'.$lsds.'.html'; if(COMPANYNUM){ $path1 = ''.P.'/flow/page/view_'.$this->modenum.'_'.COMPANYNUM.'_'.$lsds.'.html'; if(file_exists($path1))$path = $path1; } $fstr = $fobj->getstr($this->mtable, $this->id, 3); $issubtabs = 0; if($fstr != ''){ $this->rs['file_content'] = $fstr; } $subdata = $this->getsuballdata(1); $this->rs['subdatarows'] = $subdata; $data = $this->rsreplace($this->rs, ($isdy==2) ? 3 : 1); $dataa = $this->viewjinfields(array($data)); $data = $dataa[0]; if($subdata){ $zbzd = m('flow_element')->getrows("`mid`='$this->modeid' and `iszb`>0 and `iszs`=1 and `fieldstype` in('uploadimg','uploadfile','textarea','select','rockcombo')",'`name`,`fields`,`fieldstype`,`iszb`,`data`','`iszb`,`sort`'); foreach($subdata as $zb=>$da){ $sub = $da['fields']; $data[$sub] = $this->getsubdata($zb,$da['data'],arrvalue($data,'subdatays'.$zb.'',$lx)); $data[''.$sub.'_style'] = 'padding:0'; } } $farrobj = $chufarr= array(); if(method_exists($this, 'flowxiangfields'))$chufarr = $this->flowxiangfields($chufarr); $farrobj['base_sericnum'] = array('name'=>arrvalue($chufarr,'base_sericnum','鍗曞彿')); $farrobj['base_name'] = array('name'=>arrvalue($chufarr,'base_name','鐢宠浜')); $farrobj['base_deptname'] = array('name'=>arrvalue($chufarr,'base_deptname','鐢宠浜洪儴闂')); $farrobj['base_status'] = array('name'=>arrvalue($chufarr,'base_status','娴佺▼鐘舵')); $farrobj['file_content'] = array('name'=>arrvalue($chufarr,'file_content','鐩稿叧鏂囦欢')); foreach($this->fieldsarra as $k=>$rs){ $fid = $rs['fields']; $fty = $rs['fieldstype']; if($fty=='uploadfile'){ $fval = arrvalue($data, $fid); if(isempt($fval))$fval='0'; $data[$fid] = ''; if($fval!='0'){ $data[$fid] = $fobj->getstr('', '', 3, "`id` in($fval)"); } } if($fty=='uploadimg' || $fty=='graph'){ $fval = arrvalue($data, $fid); if(!isempt($fval) && substr($fval,0,4)!='
rock->gethttppath($fval); $fwei = ($fty=='graph') ? 50 : 100; $data[$fid] = '
'; } } if($fty=='textarea'){ $this->replacepbr($data, $fid); } if($fty=='ditumap' && !isempt($rs['data'])){ $wzhi = arrvalue($data, $rs['data']); if(!isempt($wzhi))$data[$fid].='
[鏌ョ湅鍦板浘] '; } $farrobj[$fid] = $rs; } $_logarr = $qfields = array(); foreach($arr['logarr'] as $k1=>$rs1)$_logarr[$rs1['id']] = $rs1; $logrows = $this->flogmodel->getrows($this->mwhere.' and `modeid`='.$this->modeid.' and `courseid`>0 and `status`>0 and `valid`=1','*','id desc'); $togdar = array(); foreach($logrows as $k2=>$rs2){ $sie1 = $rs2['courseid'].'_'.$rs2['checkid']; if(isset($togdar[$sie1])){ $logrows[$k2]['show'] = false; }else{ $togdar[$sie1] = true; $logrows[$k2]['show'] = true; } } foreach($logrows as $k2=>$rs2){ if(!$rs2['show'])continue; $rs3 = $_logarr[$rs2['id']]; $_coid = $rs2['courseid']; if(!isempt($rs3['qmimg']))$rs3['name'] = '
'; $key1 = 'course'.$_coid.''; if(!isset($data[''.$key1.'_name'])){ $data[''.$key1.'_name'] = $rs3['name']; $data[''.$key1.'_zt'] = '
'.$rs3['statusname'].' '; $data[''.$key1.'_sm'] = $rs3['sm']; $data[''.$key1.'_dt'] = $rs3['checkdt']; }else{ $data[''.$key1.'_name'] .= ','.$rs3['name']; $data[''.$key1.'_sm'] .= ','.$rs3['sm']; $data[''.$key1.'_dt'] = $rs3['checkdt']; } $key2 = ''.$key1.'_all'; if(!isset($data[$key2])){ $qfields[$key2] = $rs2['name']; $data[$key2]=''; } $str1 = $rs3['name'].'
'.$rs3['statusname'].' '.$rs3['checkdt'].''; if(!isempt($rs3['sm']))$str1.='锛'.$rs3['sm'].''; if($data[$key2]!='')$data[$key2].='
'; $data[$key2].= $str1; } $ztass = $this->getnowstatus(); $data['base_status'] = $ztass[3]; if(file_exists($path)){ $contview = $this->flowviewtpl(file_get_contents($path), $lx); preg_match_all('/\^(.*?)\^/', $contview, $list); foreach($list[1] as $k=>$nrs){ $fzdrs = arrvalue($farrobj, $nrs); if($fzdrs)$contview = str_replace('^'.$nrs.'^', $fzdrs['name'], $contview); } $contview = $this->rock->reparr($contview, $data); } $arr['isdefaultview'] = 0; foreach($chufarr as $f1=>$v1)$qfields[$f1] = $v1; if($this->isempt($contview) || contain($contview, '$contview$')){ $arr['isdefaultview'] = 1; $_fields = array(); if($this->isflow>0){ $_fields['base_sericnum'] = $farrobj['base_sericnum']['name']; $_fields['base_name'] = $farrobj['base_name']['name']; $_fields['base_deptname'] = $farrobj['base_deptname']['name']; $_fields['base_status'] = $farrobj['base_status']['name']; } $fields = array_merge($_fields, $this->getfields($lx)); if($fstr!='')$fields['file_content'] = $farrobj['file_content']['name']; foreach($subdata as $zb=>$da){ $fields[$da['fields']] = $da['name']; } if($qfields)$fields = array_merge($fields,$qfields); if($lx==0)foreach($fields as $k=>$rs){$data[''.$k.'_style'] = 'width:75%';break;} $_colsr = $this->xiangbordercolor; if($_colsr=='')$_colsr = getconfig('bcolorxiang'); $contvimr = c('html')->xiangtable($fields, $data, $_colsr); $contvimr = '
'.$contvimr.'
'; if($lx==1){ $contvimr = ''; if($this->isflow>0 && $this->urs){ $contvimr.='
'.$this->urs['name'].'('.$this->urs['ranking'].')
'.$this->urs['deptallname'].'
-
'; unset($fields['base_name']); unset($fields['base_deptname']); } $contvimr .= '
'; foreach($fields as $f=>$n){ $vs = arrvalue($data, $f); if(!isempt($vs)){ if(substr($f,0,7)=='subdata'){ $contvimr .= ' '; }else{ $contvimr .= ''.str_replace(' ',' ',$n).'
锛 '.$vs.'
'; } } } $contvimr .= '
'; } if(isempt($contview))$contview = $contvimr; $contview = str_replace('$contview$',$contvimr, $contview); } unset($farrobj); $arr['contview'] = $contview; $arr['readarr'] = m('log')->getreadarr($this->mtable, $this->id); $arr['isedit'] = $this->iseditqx(); $arr['isdel'] = $this->isdeleteqx(); $arr['isflow'] = $this->isflow; $arr['modename'] = $this->modename; $arr['ischehui'] = $this->ischehui(); $arr['statustext'] = $ztass[4]; $arr['statuscolor'] = $ztass[1]; $arr['optmenu'] = $this->getoptmenu(1); $arr['isgbjl'] = (int)$this->rock->arrvalue($this->moders,'isgbjl','0'); $arr['isgbcy'] = (int)$this->rock->arrvalue($this->moders,'isgbcy','0'); $receiptrs = false; $receiptrow = m('receipt')->getall("`modenum`='$this->modenum' and `mid`='$this->id' and `status`=1"); foreach($receiptrow as $k=>$hrs){ $uid1 = ','.$this->adminid.','; if(!contain(','.$hrs['receid'].',', $uid1))continue; if(!contain(','.$hrs['receids'].',', $uid1)){ $receiptrs = array( 'id' => $hrs['id'], 'optname' => $hrs['optname'], ); break; } } $arr['flowinfor'] = array(); $arr['readunarr'] = array(); $arr['receiptrs'] = $receiptrs; if($this->isflow>0){ $arr['flowinfor']= $this->getflowinfor(); if($arr['flowinfor']['ischeck']==1){ $arr['isplview']='0'; } } if(isset($data['title']))$arr['title'] = $data['title']; $_oarr = $this->flowdatalog($arr); if(is_array($_oarr))foreach($_oarr as $k=>$v)$arr[$k]=$v; $conta = $this->rock->matcharr($contview,2); $edbof = false; foreach($conta as $fids){ $thnr = ''; $contview = str_replace('`'.$fids.'`', $thnr, $contview); } $arr['contview'] = $contview; return $arr; } private function getsubdata($xu, $rows, $lx=0) { $iscz = 0; $iszb = $xu+1; $fields = 'subdata'.$xu.''; $subrows = $this->db->getrows('[Q]flow_element','`mid`='.$this->modeid.' and `iszb`='.$iszb.' and `iszs`=1','`fields`,`name`,`isalign`','`sort`'); $cont = ''; if($this->db->count > 0){ $iscz = 1; $headstr = '@xuhaos,,center'; $colorbb = getconfig('bcolorxiang', '#cccccc'); foreach($subrows as $k=>$rs){ $headstr.='@'.$rs['fields'].','.$rs['name'].''; if($rs['isalign']=='1')$headstr.=',left'; if($rs['isalign']=='2')$headstr.=',right'; } foreach($rows as $k=>$rs)$rows[$k]['xuhaos'] = $k+1; $slex = ($lx==0) ? 'noborder':''; if($this->subsubdatastyle!='')$slex = $this->subsubdatastyle; $cont = c('html')->createrows($rows, substr($headstr,1), $colorbb, $slex); } return $cont; } public function ischehui() { $is = 0; if($this->rs['status']==1 || $this->isflow==3)return $is; $where = "".$this->mwhere." and `valid`=1 order by `id` desc"; $rs = $this->flogmodel->getone($where); $sj = (int)getconfig('flowchehuitime','2'); $time = time()-$sj*3600; if($rs && $rs['status']=='1' && $rs['checkid']==$this->adminid && strtotime($rs['optdt'])>$time && ($rs['courseid']>0 || $rs['iszb']=='1' )) $is = $rs['id']; return $is; } public function chehui($sm='') { return $this->bd6('5peg5L!h5ZG8562!5o6I5peg5q2k5Yqf6IO9'); } public function bd6($str) { return $this->rock->jm->base64dencode($str); } public function getdataedit() { $fobj = m('file'); $arr['data'] = $this->flowrsreplaceedit($this->rssust); $arr['table'] = $this->mtable; $arr['tables'] = $this->moders['tables']; $arr['modeid'] = $this->modeid; $arr['isedit'] = $this->iseditqx(); $arr['isflow'] = $this->isflow; $arr['user'] = $this->urs; $arr['status'] = $this->rs['status']; $filers = $fobj->getfile($this->mtable,$this->id); foreach($filers as $fk=>$frs1)$filers[$fk]['thumbpath']=$fobj->getthumbpath($frs1); $arr['filers'] = $filers; $arr['subdata'] = $this->getsuballdata(); $filearr = array(); $fileids = ''; foreach($this->fieldsarr as $k=>$rs){ $fid = $rs['fields']; $flx = $rs['fieldstype']; if($flx=='uploadfile'){ $fval = arrvalue($this->rssust, $fid); if(!isempt($fval))$fileids.=','.$fval.''; } if($flx=='uploadimg'){ $arr['data'][''.$fid.'_view'] = $this->rock->gethttppath($arr['data'][$fid]); } } if($fileids!=''){ $frows = $fobj->getall('`id` in('.substr($fileids, 1).')','filename,id,filesizecn,fileext,optname,thumbpath,thumbplat'); foreach($frows as $k1=>$rs1){ $rs1['thumbpath'] = $fobj->getthumbpath($rs1); $filearr['f'.$rs1['id'].''] = $rs1; } } $arr['filearr'] = $filearr; $ztarr = $this->getnowstatus(); $arr['statustext'] = $ztarr[0]; $arr['statuscolor'] = $ztarr[1]; return $arr; } public function getflowinfor() { $ischeck = 0; $ischange= 0; $str = ''; $arr = $this->getflow(); if($arr['nowcheckid'] != $this->billrs['nowcheckid'])$this->getflowsave($arr, true); $nstatus = $this->rs['status']; $isturn = $this->rs['isturn']; $nowcheckid = ','.$arr['nowcheckid'].','; if($isturn==1 && $nstatus !=1 && contain($nowcheckid, ','.$this->adminid.',') && !in_array($nstatus, array(2,5))){ $ischeck = 1; } $logarr = $this->getlog(); $nowcur = $this->nowcourse; if(arrvalue($this->nextcourse,'checktype')=='change'){ $ischange = 1; } $sarr['ischeck'] = $ischeck; $sarr['ischange'] = $ischange; $sarr['nowcourse'] = $nowcur; $sarr['iszhuanban'] = 0; $sarr['ischao'] = 0; $sarr['nextcourse'] = $this->nextcourse; $sarr['nstatustext'] = $arr['nstatustext']; if($isturn==0)$sarr['nstatustext'] = '
寰呮彁浜 '; $_checkfields = arrvalue($nowcur,'checkfields'); $checkfields = array(); if($ischeck == 1 && !isempt($_checkfields)){ $_checkfieldsa = explode('|', $_checkfields); $_checkfields = join(',',$_checkfieldsa); $_checkxuant = arrvalue($_checkfieldsa, 1); $inputobj = c('input'); $inputobj->flow = $this; $inputobj->mid = $this->id; $inputobj->urs = $this->urs; $elwswhere = "`mid`='$this->modeid' and `iszb`=0 and instr(',$_checkfields,', concat(',',`fields`,','))>0"; $infeidss = $inputobj->initFields($elwswhere); foreach($infeidss as $_fs=>$fsva){ $_sfes = $fsva['fields']; $_type = $fsva['fieldstype']; $showinpus = 1; $isbt = 1; if($_checkxuant && contain(','.$_checkxuant.',',','.$_sfes.','))$isbt=0; if($_type=='hidden' || $_type=='fixed')$showinpus=2; $_val = arrvalue($this->rssust, $_sfes); $cheo = (substr($_type,0,6)=='change' && !isempt($fsva['data'])); if($cheo)$_val.='|'.arrvalue($this->rssust, $fsva['data']).''; $checkfields[$_sfes] = array( 'inputstr' => $inputobj->getfieldcontval($_sfes, $_val), 'name' => $fsva['name'], 'isbt' => $isbt, 'fieldstype'=> $_type, 'fieldsarr' => $fsva, 'showinpus' => $showinpus ); if($cheo){ $_sfes = $fsva['data']; $checkfields[$_sfes] = array( 'inputstr' => '', 'isbt' => $isbt, 'name' => $fsva['name'].'id', 'fieldstype'=> $_type, 'fieldsarr' => false, 'showinpus' => 2 ); } } } $sarr['checkfields'] = $checkfields; if($nstatus==2)$sarr['nstatustext'] ='
寰呮彁浜や汉澶勭悊('.$this->urs['name'].') '; $loglen = count($logarr); foreach($logarr as $k=>$rs){ if($rs['courseid']>0){ $sty = ''; $col = $rs['color']; if($str!='')$str.=' 鈫 '; $str.='
'.$rs['actname'].'('.$rs['name'].''.$rs['statusname'].' ) '; } } if($nstatus=='2'){ if($str!='')$str.=' 鈫 '; $str.= $sarr['nstatustext']; }else if($nstatus=='5'){ if($str!='')$str.=' 鈫 '; $sarr['nstatustext'] = '
宸蹭綔搴 '; $str.= '
宸蹭綔搴 '; }else{ foreach($this->flowarr as $k=>$rs){ if($rs['ischeck']==0){ $sty = 'color:#888888'; if($rs['isnow']==1)$sty='font-weight:bold;color:#800000'; if($str!='')$str.='
鈫 '; $str.='
'.$rs['name'].''; if(!isempt($rs['nowcheckname']))$str.='('.$rs['nowcheckname'].')'; $str.=' '; } } } $sarr['flowcoursestr'] = $str; if($nstatus==1)$sarr['nstatustext'] = $this->getnowstatus(1); $actstr = ',鍚屾剰|green,涓嶅悓鎰弢red'; if(isset($nowcur['courseact']) ){ $actstrt = $nowcur['courseact']; if(!isempt($actstrt))$actstr = ','.$actstrt; } $act = c('array')->strtoarray($actstr); foreach($act as $k=>$as1)if($k>0 && $as1[0]==$as1[1])$act[$k][1]=''; if(arrvalue($this->moders,'isys')=='1' && (int)arrvalue($nowcur,'mid','0')>=0){ $act[25]= array('鍓嶅姞绛','',''); $act[26]= array('鍚庡姞绛','',''); } $sarr['courseact'] = $act; $nowstatus = $this->rs['status']; if($this->isflow>0 && $this->rs['isturn']==0)$nowstatus=3; $sarr['nowstatus'] = $nowstatus; $step = $this->rock->arrvalue($nowcur, 'step','0'); $tuicourse = $this->flogmodel->getall($this->mwhere.' and `courseid`>0 and `valid`=1 and `status`=1 and `step`<'.$step.'','`id`,`checkname`,`name`','`step` desc'); $sarr['tuicourse'] = $tuicourse; return $sarr; } public function updatestatus($zt) { $this->update('`status`='.$zt.'', $this->id); $this->billmodel->update('`status`='.$zt.'', $this->mwhere); } public function getstatusarr() { return $this->getstatus(null, '','',2); } public function getstatus($rs, $statusstr='',$other='', $glx=0) { $statustext = $statuscolor = ''; if($statusstr=='')$statusstr=$this->rock->arrvalue($this->moders,'statusstr'); $statusara = array(); $colorsa = array('blue','green','red','#ff6600','#526D08','#888888','','','','','','','','','','','','',''); if(isempt($statusstr)){ $statussst = '涓嶅悓鎰'; $statusstr = '寰?澶勭悊|blue,宸插鏍竱green,'.$statussst.'|red'; } $nowcheckname= arrvalue($rs,'nowcheckname', arrvalue($this->billrs,'nowcheckname')); if(isempt($other))$other = $nowcheckname; $statusar = c('array')->strtoarray($statusstr); foreach($statusar as $k=>$v){ if($v[0]==$v[1])$v[1]= arrvalue($colorsa, $k); $statusara[$k] = $v; } $statusara[5] = array('宸蹭綔搴','#888888'); $statusara[23] = array('閫鍥','#17B2B7'); if($glx==2)return $statusara; $isturn = -1; if(isset($rs['isturn']))$isturn = (int)$rs['isturn']; $zt = $this->rock->arrvalue($rs, 'status'); if($isturn==0){ $statustext = '寰呮彁浜'; $statuscolor= '#ff6600'; }elseif(!isempt($zt)){ if(isset($statusara[$zt])){ $statustext = $statusara[$zt][0]; $statuscolor = $statusara[$zt][1]; } } if(contain($statustext,'?')){ $statusstr = str_replace('?', '
'.$other.' ', $statustext); }else{ $statusstr = '
'.$statustext.' '; } if($glx==1){ return $statusstr; } return array(str_replace('?', $other, $statustext), $statuscolor, $zt, $statusstr, str_replace('?', '', $statustext)); } public function getstatusstr($rs) { return $this->getstatus($rs, '','', 1); } public function getnowstatus($glx=0) { return $this->getstatus($this->rs, '','', $glx); } private $getlogrows = array(); public function getlog($lx=0) { if(isset($this->getlogrows[$lx]))return $this->getlogrows[$lx]; $rows = $this->flogmodel->getrows($this->mwhere, '`checkname` as `name`,`checkid`,`name` as actname,`optdt`,`status`,`explain`,`statusname`,`valid`,`courseid`,`color`,`id`,`qmimg`','`id` asc'); $uids = $idss = ''; $dts = c('date'); $fo = m('file'); $editarrs = array(); foreach($rows as $k=>$rs){ $uids.=','.$rs['checkid'].''; $idss.=','.$rs['id'].''; $col = $rs['color']; if(isempt($col))$col='green'; if(contain($rs['statusname'],'涓') || $rs['status']=='2')$col='red'; $rows[$k]['color'] = $col; $rows[$k]['checkdt'] = $rs['optdt']; $rows[$k]['sm'] = str_replace("\n",'
', (string)$rs['explain']); $rows[$k]['explain'] = $rows[$k]['sm']; if(!isempt($rs['qmimg'])){ if(!contain($rs['qmimg'],'.')){ $qmimg = ''.UPDIR.'/'.date('Y-m').'/qmimg'.$rs['id'].'.png'; $bo = true; if(!file_exists($qmimg)){ $bar= explode(',', $rs['qmimg']); $bo = $this->rock->createtxt($qmimg, base64_decode($bar[1])); } if(!$bo){ $qmimg = $rs['qmimg']; }else{ $qmimg = ''.URL.''.$qmimg.''; } }else{ $qmimg = $rs['qmimg']; if(!file_exists($qmimg)){ $qmimg = ''; }else{ $qmimg = ''.URL.''.$qmimg.''; } } $rows[$k]['qmimg'] = $qmimg; if(!isempt($qmimg))$rows[$k]['explain']= '
'.$rs['explain'].''; } } if($idss!=''){ $farr = $fo->getfile('flow_log', substr($idss, 1)); if($farr)foreach($rows as $k=>$rs){ $fstr = $fo->getallstr($farr, $rs['id'],2); $rows[$k]['explain']= $this->strappend($rs['explain'], $fstr, '
'); } } if($uids!=''){ $rows = m('admin')->getadmininfor($rows, substr($uids, 1), 'checkid'); } $this->getlogrows[$lx] = $rows; return $rows; } public function addlog($arr=array()) { $addarr = array( 'table' => $this->mtable, 'mid' => $this->id, 'checkname' => $this->adminname, 'checkid' => $this->adminid, 'optdt' => $this->rock->now, 'courseid' => '0', 'status' => '1', 'ip' => $this->rock->ip, 'web' => $this->rock->web, 'modeid' => $this->modeid ); foreach($arr as $k=>$v)$addarr[$k]=$v; if(isset($addarr['explain']))$addarr['explain']= htmlspecialchars($addarr['explain']); $this->flogmodel->insert($addarr); $ssid = $this->db->insert_id(); $fileid = $this->rock->post('fileid'); if($fileid!='')m('file')->addfile($fileid, 'flow_log', $ssid, $this->modenum.'|'.$this->id); $logfileid = $this->rock->post('logfileid'); if($logfileid!='')m('file')->addfile($logfileid, 'flow_log', $ssid, $this->modenum.'|'.$this->id); $addarr['id'] = $ssid; $this->flowaddlog($addarr); $this->getlogrows = array(); return $ssid; } public function submit($na='', $sm='') { if($na=='')$na='鎻愪氦'; $isturn = 1; if($na=='淇濆瓨')$isturn = 0; $this->addlog(array( 'name' => $na, 'explain' => $sm )); if($this->isflow>0){ $marr['isturn'] = $isturn; $marr['status'] = 0; $this->rs['status'] = 0; $this->update($marr, $this->id); if(arrvalue($this->moders,'isflowlx')=='1' || $this->isflow>=3){ $this->checksmodel->delete($this->mwhere); $this->flogmodel->update('`valid`=0', ''.$this->mwhere.' and `courseid`>0 and `valid`=1'); } $farr = $this->getflow(); if($farr['nowcourseid']>0){ $sysnextoptid = $this->rock->post('sysnextoptid'); $sysnextopt = $this->rock->post('sysnextopt'); $sysnextcustidid = (int)$this->rock->post('sysnextcustidid'); if($sysnextcustidid == $farr['nowcourseid'] && !isempt($sysnextoptid) && !isempt($sysnextopt)){ $this->addcheckname($sysnextcustidid, $sysnextoptid, $sysnextopt, true, 1); $farr = $this->getflow(); } } $farr['status'] = 0; $this->savebill($farr); if($isturn == 1){ $this->nexttodo($farr['nowcheckid'],'submit'); } } $this->flowsubmit($na, $sm); $this->savecsname( $this->rock->post('syschaosongid'), $this->rock->post('syschaosong'), $this->adminid,0,$isturn,$na); if($na=='缂栬緫'){ $this->gettodosend('boedit'); }else{ $this->gettodosend('boturn'); } } private function savecsname($csnameid,$csname,$uid,$type,$isturn, $na) { if(!isempt($csnameid)){ $where = $this->mwhere.' and `type`='.$type.''; if($type>0)$where.=' and `uid`='.$uid.''; $csid = (int)$this->chaomodel->getmou('id', $where); if($csid==0)$where = ''; $this->chaomodel->record(array( 'modeid' => $this->modeid, 'table' => $this->mtable, 'mid' => $this->id, 'uid' => $uid, 'type' => $type, 'csname' => $csname, 'csnameid' => $csnameid, ),$where); if($isturn==1)$this->nexttodo($csnameid,'chao', $na); } } public function getcsname($id=0) { if($id>0){ $where= "`table`='$this->mtable' and `mid`='$id' and `type`=0"; }else{ $where= "`modeid`={$this->modeid} and `uid`={$this->adminid} and `type`=0"; $iscs = (int)$this->moders['iscs']; } $ors = $this->chaomodel->getone($where,'*','`id` desc'); $csname = $csnameid = ''; if($ors){ $csname = $ors['csname']; $csnameid = $ors['csnameid']; } return array( 'csname' => $csname, 'csnameid' => $csnameid, 'id' => $id, ); } public function zhuijiaexplain($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '杩藉姞璇存槑', 'status' => 1, )); $zt = $this->rs['status']; if($zt==2 && $this->isflow>0 && $this->adminid==$this->uid){ $marr['status'] = 0; $this->rs['status'] = 0; $this->update($marr, $this->id); $farr = $this->getflow(); $farr['status'] = 0; $this->savebill($farr); $this->nexttodo($farr['nowcheckid'],'zhui', $sm); } $this->gettodosend('bozhui','', $sm); } public function chuiban($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '鍌姙', 'status' => 1, )); $farr = $this->getflow(true); $this->nexttodo($farr['nowcheckid'],'cuiban', $sm); $this->gettodosend('cuiban','', $sm); } public function getyushen($rows) { return $rows; } private function getyushenss($id, $rows, $xu, $isq) { if($xu==0)$this->_tempauoe = array(); if(isset($rows[$id])){ $_tars = $rows[$id]; if($isq==1)$this->getyushenss($_tars['id'], $rows, $xu+1, $isq); $this->_tempauoe[] = $_tars; if($isq==0)$this->getyushenss($_tars['id'], $rows, $xu+1, $isq); } return $this->_tempauoe; } public function getflowpipei($uid=0) { $urs = $this->urs; if(!$urs)$urs = $uid; if(!is_array($urs))$urs = $this->db->getone('[Q]admin', "`id`='$urs'", '`deptid`,`deptpath`,`id`'); $coursedb = m('flowcourse'); $barr = $coursedb->pipeiCourse($this->modeid); $rows = $barr['rows']; $this->pipeiCoursearrc = $barr['rowd']; $this->pipeiCoursearrs = array(); $this->pipeiCoursearr = array(); $kqobj = m('kaoqin'); $this->getflowpipeis($rows, $urs, $kqobj); unset($this->pipeiCoursearrs); unset($this->pipeiCoursearrc); return $this->getyushen($this->pipeiCoursearr); } private function getflowpipeis($rows,$urs, $kqobj) { $shiyong = array(); $defix = $xuhao = 0; $uid = arrvalue($urs,'id',0); $zshu = count($rows); foreach($rows as $k=>$rs){ $whereid = (int)$rs['whereid']; $receid = $rs['receid']; $wherestr= arrvalue($rs, 'where'); if($rs['status']=='0')continue; if(!isempt($wherestr)){ $wherestr = m('base')->strreplace($this->rock->jm->base64decode($wherestr), $uid); $to = $this->rows("`id`='$this->id' and $wherestr "); if($to==0)continue; } if($whereid > 0){ $bo = $this->wheremanzhu($whereid); if(!$bo)continue; } if(!isempt($rs['num'])){ $bo = $this->flowcoursejudge($rs['num'], $rs); if(is_bool($bo) && !$bo)continue; } $xuhao++; if($defix==0 && (isempt($receid) || contain($receid,'all'))){ $defix = $xuhao; } if(isempt($receid) && (!isempt($wherestr) || $whereid > 0)){ $defix = $xuhao; } $rs['xuhao'] = $xuhao; $shiyong[] = $rs; } $pboss = false; if($shiyong){ $gxuha = $kqobj->getpipeimid($urs, $shiyong, 'xuhao', $defix); if($gxuha>0){ $pboss = true; $gxuha = $gxuha-1; $prs = $shiyong[$gxuha]; $this->getflowpipeisss($prs, $urs, $kqobj); } } if(!$pboss && $zshu==1 && $rows[0]['childshu']>0){ $this->getflowpipeis($rows[0]['children'], $urs, $kqobj); } } private function getflowpipeisss($prsnrs, $urs, $kqobj) { $prs = $prsnrs; unset($prs['children']); $this->pipeiCoursearrs[]= $prs['id']; $this->pipeiCoursearr[] = $prs; if($prs['childshu']>0){ $this->getflowpipeis($prsnrs['children'], $urs, $kqobj); }else{ $nid = arrvalue($prs,'nid','0'); if($nid>0 && !in_array($nid, $this->pipeiCoursearrs) && isset($this->pipeiCoursearrc, $nid)){ $this->getflowpipeis(array($this->pipeiCoursearrc[$nid]), $urs, $kqobj); } } } public function getflow($sbo=false) { $this->flowarr = array(); $allcheckid = $nowcheckid = $nowcheckname = $nstatustext = ''; $allcheckids = array(); $nowcourseid = 0; $nstatus = $this->rs['status']; $this->nowcourse = array(); $this->nextcourse = array(); $this->flowisend = 0; $curs = $this->flogmodel->getrows($this->mwhere,'checkid,checkname,courseid,`valid`,`status`,`statusname`,`name`,`iszb`','id desc'); $cufss = $ztnas = $chesarr = array(); foreach($curs as $k=>$rs){ if($rs['iszb']=='1' && !in_array($rs['checkid'], $allcheckids))$allcheckids[] = $rs['checkid']; if($rs['courseid']=='0')continue; $_su = ''.$rs['courseid'].''; $_su1 = ''.$rs['courseid'].'_'.$rs['checkid'].''; if($rs['valid']==1 && in_array($rs['status'], $this->flowstatusarr)){ if(!isset($cufss[$_su]))$cufss[$_su]=0; $cufss[$_su]++; $chesarr[$_su1] = 1; } if(!in_array($rs['checkid'], $allcheckids))$allcheckids[] = $rs['checkid']; if($nstatustext=='' && $rs['courseid']>0){ $nstatustext = ''.$rs['checkname'].'澶勭悊'.$rs['statusname'].''; $nstatus = $rs['status']; } $ztnas[$rs['courseid']] = ''.$rs['checkname'].''.$rs['statusname'].''; } $nowstep = $zongsetp = -1; $isend = 0; $czt = $this->rs['status']; $coutye = 0; $rows = ($czt==1 || $czt==5)? array() : $this->getflowpipei($this->uid); if($rows){ $checksa = $this->checksmodel->getrows($this->mwhere.' and `addlx`=3'); $coursea = $nrows = array(); foreach($checksa as $k=>$rs)$coursea[$rs['courseid']]='1'; $nrows = array(); $allcheckid = ''; $isoptsuperbo = false; foreach($rows as $k=>$rs){ $uarr = $this->getcheckname($rs); $rows[$k]['checkid'] = $uarr[0]; $rows[$k]['checkname'] = $uarr[1]; $allcheckid .= ','.$uarr[0].''; if($rs['checktype']=='optsuper' && isempt($uarr[0]))$isoptsuperbo=true; } if($isoptsuperbo)foreach($rows as $k=>$rs){ if($rs['checktype']=='optsuper'){ $_k1 = $k-1; $_uid = $this->optid; if($_k1>=0){ $ours = $this->flogmodel->getone($this->mwhere.' and `courseid`='.$rows[$_k1]['id'].' and `valid`=1 ','`checkid`','`id` desc'); if(!$ours){ $_uid = (int)$rows[$_k1]['checkid']; }else{ $_uid = $ours['checkid']; } } $uarr = $this->adminmodel->getsuperman($_uid); if($uarr){ $rows[$k]['checkid'] = $uarr[0]; $rows[$k]['checkname'] = $uarr[1]; } } } foreach($rows as $k=>$rs){ $nrows[] = $rs; if($rs['checktype']=='superall'){ $ids1 = $rs['id']; $suparr = $this->adminmodel->getsuperarr($this->uid); if($suparr){ $logdsar = $this->getlog(); foreach($logdsar as $k1=>$rs1){ if($rs1['courseid']>0 && $rs1['status']=='1' && $rs1['valid']=='1')$allcheckid .= ','.$rs1['checkid'].''; } foreach($suparr as $k1=>$surs){ if(!contain(','.$allcheckid.',', ','.$surs['id'].',')){ $rs['oldid'] = $ids1; $rs['id'] = $ids1 * 99999 + $surs['id']; $rs['checkid'] = $surs['id']; $rs['checkname'] = $surs['name']; $rs['iszf'] = 0; $nrows[] = $rs; $allcheckid .= ','.$surs['id'].''; } } } } } $yisheh = ''; if($this->isflow==2){ $logdsar = $this->getlog(); foreach($logdsar as $k1=>$rs1) if($rs1['courseid']>0 && $rs1['status']==1 && $rs1['valid']==1)$yisheh .= ','.$rs1['checkid'].''; } foreach($nrows as $k=>$rs){ $whereid = (int)$rs['whereid']; $checkshu = $rs['checkshu']; $checkid = $rs['checkid']; $checkname = $rs['checkname']; $checktype = $rs['checktype']; if($this->isflow==2 && !isempt($checkid) && isempt($rs['checkfields'])){ if(($checkid==$this->uid || $checkid==$this->optid) )continue; $k2 = $k+1; $ntype = 'yes'; if(isset($nrows[$k2])){ if($nrows[$k2]['checktype']=='change')$ntype='no'; } if($ntype=='yes' && contain(','.$yisheh.',',','.$checkid.','))continue; } if(!isempt($checkid))$yisheh .= ','.$checkid.''; $zongsetp++; $ischeck = 0; $checkids = $checknames = ''; $_su = ''.$rs['id'].''; $nowshu = 0; if(isset($cufss[$_su]))$nowshu = $cufss[$_su]; if(!$this->isempt($checkid)){ $checkida = explode(',', $checkid); $checkidna = explode(',', $checkname); $_chid = $_chna = ''; foreach($checkida as $k1=>$chkid){ $_su1 = ''.$rs['id'].'_'.$chkid.''; if(!in_array($chkid, $allcheckids))$allcheckids[] = $chkid; if(!isset($chesarr[$_su1])){ $_chid.=','.$chkid.''; $_chna.=','.arrvalue($checkidna, $k1).''; } } if($_chid!='')$_chid = substr($_chid, 1); if($_chna!='')$_chna = substr($_chna, 1); if($_chid==''){ $ischeck = 1; }else{ if($checkshu>0&&$nowshu>=$checkshu)$ischeck = 1; } $checkids = $_chid; $checknames = $_chna; }else{ if($checkshu>0&&$nowshu>=$checkshu)$ischeck = 1; if($checkshu == 0 && $nowshu>0)$ischeck = 1; } if($ischeck==0 && $coutye==0){ if((int)arrvalue($rs,'coursetype','0')>0)$coutye = 1; } $rs['ischeck'] = $ischeck; $rs['islast'] = 0; $rs['checkid'] = $checkid; $rs['checkname'] = $checkname; $rs['nowcheckid'] = $checkids; $rs['nowcheckname'] = $checknames; $rs['isnow'] = 0; $rs['nowstep'] = $zongsetp; $rs['step'] = $k+1; if($ischeck==0 && $nowstep==-1){ $rs['isnow']= 1; $nowstep = $zongsetp; $this->nowcourse = $rs; $nowcourseid = $rs['id']; $nowcheckid = $checkids; $nowcheckname = $checknames; } if($nowstep>-1 && $zongsetp==$nowstep+1)$this->nextcourse = $rs; $this->flowarr[]= $rs; } } if($zongsetp>-1)$this->flowarr[$zongsetp]['islast']=1; if($nowstep == -1){ $isend = 1; }else{ $nstatustext = '寰'.$nowcheckname.'澶勭悊'; } $this->flowisend = $isend; $allcheckid = join(',', $allcheckids); $arrbill['allcheckid'] = $allcheckid; $arrbill['nowcourseid'] = $nowcourseid; $arrbill['nowcheckid'] = $nowcheckid; $arrbill['nowcheckname'] = $nowcheckname; $arrbill['nstatustext'] = $nstatustext; $arrbill['nstatus'] = $nstatus; $arrbill['status'] = $this->rs['status']; $arrbill['isturn'] = $this->rs['isturn']; if($sbo)$this->getflowsave($arrbill); return $arrbill; } public function wheremanzhu($id) { $uid = $this->uid; $ser = $this->wheremodel->getflowwhere($id, $uid); if(!$ser)return true; $str = $ser['ntr']; if(!isempt($str)){ $to = $this->db->rows('[Q]admin',"`id`='$uid' and ($str)"); if($to>0)return false; } $str = $ser['str']; if(!isempt($str)){ $str= str_replace('{asqom}','', $str); $to = $this->rows("`id`='$this->id' and $str"); if($to==0)return false; } $str = $ser['utr']; if(!isempt($str)){ $to = $this->db->rows('[Q]admin',"`id`='$uid' and $str"); if($to==0)return false; } return true; } public function getflowsave($sarr, $suvu=false) { if(!$sarr)return; if($suvu)$sarr['updt'] = $this->rock->now; $this->billmodel->update($sarr, $this->mwhere); } private function getcheckname($crs) { $type = $crs['checktype']; $cuid = $name = ''; $courseid= $crs['id']; $cheorws = $this->checksmodel->getall($this->mwhere.' and `courseid`='.$courseid.'','checkid,checkname'); if($cheorws){ foreach($cheorws as $k=>$rs){ $lxss = $rs['checkid']; if(isempt($lxss) || $lxss=='0')continue; $cuid.=','.$lxss.''; $name.=','.$rs['checkname'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); return array($cuid, $name); } } if(!$this->isempt($crs['num'])){ $uarr = $this->flowcheckname($crs['num']); if(is_array($uarr)){ if(!$this->isempt($uarr[0]))return $uarr; } } if($type=='super' || $type=='superall'){ $cuid = $this->urs['superid']; $name = $this->urs['superman']; } if($type=='dept' || $type=='super' || $type=='superall'){ if($this->isempt($cuid) && $this->drs){ $cuid = $this->drs['headid']; $name = $this->drs['headman']; } } if($type=='apply'){ $cuid = $this->urs['id']; $name = $this->urs['name']; } if($type=='opt'){ $cuid = $this->rs['optid']; $name = $this->rs['optname']; if(isempt($cuid)){ $cuid = $this->urs['id']; $name = $this->urs['name']; } } if($type=='user'){ $cuid = $crs['checktypeid']; $name = $crs['checktypename']; } if($type=='rank'){ $rank = $crs['checktypename']; if(!$this->isempt($rank)){ $wheer1 = $this->adminmodel->getcompanywhere(5,'',$this->companyid); $rnurs = $this->db->getrows('[Q]admin',"`status`=1 and `ranking`='$rank' ".$wheer1."",'id,name','sort'); foreach($rnurs as $k=>$rns){ $cuid.=','.$rns['id'].''; $name.=','.$rns['name'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); } } } if($type=='cname'){ $cnbar = $this->cnamemodel->getcheckname($crs['checktypeid'], $this->uid); $cuid = arrvalue($cnbar, 0); $name = arrvalue($cnbar, 1); } if($type=='field'){ $fids = $crs['checktypeid']; if(!isempt($fids)){ $vals = ''; $farrs= explode(',', $fids); foreach($farrs as $fid){ $vid = arrvalue($this->rs, $fid); if(!isempt($vid))$vals.=','.$vid.''; } if($vals!=''){ $vals = substr($vals, 1); $uarr = $this->adminmodel->getrows('`status`=1 and `id` in('.$vals.')','id,name','FIELD(`id`,'.$vals.')'); foreach($uarr as $k=>$rs){ $cuid.=','.$rs['id'].''; $name.=','.$rs['name'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); } } } } $cuid = $this->rock->repempt($cuid); $name = $this->rock->repempt($name); return array($cuid, $name); } public function createbianhao($num, $fid, $wshu=3) { if(isempt($num))$num=''.$this->modenum.'-'; @$appdt = $this->rs['applydt']; if(isempt($appdt))$appdt = $this->rock->date; $apdt = str_replace('-','', substr($appdt,0,10)); $num = str_replace('Ymd',$apdt,$num); return $this->db->sericnum($num,'[Q]'.$this->mtable.'', $fid, $wshu); } public function createinputnum($num, $fid) { $acta = ''; if(method_exists($this, $num)){ $acta = $num; }else{ if(contain($num, ',')){ $arra = explode(',', $num); $acta = $arra[0]; $num = $arra[1]; } } if($acta && method_exists($this, $acta)){ $barr = $this->$acta($num); if(is_array($barr)){ $qom = arrvalue($barr, 'qom', $num); $wshu= arrvalue($barr, 'wshu', 3); $bom = arrvalue($barr, 'bom'); $fields = arrvalue($barr, 'fields', $fid); return $this->createbianhao($qom, $fields, $wshu).$bom; }else{ if(isempt($barr))$barr = $num; return $this->createbianhao($barr, $fid); } }else{ return $this->createbianhao($num, $fid); } } public function createnum() { $num = $this->moders['sericnum']; if($num=='鏃'||$this->isempt($num))$num='TM-Ymd-'; @$appdt = $this->rs['applydt']; if(isempt($appdt))$appdt = $this->rock->date; $apdt = str_replace('-','', $appdt); $num = str_replace('Ymd',$apdt,$num); return $this->db->sericnum($num,'[Q]flow_bill', 'sericnum', 3); } public function savebill($oarr=array()) { $dbs = $this->billmodel; $whes= $this->mwhere; $birs= $dbs->getone($whes); $arr = array( 'table' => $this->mtable, 'mid' => $this->id, 'optdt' => isset($this->rs['optdt']) ? $this->rs['optdt'] : $this->rock->now, 'optname' => arrvalue($this->rs,'optname', $this->adminname), 'optid' => arrvalue($this->rs,'optid', $this->adminid), 'modeid' => $this->modeid, 'updt' => $this->rock->now, 'isturn' => $this->rs['isturn'], 'nstatus' => $this->rs['status'], 'applydt' => $this->rs['applydt'], 'modename' => $this->modename, 'uname' => $this->rs['base_name'], 'udeptname' => $this->rs['base_deptname'], 'uid' => $this->uid, 'isdel' => '0', ); foreach($oarr as $k=>$v)$arr[$k]=$v; if(!$birs){ $arr['status'] = $arr['nstatus']; $arr['createdt']= $arr['optdt']; $arr['sericnum']= $this->createnum(); $arr['udeptid'] = $this->rock->post('sysudeptid', arrvalue($this->urs,'deptid')); $whes = ''; $this->sericnum = $arr['sericnum']; }else{ $udeptid = $birs['udeptid']; if($udeptid==0)$arr['udeptid']= arrvalue($this->urs,'deptid'); } $fstr = $this->rock->post('sysflow5str'); if($fstr)$arr['flow5str'] = $fstr; $dbs->record($arr, $whes); return $arr; } public function getsummary() { return $this->rock->reparr($this->moders['summary'], $this->rs); } public function addcheckname($courseid, $uid, $uname, $onbo=false, $addlx=0) { if(isempt($uid)){$uid = '0';$uname= 'auto';} $uida = explode(',', ''.$uid.''); $uidan = explode(',', $uname); if($onbo)$this->checksmodel->delete($this->mwhere.' and `courseid`='.$courseid.''); if($uida)foreach($uida as $k=>$uid){ $uname = $this->rock->arrvalue($uidan, $k); $zyarr = array( 'table' => $this->mtable, 'mid' => $this->id, 'modeid' => $this->modeid, 'courseid' => $courseid, 'optid' => $this->adminid, 'optname' => $this->adminname, 'addlx' => $addlx, 'optdt' => $this->rock->now, 'status' => 0 ); $this->checksmodel->delete($this->mwhere.' and `checkid`='.$uid.' and `courseid`='.$courseid.''); $zyarr['checkid'] = $uid; $zyarr['checkname'] = $uname; $this->checksmodel->insert($zyarr); } if($addlx==4)$this->checksmodel->delete($this->mwhere.' and `checkid`='.$this->adminid.' and `courseid`='.$courseid.''); } public function savedatastr($fval, $farr, $data=array()) { $str = ''; if(!$farr)return $str; $savewhere = $farr['savewhere']; $name = $farr['name']; $types = $farr['fieldstype']; if(isempt($savewhere) || isempt($fval))return $str; $savewhere = str_replace(array('{0}','{date}','{now}'), array($name, $this->rock->date,$this->rock->now), $savewhere); $savewhere = $this->rock->reparr($savewhere, $data); $saees = explode(',', $savewhere); if($types=='date' || $types=='datetime')$fval = strtotime($fval); if($types=='number')$fval = floatval($fval); foreach($saees as $saeess){ $fsaed = explode('|', $saeess); $msg = isset($fsaed[2]) ? $fsaed[2] : ''.$name.'鏁版嵁涓嶇鍙'; $val = isset($fsaed[1]) ? $fsaed[1] : ''; $lfs = $fsaed[0]; if($val != ''){ if($types=='date' || $types=='datetime')$val = strtotime($val); if($types=='number')$val = floatval($val); if($lfs=='gt'){$bo = $fval>$val;if(!$bo)return $msg;} if($lfs=='egt'){$bo = $fval>=$val;if(!$bo)return $msg;} if($lfs=='lt'){$bo = $fval<$val;if(!$bo)return $msg;} if($lfs=='elt'){$bo = $fval<=$val;if(!$bo)return $msg;} if($lfs=='eg'){$bo = $fval==$val;if(!$bo)return $msg;} if($lfs=='neg'){$bo = $fval!=$val;if(!$bo)return $msg;} } } return $str; } public function update($arr, $where) { if(is_array($arr)){ foreach($arr as $k=>$v)$this->rs[$k]=$v; } return parent::update($arr,$where); } public function updatelogvalid($whe) { $this->flogmodel->update('valid=0', $this->mwhere.' '.$whe); } public function strappend($sm, $str, $fh=',') { if(isempt($str))return $sm; if(!isempt($sm))$sm.=$fh; $sm.=$str; return $sm; } public function checkerror($lx=1,$sm='') { if($sm=='')$sm='鍗曟嵁寮傚父绠$悊鍛樺鐞'; $msg = $this->check($lx, $sm, 1); return $msg; } public function check($zt, $sm='', $lx=0) { if($this->rs['status']==1)return '娴佺▼宸插鐞嗗畬鎴,鏃犻渶鎿嶄綔'; $arr = $this->getflow(); $flowinfor = $this->getflowinfor(); if($flowinfor['ischeck']==0 && $lx==0)return '褰撳墠鏄痆'.$arr['nowcheckname'].']澶勭悊'; $nowcourse = $this->nowcourse; if($lx==1){ if($arr['nowcourseid']!=0)return '褰撳墠鏈夊鏍告楠D鏄瓨鍦ㄧ殑涓嶈兘鐩存帴鏍囪瘑宸插畬鎴'; $to = $this->flogmodel->rows($this->mwhere.' and `courseid`>0 and `status`=1'); if($to==0)return '璇ュ崟鎹病鏈変换浣曢氳繃瀹℃牳澶勭悊涓嶈兘鐩存帴鏍囪瘑宸插畬鎴愭垨宸插鏍'; $nowcourse = array('id'=>66666,'name'=>'寮傚父澶勭悊','step'=>0); } $nextcourse = $this->nextcourse; $zynameid = $this->rock->post('zynameid'); $zyname = $this->rock->post('zyname'); $csnameid = ''; $csname = ''; $nextname = $this->rock->post('nextname'); $nextnameid = $this->rock->post('nextnameid'); $qmimgstr = $this->rock->post('qmimgstr'); $tuiid = (int)$this->rock->post('tuiid'); $iszhuanyi = $ischangenext = 0; if($zt==1 && $this->isflow!=3 && isempt($zynameid) && arrvalue($nextcourse,'checktype')=='change'){ $ischangenext = 1; } if($zt!=2)$tuiid = 0; $istongyi = in_array($zt, $this->flowstatusarr); if($zynameid!='' && $istongyi){ if($zynameid==$this->adminid)return '涓嶈兘杞粰鑷繁'; $sm = $this->strappend($sm, '杞粰锛'.$zyname.''); $iszhuanyi = 1; $this->rs['syszb_name'] = $zyname; $this->rs['syszb_nameid'] = $zynameid; } if($nextnameid=='' && $ischangenext==1)return '璇烽夋嫨涓嬩竴姝ュ鐞嗕汉'; $ufied = array(); if($iszhuanyi == 0 && $zt!=2){ foreach($flowinfor['checkfields'] as $chef=>$chefv){ $ufied[$chef] = $_val = $this->rock->post('cfields_'.$chef.''); if(isempt($_val) && $chefv['isbt']=='1')$this->echomsg(''.$chefv['name'].'涓嶈兘涓虹┖'); $_stype = arrvalue($chefv, 'fieldstype'); if($_stype=='graph')$ufied[$chef] = c('input')->createqianming($_val); $_str = $this->savedatastr($_val, $chefv['fieldsarr'], $this->rs); if($_str!='')$this->echomsg($_str); } } $this->checkiszhuanyi = $iszhuanyi; $barr = $this->flowcheckbefore($zt, $ufied, $sm); $msg = ''; if(is_array($barr) && isset($barr['msg']))$msg = $barr['msg']; if(is_array($barr) && isset($barr['update'])){ foreach($barr['update'] as $_k=>$_v)$ufied[$_k] = $_v; } if(is_string($barr))$msg = $barr; if(!isempt($msg))return $msg; if($ufied){ $bo = $this->update($ufied, $this->id); if(!$bo)return 'dberr:'.$this->db->error(); } $courseact = $flowinfor['courseact']; $act = $courseact[$zt]; $statusname = $act[0]; $statuscolor= $act[1]; $nzt = $act[2]; $courseid = $nowcourse['id']; $this->checksmodel->update('`status`='.$zt.'', $this->mwhere.' and `checkid`='.$this->adminid.' and `courseid`='.$courseid.''); if($iszhuanyi == 1){ $this->addcheckname($courseid, $zynameid, $zyname, false, 4); $nowcourse['id'] = 0; } if($ischangenext==1){ $this->addcheckname($nextcourse['id'], $nextnameid, $nextname, true, 1); } $tuirs = array(); if($tuiid > 0)$tuirs = $this->flogmodel->getone($tuiid); if(!$tuirs)$tuiid = 0; if($tuiid>0){ $sm = $this->strappend($sm, '閫鍥炲埌['.$tuirs['name'].'('.$tuirs['checkname'].')]'); $statusname = '閫鍥'; $statuscolor = '#17B2B7'; } $this->checkistui = $tuiid; $logsm = $sm; if($iszhuanyi==0 && $csname)$logsm = $this->strappend($logsm,'鎶勯佺粰锛'.$csname.''); $this->lastlogid = $this->addlog(array( 'courseid' => $nowcourse['id'], 'name' => $nowcourse['name'], 'step' => $nowcourse['step'], 'status' => $zt, 'statusname'=> $statusname, 'color' => $statuscolor, 'explain' => $logsm, 'iszb' => $iszhuanyi, 'qmimg' => $qmimgstr )); if($tuiid > 0){ $this->addcheckname($tuirs['courseid'], $tuirs['checkid'], $tuirs['checkname'], true, 3); $this->updatelogvalid('and `courseid`>0 and `status`=1 and `step`>='.$tuirs['step'].''); } $lzt = $this->rock->repempt($nzt, $zt); $uparr = $nexttodoarr = $nexttodoarc = array(); $bsarr = $this->getflow(); $bsarr['tuiid'] = $tuiid; $nextcheckid = $bsarr['nowcheckid']; if($istongyi){ if($iszhuanyi==0){ $uparr['status']= $this->rock->repempt($nzt,'0'); } $nexttodoarr = array($nextcheckid, 'next', $sm, $statusname); }else{ if($tuiid>0){ $lzt = 23; $nexttodoarr = array($nextcheckid, 'tui', $sm, $statusname); }elseif($zt==2){ $nexttodoarr = array($this->optid, 'nothrough', $sm, $statusname); } $uparr['status'] = $lzt; } $this->flowcheckafter($zt, $sm, $nowcourse); $bsarr['nstatus'] = $lzt; $bsarr['checksm'] = $sm; if(!$this->nowcourse){ $uparr['status'] = $lzt; $nexttodoarc = array($this->optid, 'finish', $sm, ''); } if($uparr){ $this->update($uparr, $this->id); } if(!$this->nowcourse){ $this->flowcheckfinsh($zt); if($istongyi){ $this->checksmodel->delete($this->mwhere); } } $bsarr['status'] = $this->rs['status']; $this->getflowsave($bsarr, true); if($this->db->backsql()){ $bos = ($courseid == arrvalue($this->nowcourse, 'id') && $istongyi); if($nexttodoarr && (!$bos || $iszhuanyi==1))$this->nexttodo($nexttodoarr[0],$nexttodoarr[1],$nexttodoarr[2],$nexttodoarr[3]); if($nexttodoarc)$this->nexttodo($nexttodoarc[0],$nexttodoarc[1],$nexttodoarc[2],$nexttodoarc[3]); } if($iszhuanyi == 1){ $this->gettodosend('bozhuan','', $sm, 0, ''.$this->adminname.'灏哰'.$nowcourse['name'].']杞粰:'.$zyname.''); }else{ if($istongyi)$this->gettodosend('botong', $statusname, $sm, $nowcourse['id']); if($zt==2)$this->gettodosend('bobutong',$statusname, $sm, $nowcourse['id']); if(!$this->nowcourse && $istongyi)$this->gettodosend('bofinish', '', $sm); } if($iszhuanyi==0){ $sm1 = '鍦ㄢ'.$nowcourse['name'].'鈥濆鐞'.$statusname.''; $this->savecsname($csnameid,$csname,$this->adminid,$nowcourse['id'],1, $sm1); } return 'ok'; } public function pushs($receid, $cont, $title='', $params=array()) { return $this->push($receid,'', $cont, $title, 0, $params); } public function getxiangurl($num='', $id=0, $lx='x') { if($num=='')$num = $this->modenum; if($id==0)$id = $this->id; $url = URL; if($lx=='auto')$lx = ($this->ismobile==1)?'x':'p'; if($lx=='x' || $lx=='a')$url = $this->rock->getouturl(); $url = ''.$url.'task.php?a='.$lx.'&num='.$num.'&mid='.$id.''; if(COMPANYNUM)$url.='&dwnum='.COMPANYNUM.''; return $url; } public function getxiangurlx($num='',$id=0){return $this->getxiangurl($num,$id,'x');} public function push($receid, $gname='', $cont='', $title='', $wkal=0, $params=array()) { if(isempt($receid) && $wkal==1)$receid='all'; if(isempt($receid))return false; if(contain(','.$receid.',', ',d1,'))$receid='all'; $modenum = arrvalue($params, 'modenum', $this->modenum); $modename = arrvalue($params, 'modename', $this->modename); $id = (int)arrvalue($params, 'id', $this->id); $moders = arrvalue($params, 'moders'); if(!is_array($moders))$moders = $this->moders; if($gname=='')$gname = $modename; $reim = m('reim'); $url = $this->getxiangurl($modenum, $id, 'p'); $wxurl = $this->getxiangurl($modenum, $id, 'x'); $emurl = $this->getxiangurl($modenum, $id, 'a'); if($id==0){ $url = '';$wxurl = '';$emurl=''; } $url = arrvalue($params, 'url', $url); $wxurl = arrvalue($params, 'wxurl', $wxurl); $emurl = arrvalue($params, 'emurl', $emurl); $slx = 0; $pctx = $moders['pctx']; $mctx = $moders['mctx']; $wxtx = $moders['wxtx']; $ddtx = $moders['ddtx']; $emtx = $moders['emtx']; if($pctx==0 && $mctx==1)$slx=2; if($pctx==1 && $mctx==0)$slx=1; if($pctx==0 && $mctx==0)$slx=3; $this->rs['now_adminname'] = $this->adminname; $this->rs['now_modename'] = $modename; $cont = $this->rock->reparr($cont, $this->rs); $receido= $receid; $receid = $this->adminmodel->gjoins($receid); $uids = m('todo')->addtodo($receid, $modename, $cont, $modenum, $id); if($uids!='' && $moders['type'] != '绯荤粺' && $id > 0)$this->todosmodel->addtotouids($uids, array( 'table' => $moders['table'], 'mid' => $id, 'modename' => $modename, 'modenum' => $modenum, )); $title = $this->rock->reparr($title, $this->rs); $reim->pushagent($uids, $gname, $cont, $title, $url, $wxurl, $slx, ''.$modenum.'|'.$id.''); $this->flowchangetodo($uids, $gname); if(isempt($title))$title = $modename; $this->flowweixinarr=array(); return $receid; } public function nexttodo($nuid, $type, $sm='', $act='') { $cont = ''; $tit = ''; $gname = '娴佺▼寰呭姙'; $summary= $this->getsummary(); if($type=='submit' || $type=='next' || $type == 'cuiban'){ $cont = '浣犳湁['.$this->uname.']鐨刐'.$this->modename.',鍗曞彿:'.$this->sericnum.']闇瑕佸鐞'; if($sm!='')$cont.='锛岃鏄:'.$sm.''; $tit = ''.$this->uname.'鐨'.$this->modename.''; if($type != 'cuiban'){ $txnum = $this->option->getval('sms_txnum'); if(!isempt($txnum)){ $mknum = $this->option->getval('sms_mknum'); if($mknum=='all' || contain(','.$mknum.',',','.$this->modenum.',')){ $wxurl = $this->getxiangurlx(); $barr = c('xinhuapi')->sendsms($nuid, '', $txnum, array( 'modename' => $this->modename, 'sericnum' => $this->sericnum, 'applyname'=> $this->uname, 'deptname' => $this->rs['base_deptname'], ),$wxurl); } } } $type = 'daiban'; } if($type == 'nothrough'){ $cont = '浣犳彁浜'.$this->modename.',鍗曞彿:'.$this->sericnum.']'.$this->adminname.'澶勭悊['.$act.']锛屽師鍥:['.$sm.']'; $gname= '娴佺▼鐢宠'; $tit = ''.$this->modename.'澶勭悊'.$act.''; } if($type == 'finish'){ $cont = '浣犳彁浜ょ殑['.$this->modename.',鍗曞彿:'.$this->sericnum.']宸插叏閮ㄥ鐞嗗畬鎴'; $gname= '娴佺▼鐢宠'; $tit = ''.$this->modename.'鍏ㄩ儴澶勭悊瀹屾垚'; } if($type == 'zhui'){ $cont = ''.$this->adminname.'杩藉姞鍗曟嵁璇存槑['.$this->modename.',鍗曞彿:'.$this->sericnum.']锛岃鏄:['.$sm.']'; } if($type == 'tui'){ $cont = '['.$this->adminname.']閫鍥炲崟鎹甗'.$this->modename.',鍗曞彿:'.$this->sericnum.']鍒颁綘杩欒鍙婃椂澶勭悊锛岃鏄:'.$sm.''; } if($type == 'chao'){ $cont = ''.$this->adminname.''.$sm.'浜嗏'.$this->modename.'鈥'; if(!isempt($summary))$cont.='锛屾憳瑕佲'.$summary.'鈥'; if($this->isflow>0)$cont.='锛屽崟鍙封'.$this->sericnum.'鈥'; $gname= ''; $tit = ''.$this->modename.'鐨勫崟鎹妱閫'; } if($type=='pinglun'){ $cont = ''.$this->adminname.''.$act.'浣犵殑['.$this->modename.']鍗曟嵁锛岃鏄:'.$sm.''; $gname = ''; $tit = ''.$this->modename.'璇勮'; } if($type=='receipt'){ $cont = ''.$this->adminname.''.$act.'['.$this->modename.']鐨勫崟鎹'; if($sm!='')$cont.='锛岃鏄:'.$sm.''; $gname = '鍥炴墽纭'; $tit = ''.$this->modename.'鍥炴墽纭'; } $nbis = $this->flownexttodo($type); if($nbis){ if(is_string($nbis))$cont = $nbis; if(is_array($nbis)){ $tit = arrvalue($nbis, 'title', $tit); $gname = arrvalue($nbis, 'gname', $gname); $cont = arrvalue($nbis, 'cont', $cont); } } if($cont!='')$this->push($nuid, $gname, $cont, $tit); } public function getwxurl($num='') { if($num=='')$num = $this->modenum; $url = $this->rock->getouturl(); $str = ''.$url.'?m=ying&d=we&num='.$num.''; return $str; } public function getweurl($num='') { if($num=='')$num = $this->modenum; $url = $this->rock->getouturl(); $str = ''.$url.'?m=ying&d=we&mnum='.$num.''; return $str; } public function deletebill($sm='', $qxpd=true) { if(getconfig('systype')=='demo')return '婕旂ず璇峰嬁鍒犻櫎'; if($qxpd){ $is = $this->isdeleteqx(); if($is==0)return '鏃犳潈鍒犻櫎'; } if(method_exists($this,'flowdeletebillbefore')){ $bstr = $this->flowdeletebillbefore($sm); if(!isempt($bstr))return $bstr; } $modewhere = "`modenum`='".$this->modenum."' and `mid`=".$this->id.""; $this->flogmodel->delete($this->mwhere); m('reads')->delete($this->mwhere); m('file')->delfile('', "`mtype`='".$this->mtable."' and `mid`=".$this->id." and `id` not in(select `fileid` from `[Q]files` where `type`=3)"); $tables = $this->moders['tables']; if(!isempt($tables)){ $arrse = explode(',', $tables); foreach($arrse as $arrses)m($arrses)->delete('mid='.$this->id.''); } $this->billmodel->delete($this->mwhere); $this->todosmodel->delete($this->mwhere); $this->checksmodel->delete($this->mwhere); $this->chaomodel->delete($this->mwhere); m('remind')->delete($this->mwhere); m('todo')->delete($this->mwhere); m('todo')->delete($modewhere); m('receipt')->delete($this->mwhere); m('im_history')->delete("`xgurl`='".$this->modenum."|".$this->id."'"); m('files')->delete("`ip`='".$this->modenum."|".$this->id."'"); $this->delete($this->id); $this->flowdeletebill($sm); $this->flowzuofeibill($sm); $this->gettodosend('bodel','', $sm); $dels = '鍒犻櫎妯″潡['.$this->modename.']id涓'.$this->id.'鐨勫崟鎹'; $ztss = arrvalue($this->rs,'base_summary'); if(!isempt($ztss))$dels.=',鎽樿['.$ztss.']'; if(!isempt($sm))$dels.=',璇存槑:'.$sm.''; m('log')->addlogs('鍒犻櫎鍗曟嵁', $dels, 3); foreach($this->wherejoin as $num=>$fields){ $this->deletebilljoin($num, "`$fields`='$this->id'", $sm); } return 'ok'; } public function deletebilljoin($num, $where, $sm='') { $flow = m('flow')->initflow($num); $rows = $flow->getall($where); foreach($rows as $k1=>$rs1){ $mid = $rs1['id']; $flow->loaddata($mid, false); $flow->deletebill($sm, false); } } public function zuofeibilljoin($num, $where, $sm='') { $flow = m('flow')->initflow($num); $rows = $flow->getall($where); foreach($rows as $k1=>$rs1){ $mid = $rs1['id']; $flow->loaddata($mid, false); $flow->zuofeibill($sm); } } public function zuofeibill($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '浣滃簾', 'status' => 1, )); $this->update('`status`=5', $this->id); $zfarr = array( 'status' => 5, 'nstatus' => 5, 'checksm' => '浣滃簾锛'.$sm.'', 'nowcheckid' => '', 'nowcheckname' => '', 'nstatustext' => '浣滃簾', 'updt' => $this->rock->now, ); $this->billmodel->update($zfarr, $this->mwhere); $tables = $this->moders['tables']; if(!isempt($tables)){ $arrse = explode(',', $tables); foreach($arrse as $arrses)m($arrses)->delete('mid='.$this->id.''); } $this->flowzuofeibill($sm); $this->gettodosend('bozuofei','', $sm); foreach($this->wherejoin as $num=>$fields){ $this->zuofeibilljoin($num, "`$fields`='$this->id'", $sm); } return 'ok'; } public function openxiang() { $xiangdata = $btndata = array(); $data = $this->flowrsreplace($this->rs,4); foreach($this->fieldsarra as $k=>$rs){ if($rs['iszs']=='1'){ $xiangdata[] = array( 'name' => $rs['name'], 'fields'=> $rs['fields'], 'value' => $this->rock->repempt(arrvalue($data,$rs['fields'])) ); } } $barr['xiangdata'] = $xiangdata; $btnrows = $this->db->getrows('[Q]flow_menu',"`setid`='$this->modeid' and `status`=1 and `num` like 'open%'",'id,wherestr,name,num,issm,type','`sort`'); foreach($btnrows as $k=>$rs){ $wherestr = $rs['wherestr']; $bo = false; if(isempt($wherestr)){ $bo = true; }else{ $ewet = $this->wheremodel->getstrwhere($this->rock->jm->base64decode($wherestr)); $ewet = str_replace(array('{asqom}','1=2 and'),'', $ewet); $tos = $this->rows("`id`='$this->id' and $ewet"); if($tos>0)$bo = true; } if($bo)$btndata[] = array( 'id' => $rs['id'], 'name' => $rs['name'], 'issm' => $rs['issm'], ); } $barr['btndata'] = $btndata; if(method_exists($this,'flowopenxiang')){ $lbarr = $this->flowopenxiang($data,$xiangdata,$btndata); if(is_array($lbarr))foreach($lbarr as $k=>$v)$barr[$k]=$v; } return $barr; } public function smschuiban($sm='') { if($this->isflow>0 && $this->adminid==$this->uid){ $farr = $this->getflow(true); $nowcheckid = $farr['nowcheckid']; $tplnum = $this->option->getval('sms_cbnum','defnum'); $wxurl = $this->getxiangurlx(); $barr = c('xinhuapi')->sendsms($nowcheckid, '', $tplnum, array( 'modename' => $this->modename, 'sericnum' => $this->sericnum, 'applyname'=> $this->uname, 'deptname' => $this->rs['base_deptname'], ),$wxurl, false, false); if(!$barr['success'])return $barr['msg']; $this->addlog(array( 'explain' => $sm, 'name' => '鐭俊鍌姙', 'status' => 1, )); } return 'ok'; } public function reloadflow($sm='') { $this->update(array('status'=>0), $this->id); $this->flogmodel->update('`valid`=0', ''.$this->mwhere.' and `courseid`>0'); $this->addlog(array( 'explain' => $sm, 'name' => '閲嶆柊瀹℃壒', 'status' => 1, )); $this->getflow(true); $this->billmodel->update('`status`=0,`nstatus`=0',$this->mwhere); return 'ok'; } public function addschedule($sm='') { $txdt = $this->rock->post('txdt'); if(isempt($sm))return '璇存槑涓嶈兘涓虹┖'; if(isempt($txdt))return '鎻愰啋鏃堕棿涓嶈兘涓虹┖'; $barr['title'] = $sm; $barr['startdt'] = $txdt; $barr['uid'] = $this->adminid; $barr['optdt'] = $this->rock->now; $barr['optname']= $this->adminname; $barr['txsj'] = 1; m('schedule')->insert($barr); return 'ok'; } public function getoptmenu($flx=0) { $where = ''; if($flx==1)$where='and `iszs`=1'; $rows = $this->db->getrows('[Q]flow_menu',"`setid`='$this->modeid' ".$where." and `status`=1",'id,wherestr,name,statuscolor,statusvalue,num,islog,issm,type,upgcont','`sort`'); $arr = array(); $bfrom = $this->rock->post('bfrom'); if($flx==0)$arr[] = array('lx'=>0,'name'=>$this->rock->jm->base64decode('5pyq562!5o6I5peg5rOV5pi!56S66I!c5Y2V5aaC5bey562!5o6I5Y675Y2H57qn'),'optmenuid'=>0,'color'=>'red'); if($flx==1)return $arr; $status = (int)arrvalue($this->rs,'status','0'); $isturn = (int)arrvalue($this->rs, 'isturn','0'); $ismy = ($this->uid == $this->adminid or $this->optid == $this->adminid); $isreadbo = $this->isreadqx(1); if($this->isflow>0 && $isturn==1){ } if($status != 5 && arrvalue($this->moders,'ispl','1')=='1' && $isreadbo){ $arr[] = array('name'=>lang('璇勮'),'lx'=>15,'nup'=>1,'issm'=>1,'optmenuid'=>-15); } if($ismy && arrvalue($this->moders,'ishz')=='1' && $status==1){ $smcont = $this->getsummary(); $mid = (int)m('receipt')->getmou('id',"`uid`='$this->adminid' and `modenum`='$this->modenum' and `mid`='$this->id'"); $namess = '鍥炴墽纭璁剧疆'; if($mid>0)$namess = '鍥炴墽纭缂栬緫'; $arr[] = array('name'=>$namess,'djmid'=>$mid,'optnum'=>'receipt','lx'=>'18','optmenuid'=>-18,'modename'=>$this->modename,'smcont'=>$smcont); } if($isreadbo && arrvalue($this->moders,'istxset','1')=='1' && $this->modenum != 'remind' && !in_array($status, array(2,5))){ $smcont = ''.$this->modename.'锛'.$this->getsummary(); $mid = (int)m('remind')->getmou('id',"`uid`='$this->adminid' and `modenum`='$this->modenum' and `mid`='$this->id'"); $namess = '锛嬫坊鍔犳彁閱掕缃'; if($mid>0)$namess = '鎻愰啋璁剧疆缂栬緫'; $arr[] = array('name'=>$namess,'djmid'=>$mid,'smcont'=>$smcont,'issm'=>1,'optnum'=>'tixing','lx'=>'14','optmenuid'=>-14); } if($this->iseditqx()==1 && $isreadbo){ $arr[] = array('name'=>lang('缂栬緫'),'optnum'=>'edit','lx'=>'11','optmenuid'=>-11); } if($this->isdeleteqx()==1){ $arr[] = array('name'=>lang('鍒犻櫎'),'color'=>'red','optnum'=>'del','nup'=>1,'issm'=>0,'islog'=>0,'statusvalue'=>9,'lx'=>'9','optmenuid'=>-9); } if(method_exists($this,'flowgetoptmenuarr')){ $lbarr = $this->flowgetoptmenuarr($flx); if(is_array($lbarr))foreach($lbarr as $k=>$v)$arr[]=$v; } return $arr; } public function optmenu($czid, $zt, $sm='') { $msg = ''; $cname = $this->rock->post('changename'); $cnameid = $this->rock->post('changenameid'); $cdate = $this->rock->post('changedate'); $darr = array( 'cname' => $cname, 'cnameid' => $cnameid, 'cdate' => $cdate, 'sm' => $sm, ); if($czid==-9){ $msg = $this->deletebill($sm); }else if($czid==-10){ $msg = $this->check($zt, $sm); if(contain($msg,'鎴愬姛'))$msg = 'ok'; }else if($czid==-12){ $this->zhuijiaexplain($sm); }else if($czid==-13){ $this->chuiban($sm); }else if($czid==-14){ $msg = $this->addschedule($sm); }else if($czid==-15){ $actname = $this->rock->post('name'); $this->addlog(array( 'explain' => $sm, 'name' => $actname, )); $uids = ''; if(isset($this->rs['uid'])){ $uids= $this->rs['uid']; }else if(isset($this->rs['optid'])){ $uids= $this->rs['optid']; } if($uids)$this->nexttodo($uids, 'pinglun', $sm, $actname); $this->gettodosend('boping','', $sm); }else if($czid==-16){ $this->zuofeibill($sm); }else if($czid==-17){ $msg = $this->smschuiban($sm); }else if($czid==-18){ $msg = $this->jiankongzb($darr); }else if($czid==-19){ $msg = $this->reloadflow($sm); }else{ } if($msg=='')$msg='ok'; return $msg; } public function jiankongzb($darr) { return $this->bd6('5peg5L!h5ZG8562!5o6I5peg5q2k5Yqf6IO9'); } public function billwhere($uid, $lx) { $arr['table'] = $this->mtable; $arr['tableleft'] = ''; $arr['fields'] = ''; $arr['order'] = ''; $arr['group'] = ''; $arr['keywhere']= ''; $arr['asqom'] = ''; $arr['onlywhere'] = ''; $arr['companywhere']= ''; $this->atype = $lx; $nas = $this->flowbillwhere($uid, $lx); $inwhere = ''; if(substr($lx,0,5)=='grant'){ $inwhere = $this->viewmodel->viewwhere($this->moders, $this->adminid, $this->flowviewufieds, 1); } if($lx=='chaos'){ $inwhere = "and {asqom}`id` in(select `mid` from `[Q]flow_chao` where `table`='{$this->mtable}' and ".$this->rock->dbinstr('csnameid', $this->adminid).")"; } if($lx=='mychuli'){ $inwhere = "and {asqom}`id` in(select bill.`mid` from `[Q]flow_bill` as `bill` where bill.`modeid`='{$this->modeid}' and ".$this->rock->dbinstr('bill.`allcheckid`', $this->adminid).")"; } $_wehs = ''; if(is_array($nas)){ if(isset($nas['where']))$_wehs = $nas['where']; $ftears = explode(',','asqom,order,fields,fieldsleft,table,group,companywhere,onlywhere,keywhere,tableleft'); foreach($ftears as $fid)if(isset($nas[$fid]))$arr[$fid] = $nas[$fid]; }else{ $_wehs = $nas; } $fwhere = $this->getflowwhere($uid, $lx); $path = ''.P.'/flow/page/rock_page_'.$this->modenum.'.php'; $table = $arr['table']; $temsao = 0; if(!contain($table, ' ') && $this->isflow>0){ $arr['table'] = '`[Q]'.$this->mtable.'` a left join `[Q]flow_bill` b on a.`id`=b.`mid` and b.`table`=\''.$this->mtable.'\''; if(!isempt($arr['tableleft']))$arr['table'].=' left join '.$arr['tableleft'].''; $arr['asqom'] = 'a.'; $arr['fields']= 'a.*,b.`uname` as base_name,b.`udeptname` as base_deptname,b.`sericnum`,b.`nowcheckname`'; if(isset($arr['fieldsleft']) && $arr['fieldsleft'])$arr['fields'].=','.$arr['fieldsleft'].''; if($arr['order']=='')$arr['order'] = 'a.`optdt` desc'; $temsao = 1; if($this->defaultorder){ $defa = explode(',', $this->defaultorder); $desc = arrvalue($defa, 1, 'desc'); $arr['order'] = 'a.`'.$defa[0].'` '.$desc.''; } } if(isempt($arr['order'])){ $arr['order'] = '{asqom}`id` desc'; if($this->defaultorder){ $defa = explode(',', $this->defaultorder); $desc = arrvalue($defa, 1, 'desc'); $arr['order'] = '{asqom}`'.$defa[0].'` '.$desc.''; } } if(isempt($fwhere) && isempt($inwhere) && $this->moders['isscl']>0){ $fwhere = 'and 1=2'; } $where = $inwhere; $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $where .= ' and {asqom}'.$wherestr; } if($fwhere!='')$where .= ' '.$fwhere; if($_wehs!='')$where .= ' '.$_wehs; $highwhere = $this->gethighwhere(); $allfields = array(); $key = $this->rock->post('key'); $pnum = $this->rock->post('pnum'); $status = $this->rock->post('keystatus'); $ztfields = arrvalue($nas, 'ztfields', 'status'); $xhlikea = array('like','=','>=','<=', 'not like'); $xhfields = $this->rock->post('xhfields'); $xhlike = (int)$this->rock->post('xhlike','0'); $xhkeygj = $this->rock->jm->base64decode($this->rock->post('xhkeygj')); if(!isempt($xhkeygj) && $xhfields){ if(substr($xhfields,0,2)=='zb'){ $xu = substr($xhfields,2,1); $zbasr = explode(',', $this->moders['tables']); $zbts = arrvalue($zbasr,$xu); $xhfields = substr($xhfields,4); $wher1 = "`$xhfields` ".$xhlikea[$xhlike].""; if($xhlike==0 || $xhlike==4)$wher1.=" '%".$xhkeygj."%'"; if($xhlike==1 || $xhlike==2 || $xhlike==3)$wher1.=" '$xhkeygj'"; $wher1 = " and {asqom}`id` in(select `mid` from `[Q]".$zbts."` where ".$wher1.")"; $where.= $wher1; }else{ $wher1 = " and {asqom}`$xhfields` ".$xhlikea[$xhlike].""; if($xhlike==0 || $xhlike==4)$wher1.=" '%".$xhkeygj."%'"; if($xhlike==1 || $xhlike==2 || $xhlike==3)$wher1.=" '$xhkeygj'"; $where.= $wher1; } } if(!isempt($status))$where .= ' and {asqom}`'.$ztfields.'`='.$status.''; if(!isempt($key) && isempt($arr['keywhere'])){ $check = c('check'); $allfields = $this->db->getallfields('[Q]'.$this->mtable.''); $_kearr = array(); if($check->isdate($key) || $check->ismonth($key)){ $skeay = array('date','datetime','month'); foreach($this->fieldsarra as $k=>$rs){ $flx = $rs['fieldstype']; $fid = $rs['fields']; if($rs['issou']==1 && in_array($flx, $skeay) && in_array($fid, $allfields)){ if($check->isdate($key)){ if($flx=='date')$_kearr[] = "{asqom}`".$fid."`='$key'"; if($flx=='datetime')$_kearr[] = "{asqom}`".$fid."` like '$key%'"; if($flx=='month')$_kearr[] = "{asqom}`".$fid."`='".substr($key,0,7)."'"; if($temsao==1){ $_kearr[] = "b.`applydt`='$key'"; } } if($check->ismonth($key)){ if($flx=='month'){ $_kearr[] = "{asqom}`".$fid."`='$key'"; }else{ $_kearr[] = "{asqom}`".$fid."` like '$key%'"; } if($temsao==1){ $_kearr[] = "b.`applydt` like '$key%'"; } } } } } if(!$_kearr){ $skeay = array('text','textarea','htmlediter','changeuser','changeusercheck','changedept','changedeptusercheck','selectdatafalse','selectdatatrue','num'); $xiakk = array('rockcombo','select'); foreach($this->fieldsarra as $k=>$rs){ if($rs['issou']==1 && in_array($rs['fields'], $allfields) && substr($rs['fields'],-2) != 'dt'){ if(in_array($rs['fieldstype'], $skeay))$_kearr[] = "{asqom}`".$rs['fields']."` like '%".$key."%'"; } } if($temsao==1){ $_kearr[] = "b.`uname` like '%".$key."%'"; $_kearr[] = "b.`udeptname` like '%".$key."%'"; $_kearr[] = "b.`sericnum` = '$key'"; $_kearr[] = "b.`nowcheckname` = '$key'"; } if(isset($nas['orlikefields'])){ $owhee = explode(',', $nas['orlikefields']); foreach($owhee as $owhees){ $_owhees = explode('@', $owhees); $sle = arrvalue($_owhees, 1); if($sle=='1'){ $_kearr[] = "".$_owhees[0]." ='$key'"; }else{ $_kearr[] = "".$_owhees[0]." like '%".$key."%'"; } } } } if($_kearr && $arr['onlywhere']=='')$arr['keywhere'] = "and (".join(' or ',$_kearr).")"; } if(!isempt($arr['companywhere']) && getconfig('companymode'))$where .= ' '.$arr['companywhere']; if(!isempt($arr['onlywhere']))$where .= ' '.$arr['onlywhere']; if(!isempt($arr['keywhere']))$where .= ' '.$arr['keywhere']; if($highwhere!='')$where .= ' '.$highwhere; $where = str_replace('{asqom}', $arr['asqom'], $where); $arr['order'] = str_replace('{asqom}', $arr['asqom'], $arr['order']); $where = str_replace('[A]', $arr['asqom'], $where); $fields = $arr['fields']; if($this->flowfieldstype==1 && (isempt($fields) || $fields=='*') && $this->moders['isscl']>0){ if(!$allfields)$allfields = $this->db->getallfields('[Q]'.$this->mtable.''); $fields = '{asqom}`id`'; $odlvs = $this->option->getval('columns_'.$this->modenum.'_'.$pnum.''); if(isempt($odlvs)){ foreach($this->fieldsarra as $k=>$rs){ if($rs['islb']==1 && in_array($rs['fields'],$allfields)){ $fields.=',{asqom}`'.$rs['fields'].'`'; } } }else{ $odlvsa = explode(',', $odlvs); foreach($odlvsa as $odlvs1){ if(in_array($odlvs1, $allfields)){ $fields.=',{asqom}`'.$odlvs1.'`'; } } } if($this->isflow>0){ if(!contain($fields,'`status`'))$fields.=',{asqom}`status`'; } $fields = str_replace('{asqom}', $arr['asqom'], $fields); $arr['fields'] = $fields; } $fields = $arr['fields']; if(!isempt($fields) && $fields!='*'){ $fieldsa = explode(',', $fields); $fieldss = ''; foreach($fieldsa as $fieldsas){ if(contain($fieldsas,'`') || contain($fieldsas,'.') || contain($fieldsas,' ') || contain($fieldsas,'(')){ $fieldss.=','.$fieldsas.''; }else{ $fieldss.=',`'.$fieldsas.'`'; } } $arr['fields'] = substr($fieldss, 1); } $arr['where'] = str_replace('{asqom}','', $where); return $arr; } public function gethighwhere() { $s = ''; return $s; } public function getflowwhere($uid, $num) { $where = ''; $rs = $this->wheremodel->getone("`setid`='$this->modeid' and `num`='$num'"); if(!$rs)return $where; $where = $this->wheremodel->getwherestr($rs, $uid, $this->flowviewufieds); return $where; } public function getflowrows($uid, $lx, $limit=5, $swher='') { $nas = $this->billwhere($uid, $lx); $table = $nas['table']; if(!contain($table,' '))$table='[Q]'.$table.''; if(isempt($nas['fields']))$nas['fields'] = '*'; $swher = str_replace('{asqom}',$nas['asqom'], $swher); $where = '1=1 '.$nas['where'].' '.$swher.''; if($limit==0)return $this->db->rows($table, $where ); $rows = $this->db->getrows($table, $where , $nas['fields'], $nas['order'], $limit); foreach($rows as $k=>$rs){ $rows[$k] = $this->flowrsreplace($rs, 2); } return $rows; } public function gettodorows($whereid) { $where = $this->wheremodel->getwherestr($whereid, $this->adminid, $this->flowviewufieds); $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $where .= ' and '.$wherestr; } $where = str_replace('{asqom}','', $where); $rows = $this->getall('2=2 '.$where.''); foreach($rows as $k=>$rs){ $rows[$k] = $this->flowrsreplace($rs, 1); } return $rows; } public function printexecl($event) { $arr['moders'] = $this->moders; $arr['fields'] = $this->getfields(); $cell = 1; foreach($arr['fields'] as $k=>$v)$cell++; $arr['cell'] = $cell; $where = '1=1'; $str1 = $this->moders['where']; if(!isempt($str1)){ $str1 = $this->rock->covexec($str1); $where = $str1; } $vwhere = $this->viewmodel->viewwhere($this->moders, $this->adminid); $rows = $this->getrows(''.$where.' '.$vwhere.'', '*', 'id desc', 100); $arr['rows'] = $this->flowprintrows($rows); $arr['count'] = $this->db->count; return $arr; } public function getsuballdata($lx=0, $mid=0) { $tabless = $this->moders['tables']; $subdata = array(); if($mid==0)$mid = $this->id; if(!isempt($tabless)){ $tablessa = explode(',', $tabless); $namessa = explode(',', $this->moders['names']); $tabless1 = '['.str_replace(',','],[', $tabless).']'; foreach($tablessa as $zbx=>$tables){ $cis = substr_count($tabless1, '['.$tables.']'); $whes = ''; if($cis>1)$whes=' and `sslx`='.$zbx.''; $data = m($tables)->getall('mid='.$mid.''.$whes.'','*','`sort`'); $data = $this->flowsubdata($data, $lx, $zbx); if($lx == 0){ $subdata['subdata'.$zbx.''] = $data; }else{ $subdata[$zbx] = array( 'data' => $data, 'fields'=> 'subdata'.$zbx.'', 'name' => $this->rock->arrvalue($namessa, $zbx) ); } } } return $subdata; } private $gettodolistarr = null; public function gettodolist($act) { if(is_array($act))return $act; if($this->gettodolistarr === null){ $rows = $this->todomodel->getrows("`setid`='".$this->modeid."' and `status`=1"); $barr = array(); foreach($rows as $k=>$rs){ $whereid = (int)$rs['whereid']; if($whereid > 0){ $bo = $this->wheremanzhu($whereid); if(!$bo)continue; } $barr[] = $rs; } $this->gettodolistarr = $barr; }else{ $barr = $this->gettodolistarr; } $garr = array(); if($barr)foreach($barr as $k=>$rs){ if(arrvalue($rs,$act)=='1')$garr[] = $rs; } return $garr; } public function gettodosend($act, $actname='',$sm='', $courseid=0, $conts='') { $barr = $this->gettodolist($act); if(!$barr)return; $changearr = array('boturn'=>'鎻愪氦','boedit'=>'缂栬緫','bozhuan'=>'杞姙','bochang'=>'淇敼瀛楁','bodel'=>'鍒犻櫎','bozuofei'=>'浣滃簾','botong'=>'澶勭悊鍚屾剰','bobutong'=>'澶勭悊涓嶅悓鎰','bofinish'=>'鍏ㄩ儴澶勭悊瀹屾垚','bozhui'=>'杩藉姞璇存槑','boping'=>'璇勮','bohuiz'=>'鍥炴墽纭'); if($actname=='' && is_string($act))$actname = arrvalue($changearr, $act); if(isempt($actname))return; $cheo = c('check'); foreach($barr as $k=>$rs){ $receid = $rs['receid']; if($act=='botong' || $act=='bobutong'){ $changewe = $rs['changecourse']; if(!isempt($changewe) && !contain(','.$changewe.',',','.$courseid.','))continue; } if($rs['toturn']==1)$receid.=','.$this->uid.''; if(arrvalue($rs,'tosuper')=='1'){ $supar = $this->adminmodel->getsuperman($this->uid); $shnej = arrvalue($supar, 0); if(!isempt($shnej))$receid.=','.$shnej.''; } if($rs['tocourse']==1 && $this->billrs){ $allcheckid = $this->billrs['allcheckid']; if(!isempt($allcheckid))$receid.=','.$allcheckid.''; } $todofields = $rs['todofields']; if(!isempt($todofields)){ $toad = explode(',', $todofields); foreach($toad as $toads){ $ttv = arrvalue($this->rs, $toads); if(!isempt($ttv) && $cheo->isinnumber($ttv))$receid.=','.$ttv.''; } } if(isempt($receid))continue; if(substr($receid,0,1)==',')$receid = substr($receid, 1); $cont = $rs['summary']; if(isempt($cont))$cont = $conts; if(isempt($cont)){ $cont = ''.$this->adminname.''.$actname.'['.$this->modename.',鍗曞彿:'.$this->sericnum.']'; if($sm!='')$cont.=',璇存槑:'.$sm.''; } $this->push($receid, '', $cont, $this->rock->repempt($rs['name'])); } } public function numtodosend($num, $actname='',$sm='') { $rows = $this->todomodel->getrows("`setid`='".$this->modeid."' and `num`='$num' and `status`=1"); if(!$rows)return; $this->gettodosend($rows, $actname, $sm); } public function flowtotal($fields='', $type='') { if($fields=='')$fields = $this->rock->post('total_fields'); if($type=='')$type = $this->rock->post('total_type','jls'); $typea = explode('|', $type); $typefields = ''; $type = $typea[0]; $typefields = arrvalue($typea, 1); $rowa = array(); $rowa[] = array( 'name' => '鏆傛棤鏁版嵁', 'value' => 0, 'bili' => '' ); $tofiels= 'count(1)'; if($type=='sum')$tofiels = 'sum([A]`'.$typefields.'`)'; if($type=='avg')$tofiels = 'avg([A]`'.$typefields.'`)'; $atype = $this->rock->post('atype'); $table = '[Q]'.$this->mtable.''; $narr = $this->billwhere($this->adminid, $atype); $where = $narr['where']; $table = $narr['table']; if(!contain($table,' '))$table = '[Q]'.$table.''; $gwhere = $this->rock->post('where'); if(!isempt($gwhere)){ $gwhere = $this->rock->jm->uncrypt($this->rock->iconvsql($gwhere)); $where .= ' '.$gwhere.''; } $sql = 'select '.$fields.' as `name`,'.$tofiels.' as value from '.$table.' where 1=1 '.$where.' group by '.$fields.''; $sql = str_replace('[A]', $narr['asqom'], $sql); $rows = $this->db->getall($sql); $total = 0; if($rows){ foreach($rows as $k=>$rs)$total+=floatval($rs['value']); if($total>0)foreach($rows as $k=>$rs){ $rows[$k]['bili'] = $this->rock->number($rs['value']*100/$total).'%'; } if($type!='avg' && count($rows)>1)$rows[] = array('name' => '鍚堣','value' => $total,'bili' => ''); }else{ $rows = $rowa; } return $rows; } public function receiptcheck($hid, $sm) { return 'ok'; } public function getrowstable($atype, $where, $limit=100,$fields='') { $rows = $this->getflowrows($this->adminid,$atype,$limit,$where); $headstr = '@xuhaos,,center'; foreach($this->fieldsarra as $k=>$rs){ $bo = false; if(!$fields && $rs['islb']==1 && $rs['iszb']=='0')$bo = true; if($fields && contain(','.$fields.',',','.$rs['fields'].','))$bo = true; if($bo)$headstr.='@'.$rs['fields'].','.$rs['name'].''; } if($this->isflow>0){ $headstr.='@statustext,鐘舵'; if(is_array($rows))foreach($rows as $k=>$rs){ $rows[$k]['statustext'] = $this->getstatusstr($rs); } } $cont = c('html')->createrows($rows, substr($headstr, 1),'#cccccc','noborder'); return $cont; } public function lang($ky) { return lang($ky,'mode_'.$this->modenum.''); } public function viewjinfields($rows) { if(!$rows)return $rows; return $rows; } public function daochusubtable($rows) { return $rows; } }
\ No newline at end of file
+
'; unset($fields['base_name']); unset($fields['base_deptname']); } $contvimr .= ''; foreach($fields as $f=>$n){ $vs = arrvalue($data, $f); if(!isempt($vs)){ if(substr($f,0,7)=='subdata'){ $contvimr .= ' '; }else{ $contvimr .= ''.str_replace(' ',' ',$n).'
锛 '.$vs.'
'; } } } $contvimr .= '
'; } if(isempt($contview))$contview = $contvimr; $contview = str_replace('$contview$',$contvimr, $contview); } unset($farrobj); $arr['contview'] = $contview; $arr['readarr'] = m('log')->getreadarr($this->mtable, $this->id); $arr['isedit'] = $this->iseditqx(); $arr['isdel'] = $this->isdeleteqx(); $arr['isflow'] = $this->isflow; $arr['modename'] = $this->modename; $arr['ischehui'] = $this->ischehui(); $arr['statustext'] = $ztass[4]; $arr['statuscolor'] = $ztass[1]; $arr['optmenu'] = $this->getoptmenu(1); $arr['isgbjl'] = (int)$this->rock->arrvalue($this->moders,'isgbjl','0'); $arr['isgbcy'] = (int)$this->rock->arrvalue($this->moders,'isgbcy','0'); $receiptrs = false; $receiptrow = m('receipt')->getall("`modenum`='$this->modenum' and `mid`='$this->id' and `status`=1"); foreach($receiptrow as $k=>$hrs){ $uid1 = ','.$this->adminid.','; if(!contain(','.$hrs['receid'].',', $uid1))continue; if(!contain(','.$hrs['receids'].',', $uid1)){ $receiptrs = array( 'id' => $hrs['id'], 'optname' => $hrs['optname'], ); break; } } $arr['flowinfor'] = array(); $arr['readunarr'] = array(); $arr['receiptrs'] = $receiptrs; if($this->isflow>0){ $arr['flowinfor']= $this->getflowinfor(); if($arr['flowinfor']['ischeck']==1){ $arr['isplview']='0'; } } if(isset($data['title']))$arr['title'] = $data['title']; $_oarr = $this->flowdatalog($arr); if(is_array($_oarr))foreach($_oarr as $k=>$v)$arr[$k]=$v; $conta = $this->rock->matcharr($contview,2); $edbof = false; foreach($conta as $fids){ $thnr = ''; $contview = str_replace('`'.$fids.'`', $thnr, $contview); } $arr['contview'] = $contview; return $arr; } private function getsubdata($xu, $rows, $lx=0) { $iscz = 0; $iszb = $xu+1; $fields = 'subdata'.$xu.''; $subrows = $this->db->getrows('[Q]flow_element','`mid`='.$this->modeid.' and `iszb`='.$iszb.' and `iszs`=1','`fields`,`name`,`isalign`','`sort`'); $cont = ''; if($this->db->count > 0){ $iscz = 1; $headstr = '@xuhaos,,center'; $colorbb = getconfig('bcolorxiang', '#cccccc'); foreach($subrows as $k=>$rs){ $headstr.='@'.$rs['fields'].','.$rs['name'].''; if($rs['isalign']=='1')$headstr.=',left'; if($rs['isalign']=='2')$headstr.=',right'; } foreach($rows as $k=>$rs)$rows[$k]['xuhaos'] = $k+1; $slex = ($lx==0) ? 'noborder':''; if($this->subsubdatastyle!='')$slex = $this->subsubdatastyle; $cont = c('html')->createrows($rows, substr($headstr,1), $colorbb, $slex); } return $cont; } public function ischehui() { $is = 0; if($this->rs['status']==1 || $this->isflow==3)return $is; $where = "".$this->mwhere." and `valid`=1 order by `id` desc"; $rs = $this->flogmodel->getone($where); $sj = (int)getconfig('flowchehuitime','2'); $time = time()-$sj*3600; if($rs && $rs['status']=='1' && $rs['checkid']==$this->adminid && strtotime($rs['optdt'])>$time && ($rs['courseid']>0 || $rs['iszb']=='1' )) $is = $rs['id']; return $is; } public function chehui($sm='') { return $this->bd6('5peg5L!h5ZG8562!5o6I5peg5q2k5Yqf6IO9'); } public function bd6($str) { return $this->rock->jm->base64dencode($str); } public function getdataedit() { $fobj = m('file'); $arr['data'] = $this->flowrsreplaceedit($this->rssust); $arr['table'] = $this->mtable; $arr['tables'] = $this->moders['tables']; $arr['modeid'] = $this->modeid; $arr['isedit'] = $this->iseditqx(); $arr['isflow'] = $this->isflow; $arr['user'] = $this->urs; $arr['status'] = $this->rs['status']; $filers = $fobj->getfile($this->mtable,$this->id); foreach($filers as $fk=>$frs1)$filers[$fk]['thumbpath']=$fobj->getthumbpath($frs1); $arr['filers'] = $filers; $arr['subdata'] = $this->getsuballdata(); $filearr = array(); $fileids = ''; foreach($this->fieldsarr as $k=>$rs){ $fid = $rs['fields']; $flx = $rs['fieldstype']; if($flx=='uploadfile'){ $fval = arrvalue($this->rssust, $fid); if(!isempt($fval))$fileids.=','.$fval.''; } if($flx=='uploadimg'){ $arr['data'][''.$fid.'_view'] = $this->rock->gethttppath($arr['data'][$fid]); } } if($fileids!=''){ $frows = $fobj->getall('`id` in('.substr($fileids, 1).')','filename,id,filesizecn,fileext,optname,thumbpath,thumbplat'); foreach($frows as $k1=>$rs1){ $rs1['thumbpath'] = $fobj->getthumbpath($rs1); $filearr['f'.$rs1['id'].''] = $rs1; } } $arr['filearr'] = $filearr; $ztarr = $this->getnowstatus(); $arr['statustext'] = $ztarr[0]; $arr['statuscolor'] = $ztarr[1]; return $arr; } public function getflowinfor() { $ischeck = 0; $ischange= 0; $str = ''; $arr = $this->getflow(); if($arr['nowcheckid'] != $this->billrs['nowcheckid'])$this->getflowsave($arr, true); $nstatus = $this->rs['status']; $isturn = $this->rs['isturn']; $nowcheckid = ','.$arr['nowcheckid'].','; if($isturn==1 && $nstatus !=1 && contain($nowcheckid, ','.$this->adminid.',') && !in_array($nstatus, array(2,5))){ $ischeck = 1; } $logarr = $this->getlog(); $nowcur = $this->nowcourse; if(arrvalue($this->nextcourse,'checktype')=='change'){ $ischange = 1; } $sarr['ischeck'] = $ischeck; $sarr['ischange'] = $ischange; $sarr['nowcourse'] = $nowcur; $sarr['iszhuanban'] = 0; $sarr['ischao'] = 0; $sarr['nextcourse'] = $this->nextcourse; $sarr['nstatustext'] = $arr['nstatustext']; if($isturn==0)$sarr['nstatustext'] = '寰呮彁浜 '; $_checkfields = arrvalue($nowcur,'checkfields'); $checkfields = array(); if($ischeck == 1 && !isempt($_checkfields)){ $_checkfieldsa = explode('|', $_checkfields); $_checkfields = join(',',$_checkfieldsa); $_checkxuant = arrvalue($_checkfieldsa, 1); $inputobj = c('input'); $inputobj->flow = $this; $inputobj->mid = $this->id; $inputobj->urs = $this->urs; $elwswhere = "`mid`='$this->modeid' and `iszb`=0 and instr(',$_checkfields,', concat(',',`fields`,','))>0"; $infeidss = $inputobj->initFields($elwswhere); foreach($infeidss as $_fs=>$fsva){ $_sfes = $fsva['fields']; $_type = $fsva['fieldstype']; $showinpus = 1; $isbt = 1; if($_checkxuant && contain(','.$_checkxuant.',',','.$_sfes.','))$isbt=0; if($_type=='hidden' || $_type=='fixed')$showinpus=2; $_val = arrvalue($this->rssust, $_sfes); $cheo = (substr($_type,0,6)=='change' && !isempt($fsva['data'])); if($cheo)$_val.='|'.arrvalue($this->rssust, $fsva['data']).''; $checkfields[$_sfes] = array( 'inputstr' => $inputobj->getfieldcontval($_sfes, $_val), 'name' => $fsva['name'], 'isbt' => $isbt, 'fieldstype'=> $_type, 'fieldsarr' => $fsva, 'showinpus' => $showinpus ); if($cheo){ $_sfes = $fsva['data']; $checkfields[$_sfes] = array( 'inputstr' => '', 'isbt' => $isbt, 'name' => $fsva['name'].'id', 'fieldstype'=> $_type, 'fieldsarr' => false, 'showinpus' => 2 ); } } } $sarr['checkfields'] = $checkfields; if($nstatus==2)$sarr['nstatustext'] ='寰呮彁浜や汉澶勭悊('.$this->urs['name'].') '; $loglen = count($logarr); foreach($logarr as $k=>$rs){ if($rs['courseid']>0){ $sty = ''; $col = $rs['color']; if($str!='')$str.=' 鈫 '; $str.=''.$rs['actname'].'('.$rs['name'].''.$rs['statusname'].' ) '; } } if($nstatus=='2'){ if($str!='')$str.=' 鈫 '; $str.= $sarr['nstatustext']; }else if($nstatus=='5'){ if($str!='')$str.=' 鈫 '; $sarr['nstatustext'] = '宸蹭綔搴 '; $str.= '宸蹭綔搴 '; }else{ foreach($this->flowarr as $k=>$rs){ if($rs['ischeck']==0){ $sty = 'color:#888888'; if($rs['isnow']==1)$sty='font-weight:bold;color:#800000'; if($str!='')$str.=' 鈫 '; $str.=''.$rs['name'].''; if(!isempt($rs['nowcheckname']))$str.='('.$rs['nowcheckname'].')'; $str.=' '; } } } $sarr['flowcoursestr'] = $str; if($nstatus==1)$sarr['nstatustext'] = $this->getnowstatus(1); $actstr = ',鍚屾剰|green,涓嶅悓鎰弢red'; if(isset($nowcur['courseact']) ){ $actstrt = $nowcur['courseact']; if(!isempt($actstrt))$actstr = ','.$actstrt; } $act = c('array')->strtoarray($actstr); foreach($act as $k=>$as1)if($k>0 && $as1[0]==$as1[1])$act[$k][1]=''; if(arrvalue($this->moders,'isys')=='1' && (int)arrvalue($nowcur,'mid','0')>=0){ $act[25]= array('鍓嶅姞绛','',''); $act[26]= array('鍚庡姞绛','',''); } $sarr['courseact'] = $act; $nowstatus = $this->rs['status']; if($this->isflow>0 && $this->rs['isturn']==0)$nowstatus=3; $sarr['nowstatus'] = $nowstatus; $step = $this->rock->arrvalue($nowcur, 'step','0'); $tuicourse = $this->flogmodel->getall($this->mwhere.' and `courseid`>0 and `valid`=1 and `status`=1 and `step`<'.$step.'','`id`,`checkname`,`name`','`step` desc'); $sarr['tuicourse'] = $tuicourse; return $sarr; } public function updatestatus($zt) { $this->update('`status`='.$zt.'', $this->id); $this->billmodel->update('`status`='.$zt.'', $this->mwhere); } public function getstatusarr() { return $this->getstatus(null, '','',2); } public function getstatus($rs, $statusstr='',$other='', $glx=0) { $statustext = $statuscolor = ''; if($statusstr=='')$statusstr=$this->rock->arrvalue($this->moders,'statusstr'); $statusara = array(); $colorsa = array('blue','green','red','#ff6600','#526D08','#888888','','','','','','','','','','','','',''); if(isempt($statusstr)){ $statussst = '涓嶅悓鎰'; $statusstr = '寰?澶勭悊|blue,宸插鏍竱green,'.$statussst.'|red'; } $nowcheckname= arrvalue($rs,'nowcheckname', arrvalue($this->billrs,'nowcheckname')); if(isempt($other))$other = $nowcheckname; $statusar = c('array')->strtoarray($statusstr); foreach($statusar as $k=>$v){ if($v[0]==$v[1])$v[1]= arrvalue($colorsa, $k); $statusara[$k] = $v; } $statusara[5] = array('宸蹭綔搴','#888888'); $statusara[23] = array('閫鍥','#17B2B7'); if($glx==2)return $statusara; $isturn = -1; if(isset($rs['isturn']))$isturn = (int)$rs['isturn']; $zt = $this->rock->arrvalue($rs, 'status'); if($isturn==0){ $statustext = '寰呮彁浜'; $statuscolor= '#ff6600'; }elseif(!isempt($zt)){ if(isset($statusara[$zt])){ $statustext = $statusara[$zt][0]; $statuscolor = $statusara[$zt][1]; } } if(contain($statustext,'?')){ $statusstr = str_replace('?', ''.$other.' ', $statustext); }else{ $statusstr = ''.$statustext.' '; } if($glx==1){ return $statusstr; } return array(str_replace('?', $other, $statustext), $statuscolor, $zt, $statusstr, str_replace('?', '', $statustext)); } public function getstatusstr($rs) { return $this->getstatus($rs, '','', 1); } public function getnowstatus($glx=0) { return $this->getstatus($this->rs, '','', $glx); } private $getlogrows = array(); public function getlog($lx=0) { if(isset($this->getlogrows[$lx]))return $this->getlogrows[$lx]; $rows = $this->flogmodel->getrows($this->mwhere, '`checkname` as `name`,`checkid`,`name` as actname,`optdt`,`status`,`explain`,`statusname`,`valid`,`courseid`,`color`,`id`,`qmimg`','`id` asc'); $uids = $idss = ''; $dts = c('date'); $fo = m('file'); $editarrs = array(); foreach($rows as $k=>$rs){ $uids.=','.$rs['checkid'].''; $idss.=','.$rs['id'].''; $col = $rs['color']; if(isempt($col))$col='green'; if(contain($rs['statusname'],'涓') || $rs['status']=='2')$col='red'; $rows[$k]['color'] = $col; $rows[$k]['checkdt'] = $rs['optdt']; $rows[$k]['sm'] = str_replace("\n",' ', (string)$rs['explain']); $rows[$k]['explain'] = $rows[$k]['sm']; if(!isempt($rs['qmimg'])){ if(!contain($rs['qmimg'],'.')){ $qmimg = ''.UPDIR.'/'.date('Y-m').'/qmimg'.$rs['id'].'.png'; $bo = true; if(!file_exists($qmimg)){ $bar= explode(',', $rs['qmimg']); $bo = $this->rock->createtxt($qmimg, base64_decode($bar[1])); } if(!$bo){ $qmimg = $rs['qmimg']; }else{ $qmimg = ''.URL.''.$qmimg.''; } }else{ $qmimg = $rs['qmimg']; if(!file_exists($qmimg)){ $qmimg = ''; }else{ $qmimg = ''.URL.''.$qmimg.''; } } $rows[$k]['qmimg'] = $qmimg; if(!isempt($qmimg))$rows[$k]['explain']= ' '.$rs['explain'].''; } } if($idss!=''){ $farr = $fo->getfile($this->flowlogtable, substr($idss, 1)); if($farr)foreach($rows as $k=>$rs){ $fstr = $fo->getallstr($farr, $rs['id'],2); $rows[$k]['explain']= $this->strappend($rs['explain'], $fstr, ' '); } } if($uids!=''){ $rows = m('admin')->getadmininfor($rows, substr($uids, 1), 'checkid'); } $this->getlogrows[$lx] = $rows; return $rows; } public function addlog($arr=array()) { $addarr = array( 'table' => $this->mtable, 'mid' => $this->id, 'checkname' => $this->adminname, 'checkid' => $this->adminid, 'optdt' => $this->rock->now, 'courseid' => '0', 'status' => '1', 'ip' => $this->rock->ip, 'web' => $this->rock->web, 'modeid' => $this->modeid ); foreach($arr as $k=>$v)$addarr[$k]=$v; if(isset($addarr['explain']))$addarr['explain']= htmlspecialchars($addarr['explain']); $this->flogmodel->insert($addarr); $ssid = $this->db->insert_id(); $fileid = $this->rock->post('fileid'); if($fileid!='')m('file')->addfile($fileid, $this->flowlogtable, $ssid, $this->modenum.'|'.$this->id); $logfileid = $this->rock->post('logfileid'); if($logfileid!='')m('file')->addfile($logfileid, $this->flowlogtable, $ssid, $this->modenum.'|'.$this->id); $addarr['id'] = $ssid; $this->flowaddlog($addarr); $this->getlogrows = array(); return $ssid; } public function submit($na='', $sm='') { if($na=='')$na='鎻愪氦'; $isturn = 1; if($na=='淇濆瓨')$isturn = 0; $this->addlog(array( 'name' => $na, 'explain' => $sm )); if($this->isflow>0){ $marr['isturn'] = $isturn; $marr['status'] = 0; $this->rs['status'] = 0; $this->update($marr, $this->id); if(arrvalue($this->moders,'isflowlx')=='1' || $this->isflow>=3){ $this->checksmodel->delete($this->mwhere); $this->flogmodel->update('`valid`=0', ''.$this->mwhere.' and `courseid`>0 and `valid`=1'); } $farr = $this->getflow(); if($farr['nowcourseid']>0){ $sysnextoptid = $this->rock->post('sysnextoptid'); $sysnextopt = $this->rock->post('sysnextopt'); $sysnextcustidid = (int)$this->rock->post('sysnextcustidid'); if($sysnextcustidid == $farr['nowcourseid'] && !isempt($sysnextoptid) && !isempt($sysnextopt)){ $this->addcheckname($sysnextcustidid, $sysnextoptid, $sysnextopt, true, 1); $farr = $this->getflow(); } } $farr['status'] = 0; $this->savebill($farr); if($isturn == 1){ $this->nexttodo($farr['nowcheckid'],'submit'); } } $this->flowsubmit($na, $sm); $this->savecsname( $this->rock->post('syschaosongid'), $this->rock->post('syschaosong'), $this->adminid,0,$isturn,$na); if($na=='缂栬緫'){ $this->gettodosend('boedit'); }else{ $this->gettodosend('boturn'); } } private function savecsname($csnameid,$csname,$uid,$type,$isturn, $na) { if(!isempt($csnameid)){ $where = $this->mwhere.' and `type`='.$type.''; if($type>0)$where.=' and `uid`='.$uid.''; $csid = (int)$this->chaomodel->getmou('id', $where); if($csid==0)$where = ''; $this->chaomodel->record(array( 'modeid' => $this->modeid, 'table' => $this->mtable, 'mid' => $this->id, 'uid' => $uid, 'type' => $type, 'csname' => $csname, 'csnameid' => $csnameid, ),$where); if($isturn==1)$this->nexttodo($csnameid,'chao', $na); } } public function getcsname($id=0) { if($id>0){ $where= "`table`='$this->mtable' and `mid`='$id' and `type`=0"; }else{ $where= "`modeid`={$this->modeid} and `uid`={$this->adminid} and `type`=0"; $iscs = (int)$this->moders['iscs']; } $ors = $this->chaomodel->getone($where,'*','`id` desc'); $csname = $csnameid = ''; if($ors){ $csname = $ors['csname']; $csnameid = $ors['csnameid']; } return array( 'csname' => $csname, 'csnameid' => $csnameid, 'id' => $id, ); } public function zhuijiaexplain($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '杩藉姞璇存槑', 'status' => 1, )); $zt = $this->rs['status']; if($zt==2 && $this->isflow>0 && $this->adminid==$this->uid){ $marr['status'] = 0; $this->rs['status'] = 0; $this->update($marr, $this->id); $farr = $this->getflow(); $farr['status'] = 0; $this->savebill($farr); $this->nexttodo($farr['nowcheckid'],'zhui', $sm); } $this->gettodosend('bozhui','', $sm); } public function chuiban($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '鍌姙', 'status' => 1, )); $farr = $this->getflow(true); $this->nexttodo($farr['nowcheckid'],'cuiban', $sm); $this->gettodosend('cuiban','', $sm); } public function getyushen($rows) { return $rows; } private function getyushenss($id, $rows, $xu, $isq) { if($xu==0)$this->_tempauoe = array(); if(isset($rows[$id])){ $_tars = $rows[$id]; if($isq==1)$this->getyushenss($_tars['id'], $rows, $xu+1, $isq); $this->_tempauoe[] = $_tars; if($isq==0)$this->getyushenss($_tars['id'], $rows, $xu+1, $isq); } return $this->_tempauoe; } public function getflowpipei($uid=0) { $urs = $this->urs; if(!$urs)$urs = $uid; if(!is_array($urs))$urs = $this->db->getone('[Q]admin', "`id`='$urs'", '`deptid`,`deptpath`,`id`'); $coursedb = m('flowcourse'); $barr = $coursedb->pipeiCourse($this->modeid); $rows = $barr['rows']; $this->pipeiCoursearrc = $barr['rowd']; $this->pipeiCoursearrs = array(); $this->pipeiCoursearr = array(); $kqobj = m('kaoqin'); $this->getflowpipeis($rows, $urs, $kqobj); unset($this->pipeiCoursearrs); unset($this->pipeiCoursearrc); return $this->getyushen($this->pipeiCoursearr); } private function getflowpipeis($rows,$urs, $kqobj) { $shiyong = array(); $defix = $xuhao = 0; $uid = arrvalue($urs,'id',0); $zshu = count($rows); foreach($rows as $k=>$rs){ $whereid = (int)$rs['whereid']; $receid = $rs['receid']; $wherestr= arrvalue($rs, 'where'); if($rs['status']=='0')continue; if(!isempt($wherestr)){ $wherestr = m('base')->strreplace($this->rock->jm->base64decode($wherestr), $uid); $to = $this->rows("`id`='$this->id' and $wherestr "); if($to==0)continue; } if($whereid > 0){ $bo = $this->wheremanzhu($whereid); if(!$bo)continue; } if(!isempt($rs['num'])){ $bo = $this->flowcoursejudge($rs['num'], $rs); if(is_bool($bo) && !$bo)continue; } $xuhao++; if($defix==0 && (isempt($receid) || contain($receid,'all'))){ $defix = $xuhao; } if(isempt($receid) && (!isempt($wherestr) || $whereid > 0)){ $defix = $xuhao; } $rs['xuhao'] = $xuhao; $shiyong[] = $rs; } $pboss = false; if($shiyong){ $gxuha = $kqobj->getpipeimid($urs, $shiyong, 'xuhao', $defix); if($gxuha>0){ $pboss = true; $gxuha = $gxuha-1; $prs = $shiyong[$gxuha]; $this->getflowpipeisss($prs, $urs, $kqobj); } } if(!$pboss && $zshu==1 && $rows[0]['childshu']>0){ $this->getflowpipeis($rows[0]['children'], $urs, $kqobj); } } private function getflowpipeisss($prsnrs, $urs, $kqobj) { $prs = $prsnrs; unset($prs['children']); $this->pipeiCoursearrs[]= $prs['id']; $this->pipeiCoursearr[] = $prs; if($prs['childshu']>0){ $this->getflowpipeis($prsnrs['children'], $urs, $kqobj); }else{ $nid = arrvalue($prs,'nid','0'); if($nid>0 && !in_array($nid, $this->pipeiCoursearrs) && isset($this->pipeiCoursearrc, $nid)){ $this->getflowpipeis(array($this->pipeiCoursearrc[$nid]), $urs, $kqobj); } } } public function getflow($sbo=false) { $this->flowarr = array(); $allcheckid = $nowcheckid = $nowcheckname = $nstatustext = ''; $allcheckids = array(); $nowcourseid = 0; $nstatus = $this->rs['status']; $this->nowcourse = array(); $this->nextcourse = array(); $this->flowisend = 0; $curs = $this->flogmodel->getrows($this->mwhere,'checkid,checkname,courseid,`valid`,`status`,`statusname`,`name`,`iszb`','id desc'); $cufss = $ztnas = $chesarr = array(); foreach($curs as $k=>$rs){ if($rs['iszb']=='1' && !in_array($rs['checkid'], $allcheckids))$allcheckids[] = $rs['checkid']; if($rs['courseid']=='0')continue; $_su = ''.$rs['courseid'].''; $_su1 = ''.$rs['courseid'].'_'.$rs['checkid'].''; if($rs['valid']==1 && in_array($rs['status'], $this->flowstatusarr)){ if(!isset($cufss[$_su]))$cufss[$_su]=0; $cufss[$_su]++; $chesarr[$_su1] = 1; } if(!in_array($rs['checkid'], $allcheckids))$allcheckids[] = $rs['checkid']; if($nstatustext=='' && $rs['courseid']>0){ $nstatustext = ''.$rs['checkname'].'澶勭悊'.$rs['statusname'].''; $nstatus = $rs['status']; } $ztnas[$rs['courseid']] = ''.$rs['checkname'].''.$rs['statusname'].''; } $nowstep = $zongsetp = -1; $isend = 0; $czt = $this->rs['status']; $coutye = 0; $rows = ($czt==1 || $czt==5)? array() : $this->getflowpipei($this->uid); if($rows){ $checksa = $this->checksmodel->getrows($this->mwhere.' and `addlx`=3'); $coursea = $nrows = array(); foreach($checksa as $k=>$rs)$coursea[$rs['courseid']]='1'; $nrows = array(); $allcheckid = ''; $isoptsuperbo = false; foreach($rows as $k=>$rs){ $uarr = $this->getcheckname($rs); $rows[$k]['checkid'] = $uarr[0]; $rows[$k]['checkname'] = $uarr[1]; $allcheckid .= ','.$uarr[0].''; if($rs['checktype']=='optsuper' && isempt($uarr[0]))$isoptsuperbo=true; } if($isoptsuperbo)foreach($rows as $k=>$rs){ if($rs['checktype']=='optsuper'){ $_k1 = $k-1; $_uid = $this->optid; if($_k1>=0){ $ours = $this->flogmodel->getone($this->mwhere.' and `courseid`='.$rows[$_k1]['id'].' and `valid`=1 ','`checkid`','`id` desc'); if(!$ours){ $_uid = (int)$rows[$_k1]['checkid']; }else{ $_uid = $ours['checkid']; } } $uarr = $this->adminmodel->getsuperman($_uid); if($uarr){ $rows[$k]['checkid'] = $uarr[0]; $rows[$k]['checkname'] = $uarr[1]; } } } foreach($rows as $k=>$rs){ $nrows[] = $rs; if($rs['checktype']=='superall'){ $ids1 = $rs['id']; $suparr = $this->adminmodel->getsuperarr($this->uid); if($suparr){ $logdsar = $this->getlog(); foreach($logdsar as $k1=>$rs1){ if($rs1['courseid']>0 && $rs1['status']=='1' && $rs1['valid']=='1')$allcheckid .= ','.$rs1['checkid'].''; } foreach($suparr as $k1=>$surs){ if(!contain(','.$allcheckid.',', ','.$surs['id'].',')){ $rs['oldid'] = $ids1; $rs['id'] = $ids1 * 99999 + $surs['id']; $rs['checkid'] = $surs['id']; $rs['checkname'] = $surs['name']; $rs['iszf'] = 0; $nrows[] = $rs; $allcheckid .= ','.$surs['id'].''; } } } } } $yisheh = ''; if($this->isflow==2){ $logdsar = $this->getlog(); foreach($logdsar as $k1=>$rs1) if($rs1['courseid']>0 && $rs1['status']==1 && $rs1['valid']==1)$yisheh .= ','.$rs1['checkid'].''; } foreach($nrows as $k=>$rs){ $whereid = (int)$rs['whereid']; $checkshu = $rs['checkshu']; $checkid = $rs['checkid']; $checkname = $rs['checkname']; $checktype = $rs['checktype']; if($this->isflow==2 && !isempt($checkid) && isempt($rs['checkfields'])){ if(($checkid==$this->uid || $checkid==$this->optid) )continue; $k2 = $k+1; $ntype = 'yes'; if(isset($nrows[$k2])){ if($nrows[$k2]['checktype']=='change')$ntype='no'; } if($ntype=='yes' && contain(','.$yisheh.',',','.$checkid.','))continue; } if(!isempt($checkid))$yisheh .= ','.$checkid.''; $zongsetp++; $ischeck = 0; $checkids = $checknames = ''; $_su = ''.$rs['id'].''; $nowshu = 0; if(isset($cufss[$_su]))$nowshu = $cufss[$_su]; if(!$this->isempt($checkid)){ $checkida = explode(',', $checkid); $checkidna = explode(',', $checkname); $_chid = $_chna = ''; foreach($checkida as $k1=>$chkid){ $_su1 = ''.$rs['id'].'_'.$chkid.''; if(!in_array($chkid, $allcheckids))$allcheckids[] = $chkid; if(!isset($chesarr[$_su1])){ $_chid.=','.$chkid.''; $_chna.=','.arrvalue($checkidna, $k1).''; } } if($_chid!='')$_chid = substr($_chid, 1); if($_chna!='')$_chna = substr($_chna, 1); if($_chid==''){ $ischeck = 1; }else{ if($checkshu>0&&$nowshu>=$checkshu)$ischeck = 1; } $checkids = $_chid; $checknames = $_chna; }else{ if($checkshu>0&&$nowshu>=$checkshu)$ischeck = 1; if($checkshu == 0 && $nowshu>0)$ischeck = 1; } if($ischeck==0 && $coutye==0){ if((int)arrvalue($rs,'coursetype','0')>0)$coutye = 1; } $rs['ischeck'] = $ischeck; $rs['islast'] = 0; $rs['checkid'] = $checkid; $rs['checkname'] = $checkname; $rs['nowcheckid'] = $checkids; $rs['nowcheckname'] = $checknames; $rs['isnow'] = 0; $rs['nowstep'] = $zongsetp; $rs['step'] = $k+1; if($ischeck==0 && $nowstep==-1){ $rs['isnow']= 1; $nowstep = $zongsetp; $this->nowcourse = $rs; $nowcourseid = $rs['id']; $nowcheckid = $checkids; $nowcheckname = $checknames; } if($nowstep>-1 && $zongsetp==$nowstep+1)$this->nextcourse = $rs; $this->flowarr[]= $rs; } } if($zongsetp>-1)$this->flowarr[$zongsetp]['islast']=1; if($nowstep == -1){ $isend = 1; }else{ $nstatustext = '寰'.$nowcheckname.'澶勭悊'; } $this->flowisend = $isend; $allcheckid = join(',', $allcheckids); $arrbill['allcheckid'] = $allcheckid; $arrbill['nowcourseid'] = $nowcourseid; $arrbill['nowcheckid'] = $nowcheckid; $arrbill['nowcheckname'] = $nowcheckname; $arrbill['nstatustext'] = $nstatustext; $arrbill['nstatus'] = $nstatus; $arrbill['status'] = $this->rs['status']; $arrbill['isturn'] = $this->rs['isturn']; if($sbo)$this->getflowsave($arrbill); return $arrbill; } public function wheremanzhu($id) { $uid = $this->uid; $ser = $this->wheremodel->getflowwhere($id, $uid); if(!$ser)return true; $str = $ser['ntr']; if(!isempt($str)){ $to = $this->db->rows('[Q]admin',"`id`='$uid' and ($str)"); if($to>0)return false; } $str = $ser['str']; if(!isempt($str)){ $str= str_replace('{asqom}','', $str); $to = $this->rows("`id`='$this->id' and $str"); if($to==0)return false; } $str = $ser['utr']; if(!isempt($str)){ $to = $this->db->rows('[Q]admin',"`id`='$uid' and $str"); if($to==0)return false; } return true; } public function getflowsave($sarr, $suvu=false) { if(!$sarr)return; if($suvu)$sarr['updt'] = $this->rock->now; $this->billmodel->update($sarr, $this->mwhere); } private function getcheckname($crs) { $type = $crs['checktype']; $cuid = $name = ''; $courseid= $crs['id']; $cheorws = $this->checksmodel->getall($this->mwhere.' and `courseid`='.$courseid.'','checkid,checkname'); if($cheorws){ foreach($cheorws as $k=>$rs){ $lxss = $rs['checkid']; if(isempt($lxss) || $lxss=='0')continue; $cuid.=','.$lxss.''; $name.=','.$rs['checkname'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); return array($cuid, $name); } } if(!$this->isempt($crs['num'])){ $uarr = $this->flowcheckname($crs['num']); if(is_array($uarr)){ if(!$this->isempt($uarr[0]))return $uarr; } } if($type=='super' || $type=='superall'){ $cuid = $this->urs['superid']; $name = $this->urs['superman']; } if($type=='dept' || $type=='super' || $type=='superall'){ if($this->isempt($cuid) && $this->drs){ $cuid = $this->drs['headid']; $name = $this->drs['headman']; } } if($type=='apply'){ $cuid = $this->urs['id']; $name = $this->urs['name']; } if($type=='opt'){ $cuid = $this->rs['optid']; $name = $this->rs['optname']; if(isempt($cuid)){ $cuid = $this->urs['id']; $name = $this->urs['name']; } } if($type=='user'){ $cuid = $crs['checktypeid']; $name = $crs['checktypename']; } if($type=='rank'){ $rank = $crs['checktypename']; if(!$this->isempt($rank)){ $wheer1 = $this->adminmodel->getcompanywhere(5,'',$this->companyid); $rnurs = $this->db->getrows('[Q]admin',"`status`=1 and `ranking`='$rank' ".$wheer1."",'id,name','sort'); foreach($rnurs as $k=>$rns){ $cuid.=','.$rns['id'].''; $name.=','.$rns['name'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); } } } if($type=='cname'){ $cnbar = $this->cnamemodel->getcheckname($crs['checktypeid'], $this->uid); $cuid = arrvalue($cnbar, 0); $name = arrvalue($cnbar, 1); } if($type=='field'){ $fids = $crs['checktypeid']; if(!isempt($fids)){ $vals = ''; $farrs= explode(',', $fids); foreach($farrs as $fid){ $vid = arrvalue($this->rs, $fid); if(!isempt($vid))$vals.=','.$vid.''; } if($vals!=''){ $vals = substr($vals, 1); $uarr = $this->adminmodel->getrows('`status`=1 and `id` in('.$vals.')','id,name','FIELD(`id`,'.$vals.')'); foreach($uarr as $k=>$rs){ $cuid.=','.$rs['id'].''; $name.=','.$rs['name'].''; } if($cuid != ''){ $cuid = substr($cuid, 1); $name = substr($name, 1); } } } } $cuid = $this->rock->repempt($cuid); $name = $this->rock->repempt($name); return array($cuid, $name); } public function createbianhao($num, $fid, $wshu=3) { if(isempt($num))$num=''.$this->modenum.'-'; @$appdt = $this->rs['applydt']; if(isempt($appdt))$appdt = $this->rock->date; $apdt = str_replace('-','', substr($appdt,0,10)); $num = str_replace('Ymd',$apdt,$num); return $this->db->sericnum($num,'[Q]'.$this->mtable.'', $fid, $wshu); } public function createinputnum($num, $fid) { $acta = ''; if(method_exists($this, $num)){ $acta = $num; }else{ if(contain($num, ',')){ $arra = explode(',', $num); $acta = $arra[0]; $num = $arra[1]; } } if($acta && method_exists($this, $acta)){ $barr = $this->$acta($num); if(is_array($barr)){ $qom = arrvalue($barr, 'qom', $num); $wshu= arrvalue($barr, 'wshu', 3); $bom = arrvalue($barr, 'bom'); $fields = arrvalue($barr, 'fields', $fid); return $this->createbianhao($qom, $fields, $wshu).$bom; }else{ if(isempt($barr))$barr = $num; return $this->createbianhao($barr, $fid); } }else{ return $this->createbianhao($num, $fid); } } public function createnum() { $num = $this->moders['sericnum']; if($num=='鏃'||$this->isempt($num))$num='TM-Ymd-'; @$appdt = $this->rs['applydt']; if(isempt($appdt))$appdt = $this->rock->date; $apdt = str_replace('-','', $appdt); $num = str_replace('Ymd',$apdt,$num); return $this->db->sericnum($num,'[Q]flow_bill', 'sericnum', 3); } public function savebill($oarr=array()) { $dbs = $this->billmodel; $whes= $this->mwhere; $birs= $dbs->getone($whes); $arr = array( 'table' => $this->mtable, 'mid' => $this->id, 'optdt' => isset($this->rs['optdt']) ? $this->rs['optdt'] : $this->rock->now, 'optname' => arrvalue($this->rs,'optname', $this->adminname), 'optid' => arrvalue($this->rs,'optid', $this->adminid), 'modeid' => $this->modeid, 'updt' => $this->rock->now, 'isturn' => $this->rs['isturn'], 'nstatus' => $this->rs['status'], 'applydt' => $this->rs['applydt'], 'modename' => $this->modename, 'uname' => $this->rs['base_name'], 'udeptname' => $this->rs['base_deptname'], 'uid' => $this->uid, 'isdel' => '0', ); foreach($oarr as $k=>$v)$arr[$k]=$v; if(!$birs){ $arr['status'] = $arr['nstatus']; $arr['createdt']= $arr['optdt']; $arr['sericnum']= $this->createnum(); $arr['udeptid'] = $this->rock->post('sysudeptid', arrvalue($this->urs,'deptid')); $whes = ''; $this->sericnum = $arr['sericnum']; }else{ $udeptid = $birs['udeptid']; if($udeptid==0)$arr['udeptid']= arrvalue($this->urs,'deptid'); } $fstr = $this->rock->post('sysflow5str'); if($fstr)$arr['flow5str'] = $fstr; $dbs->record($arr, $whes); return $arr; } public function getsummary() { return $this->rock->reparr($this->moders['summary'], $this->rs); } public function addcheckname($courseid, $uid, $uname, $onbo=false, $addlx=0) { if(isempt($uid)){$uid = '0';$uname= 'auto';} $uida = explode(',', ''.$uid.''); $uidan = explode(',', $uname); if($onbo)$this->checksmodel->delete($this->mwhere.' and `courseid`='.$courseid.''); if($uida)foreach($uida as $k=>$uid){ $uname = $this->rock->arrvalue($uidan, $k); $zyarr = array( 'table' => $this->mtable, 'mid' => $this->id, 'modeid' => $this->modeid, 'courseid' => $courseid, 'optid' => $this->adminid, 'optname' => $this->adminname, 'addlx' => $addlx, 'optdt' => $this->rock->now, 'status' => 0 ); $this->checksmodel->delete($this->mwhere.' and `checkid`='.$uid.' and `courseid`='.$courseid.''); $zyarr['checkid'] = $uid; $zyarr['checkname'] = $uname; $this->checksmodel->insert($zyarr); } if($addlx==4)$this->checksmodel->delete($this->mwhere.' and `checkid`='.$this->adminid.' and `courseid`='.$courseid.''); } public function savedatastr($fval, $farr, $data=array()) { $str = ''; if(!$farr)return $str; $savewhere = $farr['savewhere']; $name = $farr['name']; $types = $farr['fieldstype']; if(isempt($savewhere) || isempt($fval))return $str; $savewhere = str_replace(array('{0}','{date}','{now}'), array($name, $this->rock->date,$this->rock->now), $savewhere); $savewhere = $this->rock->reparr($savewhere, $data); $saees = explode(',', $savewhere); if($types=='date' || $types=='datetime')$fval = strtotime($fval); if($types=='number')$fval = floatval($fval); foreach($saees as $saeess){ $fsaed = explode('|', $saeess); $msg = isset($fsaed[2]) ? $fsaed[2] : ''.$name.'鏁版嵁涓嶇鍙'; $val = isset($fsaed[1]) ? $fsaed[1] : ''; $lfs = $fsaed[0]; if($val != ''){ if($types=='date' || $types=='datetime')$val = strtotime($val); if($types=='number')$val = floatval($val); if($lfs=='gt'){$bo = $fval>$val;if(!$bo)return $msg;} if($lfs=='egt'){$bo = $fval>=$val;if(!$bo)return $msg;} if($lfs=='lt'){$bo = $fval<$val;if(!$bo)return $msg;} if($lfs=='elt'){$bo = $fval<=$val;if(!$bo)return $msg;} if($lfs=='eg'){$bo = $fval==$val;if(!$bo)return $msg;} if($lfs=='neg'){$bo = $fval!=$val;if(!$bo)return $msg;} } } return $str; } public function update($arr, $where) { if(is_array($arr)){ foreach($arr as $k=>$v)$this->rs[$k]=$v; } return parent::update($arr,$where); } public function updatelogvalid($whe) { $this->flogmodel->update('valid=0', $this->mwhere.' '.$whe); } public function strappend($sm, $str, $fh=',') { if(isempt($str))return $sm; if(!isempt($sm))$sm.=$fh; $sm.=$str; return $sm; } public function checkerror($lx=1,$sm='') { if($sm=='')$sm='鍗曟嵁寮傚父绠$悊鍛樺鐞'; $msg = $this->check($lx, $sm, 1); return $msg; } public function check($zt, $sm='', $lx=0) { if($this->rs['status']==1)return '娴佺▼宸插鐞嗗畬鎴,鏃犻渶鎿嶄綔'; $arr = $this->getflow(); $flowinfor = $this->getflowinfor(); if($flowinfor['ischeck']==0 && $lx==0)return '褰撳墠鏄痆'.$arr['nowcheckname'].']澶勭悊'; $nowcourse = $this->nowcourse; if($lx==1){ if($arr['nowcourseid']!=0)return '褰撳墠鏈夊鏍告楠D鏄瓨鍦ㄧ殑涓嶈兘鐩存帴鏍囪瘑宸插畬鎴'; $to = $this->flogmodel->rows($this->mwhere.' and `courseid`>0 and `status`=1'); if($to==0)return '璇ュ崟鎹病鏈変换浣曢氳繃瀹℃牳澶勭悊涓嶈兘鐩存帴鏍囪瘑宸插畬鎴愭垨宸插鏍'; $nowcourse = array('id'=>66666,'name'=>'寮傚父澶勭悊','step'=>0); } $nextcourse = $this->nextcourse; $zynameid = $this->rock->post('zynameid'); $zyname = $this->rock->post('zyname'); $csnameid = ''; $csname = ''; $nextname = $this->rock->post('nextname'); $nextnameid = $this->rock->post('nextnameid'); $qmimgstr = $this->rock->post('qmimgstr'); $tuiid = (int)$this->rock->post('tuiid'); $iszhuanyi = $ischangenext = 0; if($zt==1 && $this->isflow!=3 && isempt($zynameid) && arrvalue($nextcourse,'checktype')=='change'){ $ischangenext = 1; } if($zt!=2)$tuiid = 0; $istongyi = in_array($zt, $this->flowstatusarr); if($zynameid!='' && $istongyi){ if($zynameid==$this->adminid)return '涓嶈兘杞粰鑷繁'; $sm = $this->strappend($sm, '杞粰锛'.$zyname.''); $iszhuanyi = 1; $this->rs['syszb_name'] = $zyname; $this->rs['syszb_nameid'] = $zynameid; } if($nextnameid=='' && $ischangenext==1)return '璇烽夋嫨涓嬩竴姝ュ鐞嗕汉'; $ufied = array(); if($iszhuanyi == 0 && $zt!=2){ foreach($flowinfor['checkfields'] as $chef=>$chefv){ $ufied[$chef] = $_val = $this->rock->post('cfields_'.$chef.''); if(isempt($_val) && $chefv['isbt']=='1')$this->echomsg(''.$chefv['name'].'涓嶈兘涓虹┖'); $_stype = arrvalue($chefv, 'fieldstype'); if($_stype=='graph')$ufied[$chef] = c('input')->createqianming($_val); $_str = $this->savedatastr($_val, $chefv['fieldsarr'], $this->rs); if($_str!='')$this->echomsg($_str); } } $this->checkiszhuanyi = $iszhuanyi; $barr = $this->flowcheckbefore($zt, $ufied, $sm); $msg = ''; if(is_array($barr) && isset($barr['msg']))$msg = $barr['msg']; if(is_array($barr) && isset($barr['update'])){ foreach($barr['update'] as $_k=>$_v)$ufied[$_k] = $_v; } if(is_string($barr))$msg = $barr; if(!isempt($msg))return $msg; if($ufied){ $bo = $this->update($ufied, $this->id); if(!$bo)return 'dberr:'.$this->db->error(); } $courseact = $flowinfor['courseact']; $act = $courseact[$zt]; $statusname = $act[0]; $statuscolor= $act[1]; $nzt = $act[2]; $courseid = $nowcourse['id']; $this->checksmodel->update('`status`='.$zt.'', $this->mwhere.' and `checkid`='.$this->adminid.' and `courseid`='.$courseid.''); if($iszhuanyi == 1){ $this->addcheckname($courseid, $zynameid, $zyname, false, 4); $nowcourse['id'] = 0; } if($ischangenext==1){ $this->addcheckname($nextcourse['id'], $nextnameid, $nextname, true, 1); } $tuirs = array(); if($tuiid > 0)$tuirs = $this->flogmodel->getone($tuiid); if(!$tuirs)$tuiid = 0; if($tuiid>0){ $sm = $this->strappend($sm, '閫鍥炲埌['.$tuirs['name'].'('.$tuirs['checkname'].')]'); $statusname = '閫鍥'; $statuscolor = '#17B2B7'; } $this->checkistui = $tuiid; $logsm = $sm; if($iszhuanyi==0 && $csname)$logsm = $this->strappend($logsm,'鎶勯佺粰锛'.$csname.''); $this->lastlogid = $this->addlog(array( 'courseid' => $nowcourse['id'], 'name' => $nowcourse['name'], 'step' => $nowcourse['step'], 'status' => $zt, 'statusname'=> $statusname, 'color' => $statuscolor, 'explain' => $logsm, 'iszb' => $iszhuanyi, 'qmimg' => $qmimgstr )); if($tuiid > 0){ $this->addcheckname($tuirs['courseid'], $tuirs['checkid'], $tuirs['checkname'], true, 3); $this->updatelogvalid('and `courseid`>0 and `status`=1 and `step`>='.$tuirs['step'].''); } $lzt = $this->rock->repempt($nzt, $zt); $uparr = $nexttodoarr = $nexttodoarc = array(); $bsarr = $this->getflow(); $bsarr['tuiid'] = $tuiid; $nextcheckid = $bsarr['nowcheckid']; if($istongyi){ if($iszhuanyi==0){ $uparr['status']= $this->rock->repempt($nzt,'0'); } $nexttodoarr = array($nextcheckid, 'next', $sm, $statusname); }else{ if($tuiid>0){ $lzt = 23; $nexttodoarr = array($nextcheckid, 'tui', $sm, $statusname); }elseif($zt==2){ $nexttodoarr = array($this->optid, 'nothrough', $sm, $statusname); } $uparr['status'] = $lzt; } $this->flowcheckafter($zt, $sm, $nowcourse); $bsarr['nstatus'] = $lzt; $bsarr['checksm'] = $sm; if(!$this->nowcourse){ $uparr['status'] = $lzt; $nexttodoarc = array($this->optid, 'finish', $sm, ''); } if($uparr){ $this->update($uparr, $this->id); } if(!$this->nowcourse){ $this->flowcheckfinsh($zt); if($istongyi){ $this->checksmodel->delete($this->mwhere); } } $bsarr['status'] = $this->rs['status']; $this->getflowsave($bsarr, true); if($this->db->backsql()){ $bos = ($courseid == arrvalue($this->nowcourse, 'id') && $istongyi); if($nexttodoarr && (!$bos || $iszhuanyi==1))$this->nexttodo($nexttodoarr[0],$nexttodoarr[1],$nexttodoarr[2],$nexttodoarr[3]); if($nexttodoarc)$this->nexttodo($nexttodoarc[0],$nexttodoarc[1],$nexttodoarc[2],$nexttodoarc[3]); } if($iszhuanyi == 1){ $this->gettodosend('bozhuan','', $sm, 0, ''.$this->adminname.'灏哰'.$nowcourse['name'].']杞粰:'.$zyname.''); }else{ if($istongyi)$this->gettodosend('botong', $statusname, $sm, $nowcourse['id']); if($zt==2)$this->gettodosend('bobutong',$statusname, $sm, $nowcourse['id']); if(!$this->nowcourse && $istongyi)$this->gettodosend('bofinish', '', $sm); } if($iszhuanyi==0){ $sm1 = '鍦ㄢ'.$nowcourse['name'].'鈥濆鐞'.$statusname.''; $this->savecsname($csnameid,$csname,$this->adminid,$nowcourse['id'],1, $sm1); } return 'ok'; } public function pushs($receid, $cont, $title='', $params=array()) { return $this->push($receid,'', $cont, $title, 0, $params); } public function getxiangurl($num='', $id=0, $lx='x') { if($num=='')$num = $this->modenum; if($id==0)$id = $this->id; $url = URL; if($lx=='auto')$lx = ($this->ismobile==1)?'x':'p'; if($lx=='x' || $lx=='a')$url = $this->rock->getouturl(); $url = ''.$url.'task.php?a='.$lx.'&num='.$num.'&mid='.$id.''; if(COMPANYNUM)$url.='&dwnum='.COMPANYNUM.''; return $url; } public function getxiangurlx($num='',$id=0){return $this->getxiangurl($num,$id,'x');} public function push($receid, $gname='', $cont='', $title='', $wkal=0, $params=array()) { if(isempt($receid) && $wkal==1)$receid='all'; if(isempt($receid))return false; if(contain(','.$receid.',', ',d1,'))$receid='all'; $modenum = arrvalue($params, 'modenum', $this->modenum); $modename = arrvalue($params, 'modename', $this->modename); $id = (int)arrvalue($params, 'id', $this->id); $moders = arrvalue($params, 'moders'); if(!is_array($moders))$moders = $this->moders; if($gname=='')$gname = $modename; $reim = m('reim'); $url = $this->getxiangurl($modenum, $id, 'p'); $wxurl = $this->getxiangurl($modenum, $id, 'x'); $emurl = $this->getxiangurl($modenum, $id, 'a'); if($id==0){ $url = '';$wxurl = '';$emurl=''; } $url = arrvalue($params, 'url', $url); $wxurl = arrvalue($params, 'wxurl', $wxurl); $emurl = arrvalue($params, 'emurl', $emurl); $slx = 0; $pctx = $moders['pctx']; $mctx = $moders['mctx']; $wxtx = $moders['wxtx']; $ddtx = $moders['ddtx']; $emtx = $moders['emtx']; if($pctx==0 && $mctx==1)$slx=2; if($pctx==1 && $mctx==0)$slx=1; if($pctx==0 && $mctx==0)$slx=3; $this->rs['now_adminname'] = $this->adminname; $this->rs['now_modename'] = $modename; $cont = $this->rock->reparr($cont, $this->rs); $receido= $receid; $receid = $this->adminmodel->gjoins($receid); $uids = m('todo')->addtodo($receid, $modename, $cont, $modenum, $id); if($uids!='' && $moders['type'] != '绯荤粺' && $id > 0)$this->todosmodel->addtotouids($uids, array( 'table' => $moders['table'], 'mid' => $id, 'modename' => $modename, 'modenum' => $modenum, )); $title = $this->rock->reparr($title, $this->rs); $reim->pushagent($uids, $gname, $cont, $title, $url, $wxurl, $slx, ''.$modenum.'|'.$id.''); $this->flowchangetodo($uids, $gname); if(isempt($title))$title = $modename; $this->flowweixinarr=array(); return $receid; } public function nexttodo($nuid, $type, $sm='', $act='') { $cont = ''; $tit = ''; $gname = '娴佺▼寰呭姙'; $summary= $this->getsummary(); if($type=='submit' || $type=='next' || $type == 'cuiban'){ $cont = '浣犳湁['.$this->uname.']鐨刐'.$this->modename.',鍗曞彿:'.$this->sericnum.']闇瑕佸鐞'; if($sm!='')$cont.='锛岃鏄:'.$sm.''; $tit = ''.$this->uname.'鐨'.$this->modename.''; if($type != 'cuiban'){ $txnum = $this->option->getval('sms_txnum'); if(!isempt($txnum)){ $mknum = $this->option->getval('sms_mknum'); if($mknum=='all' || contain(','.$mknum.',',','.$this->modenum.',')){ $wxurl = $this->getxiangurlx(); $barr = c('xinhuapi')->sendsms($nuid, '', $txnum, array( 'modename' => $this->modename, 'sericnum' => $this->sericnum, 'applyname'=> $this->uname, 'deptname' => $this->rs['base_deptname'], ),$wxurl); } } } $type = 'daiban'; } if($type == 'nothrough'){ $cont = '浣犳彁浜'.$this->modename.',鍗曞彿:'.$this->sericnum.']'.$this->adminname.'澶勭悊['.$act.']锛屽師鍥:['.$sm.']'; $gname= '娴佺▼鐢宠'; $tit = ''.$this->modename.'澶勭悊'.$act.''; } if($type == 'finish'){ $cont = '浣犳彁浜ょ殑['.$this->modename.',鍗曞彿:'.$this->sericnum.']宸插叏閮ㄥ鐞嗗畬鎴'; $gname= '娴佺▼鐢宠'; $tit = ''.$this->modename.'鍏ㄩ儴澶勭悊瀹屾垚'; } if($type == 'zhui'){ $cont = ''.$this->adminname.'杩藉姞鍗曟嵁璇存槑['.$this->modename.',鍗曞彿:'.$this->sericnum.']锛岃鏄:['.$sm.']'; } if($type == 'tui'){ $cont = '['.$this->adminname.']閫鍥炲崟鎹甗'.$this->modename.',鍗曞彿:'.$this->sericnum.']鍒颁綘杩欒鍙婃椂澶勭悊锛岃鏄:'.$sm.''; } if($type == 'chao'){ $cont = ''.$this->adminname.''.$sm.'浜嗏'.$this->modename.'鈥'; if(!isempt($summary))$cont.='锛屾憳瑕佲'.$summary.'鈥'; if($this->isflow>0)$cont.='锛屽崟鍙封'.$this->sericnum.'鈥'; $gname= ''; $tit = ''.$this->modename.'鐨勫崟鎹妱閫'; } if($type=='pinglun'){ $cont = ''.$this->adminname.''.$act.'浣犵殑['.$this->modename.']鍗曟嵁锛岃鏄:'.$sm.''; $gname = ''; $tit = ''.$this->modename.'璇勮'; } if($type=='receipt'){ $cont = ''.$this->adminname.''.$act.'['.$this->modename.']鐨勫崟鎹'; if($sm!='')$cont.='锛岃鏄:'.$sm.''; $gname = '鍥炴墽纭'; $tit = ''.$this->modename.'鍥炴墽纭'; } $nbis = $this->flownexttodo($type); if($nbis){ if(is_string($nbis))$cont = $nbis; if(is_array($nbis)){ $tit = arrvalue($nbis, 'title', $tit); $gname = arrvalue($nbis, 'gname', $gname); $cont = arrvalue($nbis, 'cont', $cont); } } if($cont!='')$this->push($nuid, $gname, $cont, $tit); } public function getwxurl($num='') { if($num=='')$num = $this->modenum; $url = $this->rock->getouturl(); $str = ''.$url.'?m=ying&d=we&num='.$num.''; return $str; } public function getweurl($num='') { if($num=='')$num = $this->modenum; $url = $this->rock->getouturl(); $str = ''.$url.'?m=ying&d=we&mnum='.$num.''; return $str; } public function deletebill($sm='', $qxpd=true) { if(getconfig('systype')=='demo')return '婕旂ず璇峰嬁鍒犻櫎'; if($qxpd){ $is = $this->isdeleteqx(); if($is==0)return '鏃犳潈鍒犻櫎'; } if(method_exists($this,'flowdeletebillbefore')){ $bstr = $this->flowdeletebillbefore($sm); if(!isempt($bstr))return $bstr; } $modewhere = "`modenum`='".$this->modenum."' and `mid`=".$this->id.""; $this->flogmodel->delete($this->mwhere); m('reads')->delete($this->mwhere); m('file')->delfile('', "`mtype`='".$this->mtable."' and `mid`=".$this->id." and `id` not in(select `fileid` from `[Q]files` where `type`=3)"); $tables = $this->moders['tables']; if(!isempt($tables)){ $arrse = explode(',', $tables); foreach($arrse as $arrses)m($arrses)->delete('mid='.$this->id.''); } $this->billmodel->delete($this->mwhere); $this->todosmodel->delete($this->mwhere); $this->checksmodel->delete($this->mwhere); $this->chaomodel->delete($this->mwhere); m('remind')->delete($this->mwhere); m('todo')->delete($this->mwhere); m('todo')->delete($modewhere); m('receipt')->delete($this->mwhere); m('im_history')->delete("`xgurl`='".$this->modenum."|".$this->id."'"); m('files')->delete("`ip`='".$this->modenum."|".$this->id."'"); $this->delete($this->id); $this->flowdeletebill($sm); $this->flowzuofeibill($sm); $this->gettodosend('bodel','', $sm); $dels = '鍒犻櫎妯″潡['.$this->modename.']id涓'.$this->id.'鐨勫崟鎹'; $ztss = arrvalue($this->rs,'base_summary'); if(!isempt($ztss))$dels.=',鎽樿['.$ztss.']'; if(!isempt($sm))$dels.=',璇存槑:'.$sm.''; m('log')->addlogs('鍒犻櫎鍗曟嵁', $dels, 3); foreach($this->wherejoin as $num=>$fields){ $this->deletebilljoin($num, "`$fields`='$this->id'", $sm); } return 'ok'; } public function deletebilljoin($num, $where, $sm='') { $flow = m('flow')->initflow($num); $rows = $flow->getall($where); foreach($rows as $k1=>$rs1){ $mid = $rs1['id']; $flow->loaddata($mid, false); $flow->deletebill($sm, false); } } public function zuofeibilljoin($num, $where, $sm='') { $flow = m('flow')->initflow($num); $rows = $flow->getall($where); foreach($rows as $k1=>$rs1){ $mid = $rs1['id']; $flow->loaddata($mid, false); $flow->zuofeibill($sm); } } public function zuofeibill($sm='') { $this->addlog(array( 'explain' => $sm, 'name' => '浣滃簾', 'status' => 1, )); $this->update('`status`=5', $this->id); $zfarr = array( 'status' => 5, 'nstatus' => 5, 'checksm' => '浣滃簾锛'.$sm.'', 'nowcheckid' => '', 'nowcheckname' => '', 'nstatustext' => '浣滃簾', 'updt' => $this->rock->now, ); $this->billmodel->update($zfarr, $this->mwhere); $tables = $this->moders['tables']; if(!isempt($tables)){ $arrse = explode(',', $tables); foreach($arrse as $arrses)m($arrses)->delete('mid='.$this->id.''); } $this->flowzuofeibill($sm); $this->gettodosend('bozuofei','', $sm); foreach($this->wherejoin as $num=>$fields){ $this->zuofeibilljoin($num, "`$fields`='$this->id'", $sm); } return 'ok'; } public function openxiang() { $xiangdata = $btndata = array(); $data = $this->flowrsreplace($this->rs,4); foreach($this->fieldsarra as $k=>$rs){ if($rs['iszs']=='1'){ $xiangdata[] = array( 'name' => $rs['name'], 'fields'=> $rs['fields'], 'value' => $this->rock->repempt(arrvalue($data,$rs['fields'])) ); } } $barr['xiangdata'] = $xiangdata; $btnrows = $this->db->getrows('[Q]flow_menu',"`setid`='$this->modeid' and `status`=1 and `num` like 'open%'",'id,wherestr,name,num,issm,type','`sort`'); foreach($btnrows as $k=>$rs){ $wherestr = $rs['wherestr']; $bo = false; if(isempt($wherestr)){ $bo = true; }else{ $ewet = $this->wheremodel->getstrwhere($this->rock->jm->base64decode($wherestr)); $ewet = str_replace(array('{asqom}','1=2 and'),'', $ewet); $tos = $this->rows("`id`='$this->id' and $ewet"); if($tos>0)$bo = true; } if($bo)$btndata[] = array( 'id' => $rs['id'], 'name' => $rs['name'], 'issm' => $rs['issm'], ); } $barr['btndata'] = $btndata; if(method_exists($this,'flowopenxiang')){ $lbarr = $this->flowopenxiang($data,$xiangdata,$btndata); if(is_array($lbarr))foreach($lbarr as $k=>$v)$barr[$k]=$v; } return $barr; } public function smschuiban($sm='') { if($this->isflow>0 && $this->adminid==$this->uid){ $farr = $this->getflow(true); $nowcheckid = $farr['nowcheckid']; $tplnum = $this->option->getval('sms_cbnum','defnum'); $wxurl = $this->getxiangurlx(); $barr = c('xinhuapi')->sendsms($nowcheckid, '', $tplnum, array( 'modename' => $this->modename, 'sericnum' => $this->sericnum, 'applyname'=> $this->uname, 'deptname' => $this->rs['base_deptname'], ),$wxurl, false, false); if(!$barr['success'])return $barr['msg']; $this->addlog(array( 'explain' => $sm, 'name' => '鐭俊鍌姙', 'status' => 1, )); } return 'ok'; } public function reloadflow($sm='') { $this->update(array('status'=>0), $this->id); $this->flogmodel->update('`valid`=0', ''.$this->mwhere.' and `courseid`>0'); $this->addlog(array( 'explain' => $sm, 'name' => '閲嶆柊瀹℃壒', 'status' => 1, )); $this->getflow(true); $this->billmodel->update('`status`=0,`nstatus`=0',$this->mwhere); return 'ok'; } public function addschedule($sm='') { $txdt = $this->rock->post('txdt'); if(isempt($sm))return '璇存槑涓嶈兘涓虹┖'; if(isempt($txdt))return '鎻愰啋鏃堕棿涓嶈兘涓虹┖'; $barr['title'] = $sm; $barr['startdt'] = $txdt; $barr['uid'] = $this->adminid; $barr['optdt'] = $this->rock->now; $barr['optname']= $this->adminname; $barr['txsj'] = 1; m('schedule')->insert($barr); return 'ok'; } public function getoptmenu($flx=0) { $where = ''; if($flx==1)$where='and `iszs`=1'; $rows = $this->db->getrows('[Q]flow_menu',"`setid`='$this->modeid' ".$where." and `status`=1",'id,wherestr,name,statuscolor,statusvalue,num,islog,issm,type,upgcont','`sort`'); $arr = array(); $bfrom = $this->rock->post('bfrom'); if($flx==0)$arr[] = array('lx'=>0,'name'=>$this->rock->jm->base64decode('5pyq562!5o6I5peg5rOV5pi!56S66I!c5Y2V5aaC5bey562!5o6I5Y675Y2H57qn'),'optmenuid'=>0,'color'=>'red'); if($flx==1)return $arr; $status = (int)arrvalue($this->rs,'status','0'); $isturn = (int)arrvalue($this->rs, 'isturn','0'); $ismy = ($this->uid == $this->adminid or $this->optid == $this->adminid); $isreadbo = $this->isreadqx(1); if($this->isflow>0 && $isturn==1){ } if($status != 5 && arrvalue($this->moders,'ispl','1')=='1' && $isreadbo){ $arr[] = array('name'=>lang('璇勮'),'lx'=>15,'nup'=>1,'issm'=>1,'optmenuid'=>-15); } if($ismy && arrvalue($this->moders,'ishz')=='1' && $status==1){ $smcont = $this->getsummary(); $mid = (int)m('receipt')->getmou('id',"`uid`='$this->adminid' and `modenum`='$this->modenum' and `mid`='$this->id'"); $namess = '鍥炴墽纭璁剧疆'; if($mid>0)$namess = '鍥炴墽纭缂栬緫'; $arr[] = array('name'=>$namess,'djmid'=>$mid,'optnum'=>'receipt','lx'=>'18','optmenuid'=>-18,'modename'=>$this->modename,'smcont'=>$smcont); } if($isreadbo && arrvalue($this->moders,'istxset','1')=='1' && $this->modenum != 'remind' && !in_array($status, array(2,5))){ $smcont = ''.$this->modename.'锛'.$this->getsummary(); $mid = (int)m('remind')->getmou('id',"`uid`='$this->adminid' and `modenum`='$this->modenum' and `mid`='$this->id'"); $namess = '锛嬫坊鍔犳彁閱掕缃'; if($mid>0)$namess = '鎻愰啋璁剧疆缂栬緫'; $arr[] = array('name'=>$namess,'djmid'=>$mid,'smcont'=>$smcont,'issm'=>1,'optnum'=>'tixing','lx'=>'14','optmenuid'=>-14); } if($this->iseditqx()==1 && $isreadbo){ $arr[] = array('name'=>lang('缂栬緫'),'optnum'=>'edit','lx'=>'11','optmenuid'=>-11); } if($this->isdeleteqx()==1){ $arr[] = array('name'=>lang('鍒犻櫎'),'color'=>'red','optnum'=>'del','nup'=>1,'issm'=>0,'islog'=>0,'statusvalue'=>9,'lx'=>'9','optmenuid'=>-9); } if(method_exists($this,'flowgetoptmenuarr')){ $lbarr = $this->flowgetoptmenuarr($flx); if(is_array($lbarr))foreach($lbarr as $k=>$v)$arr[]=$v; } return $arr; } public function optmenu($czid, $zt, $sm='') { $msg = ''; $cname = $this->rock->post('changename'); $cnameid = $this->rock->post('changenameid'); $cdate = $this->rock->post('changedate'); $darr = array( 'cname' => $cname, 'cnameid' => $cnameid, 'cdate' => $cdate, 'sm' => $sm, ); if($czid==-9){ $msg = $this->deletebill($sm); }else if($czid==-10){ $msg = $this->check($zt, $sm); if(contain($msg,'鎴愬姛'))$msg = 'ok'; }else if($czid==-12){ $this->zhuijiaexplain($sm); }else if($czid==-13){ $this->chuiban($sm); }else if($czid==-14){ $msg = $this->addschedule($sm); }else if($czid==-15){ $actname = $this->rock->post('name'); $this->addlog(array( 'explain' => $sm, 'name' => $actname, )); $uids = ''; if(isset($this->rs['uid'])){ $uids= $this->rs['uid']; }else if(isset($this->rs['optid'])){ $uids= $this->rs['optid']; } if($uids)$this->nexttodo($uids, 'pinglun', $sm, $actname); $this->gettodosend('boping','', $sm); }else if($czid==-16){ $this->zuofeibill($sm); }else if($czid==-17){ $msg = $this->smschuiban($sm); }else if($czid==-18){ $msg = $this->jiankongzb($darr); }else if($czid==-19){ $msg = $this->reloadflow($sm); }else{ } if($msg=='')$msg='ok'; return $msg; } public function jiankongzb($darr) { return $this->bd6('5peg5L!h5ZG8562!5o6I5peg5q2k5Yqf6IO9'); } public function billwhere($uid, $lx) { $arr['table'] = $this->mtable; $arr['tableleft'] = ''; $arr['fields'] = ''; $arr['order'] = ''; $arr['group'] = ''; $arr['keywhere']= ''; $arr['asqom'] = ''; $arr['onlywhere'] = ''; $arr['companywhere']= ''; $this->atype = $lx; $nas = $this->flowbillwhere($uid, $lx); $inwhere = ''; if(substr($lx,0,5)=='grant'){ $inwhere = $this->viewmodel->viewwhere($this->moders, $this->adminid, $this->flowviewufieds, 1); } if($lx=='chaos'){ $inwhere = "and {asqom}`id` in(select `mid` from `[Q]flow_chao` where `table`='{$this->mtable}' and ".$this->rock->dbinstr('csnameid', $this->adminid).")"; } if($lx=='mychuli'){ $inwhere = "and {asqom}`id` in(select bill.`mid` from `[Q]flow_bill` as `bill` where bill.`modeid`='{$this->modeid}' and ".$this->rock->dbinstr('bill.`allcheckid`', $this->adminid).")"; } $_wehs = ''; if(is_array($nas)){ if(isset($nas['where']))$_wehs = $nas['where']; $ftears = explode(',','asqom,order,fields,fieldsleft,table,group,companywhere,onlywhere,keywhere,tableleft'); foreach($ftears as $fid)if(isset($nas[$fid]))$arr[$fid] = $nas[$fid]; }else{ $_wehs = $nas; } $fwhere = $this->getflowwhere($uid, $lx); $path = ''.P.'/flow/page/rock_page_'.$this->modenum.'.php'; $table = $arr['table']; $temsao = 0; if(!contain($table, ' ') && $this->isflow>0){ $arr['table'] = '`[Q]'.$this->mtable.'` a left join `[Q]flow_bill` b on a.`id`=b.`mid` and b.`table`=\''.$this->mtable.'\''; if(!isempt($arr['tableleft']))$arr['table'].=' left join '.$arr['tableleft'].''; $arr['asqom'] = 'a.'; $arr['fields']= 'a.*,b.`uname` as base_name,b.`udeptname` as base_deptname,b.`sericnum`,b.`nowcheckname`'; if(isset($arr['fieldsleft']) && $arr['fieldsleft'])$arr['fields'].=','.$arr['fieldsleft'].''; if($arr['order']=='')$arr['order'] = 'a.`optdt` desc'; $temsao = 1; if($this->defaultorder){ $defa = explode(',', $this->defaultorder); $desc = arrvalue($defa, 1, 'desc'); $arr['order'] = 'a.`'.$defa[0].'` '.$desc.''; } } if(isempt($arr['order'])){ $arr['order'] = '{asqom}`id` desc'; if($this->defaultorder){ $defa = explode(',', $this->defaultorder); $desc = arrvalue($defa, 1, 'desc'); $arr['order'] = '{asqom}`'.$defa[0].'` '.$desc.''; } } if(isempt($fwhere) && isempt($inwhere) && $this->moders['isscl']>0){ $fwhere = 'and 1=2'; } $where = $inwhere; $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $where .= ' and {asqom}'.$wherestr; } if($fwhere!='')$where .= ' '.$fwhere; if($_wehs!='')$where .= ' '.$_wehs; $highwhere = $this->gethighwhere(); $allfields = array(); $key = $this->rock->post('key'); $pnum = $this->rock->post('pnum'); $status = $this->rock->post('keystatus'); $ztfields = arrvalue($nas, 'ztfields', 'status'); $xhlikea = array('like','=','>=','<=', 'not like'); $xhfields = $this->rock->post('xhfields'); $xhlike = (int)$this->rock->post('xhlike','0'); $xhkeygj = $this->rock->jm->base64decode($this->rock->post('xhkeygj')); if(!isempt($xhkeygj) && $xhfields){ if(substr($xhfields,0,2)=='zb'){ $xu = substr($xhfields,2,1); $zbasr = explode(',', $this->moders['tables']); $zbts = arrvalue($zbasr,$xu); $xhfields = substr($xhfields,4); $wher1 = "`$xhfields` ".$xhlikea[$xhlike].""; if($xhlike==0 || $xhlike==4)$wher1.=" '%".$xhkeygj."%'"; if($xhlike==1 || $xhlike==2 || $xhlike==3)$wher1.=" '$xhkeygj'"; $wher1 = " and {asqom}`id` in(select `mid` from `[Q]".$zbts."` where ".$wher1.")"; $where.= $wher1; }else{ $wher1 = " and {asqom}`$xhfields` ".$xhlikea[$xhlike].""; if($xhlike==0 || $xhlike==4)$wher1.=" '%".$xhkeygj."%'"; if($xhlike==1 || $xhlike==2 || $xhlike==3)$wher1.=" '$xhkeygj'"; $where.= $wher1; } } if(!isempt($status))$where .= ' and {asqom}`'.$ztfields.'`='.$status.''; if(!isempt($key) && isempt($arr['keywhere'])){ $check = c('check'); $allfields = $this->db->getallfields('[Q]'.$this->mtable.''); $_kearr = array(); if($check->isdate($key) || $check->ismonth($key)){ $skeay = array('date','datetime','month'); foreach($this->fieldsarra as $k=>$rs){ $flx = $rs['fieldstype']; $fid = $rs['fields']; if($rs['issou']==1 && in_array($flx, $skeay) && in_array($fid, $allfields)){ if($check->isdate($key)){ if($flx=='date')$_kearr[] = "{asqom}`".$fid."`='$key'"; if($flx=='datetime')$_kearr[] = "{asqom}`".$fid."` like '$key%'"; if($flx=='month')$_kearr[] = "{asqom}`".$fid."`='".substr($key,0,7)."'"; if($temsao==1){ $_kearr[] = "b.`applydt`='$key'"; } } if($check->ismonth($key)){ if($flx=='month'){ $_kearr[] = "{asqom}`".$fid."`='$key'"; }else{ $_kearr[] = "{asqom}`".$fid."` like '$key%'"; } if($temsao==1){ $_kearr[] = "b.`applydt` like '$key%'"; } } } } } if(!$_kearr){ $skeay = array('text','textarea','htmlediter','changeuser','changeusercheck','changedept','changedeptusercheck','selectdatafalse','selectdatatrue','num'); $xiakk = array('rockcombo','select'); foreach($this->fieldsarra as $k=>$rs){ if($rs['issou']==1 && in_array($rs['fields'], $allfields) && substr($rs['fields'],-2) != 'dt'){ if(in_array($rs['fieldstype'], $skeay))$_kearr[] = "{asqom}`".$rs['fields']."` like '%".$key."%'"; } } if($temsao==1){ $_kearr[] = "b.`uname` like '%".$key."%'"; $_kearr[] = "b.`udeptname` like '%".$key."%'"; $_kearr[] = "b.`sericnum` = '$key'"; $_kearr[] = "b.`nowcheckname` = '$key'"; } if(isset($nas['orlikefields'])){ $owhee = explode(',', $nas['orlikefields']); foreach($owhee as $owhees){ $_owhees = explode('@', $owhees); $sle = arrvalue($_owhees, 1); if($sle=='1'){ $_kearr[] = "".$_owhees[0]." ='$key'"; }else{ $_kearr[] = "".$_owhees[0]." like '%".$key."%'"; } } } } if($_kearr && $arr['onlywhere']=='')$arr['keywhere'] = "and (".join(' or ',$_kearr).")"; } if(!isempt($arr['companywhere']) && getconfig('companymode'))$where .= ' '.$arr['companywhere']; if(!isempt($arr['onlywhere']))$where .= ' '.$arr['onlywhere']; if(!isempt($arr['keywhere']))$where .= ' '.$arr['keywhere']; if($highwhere!='')$where .= ' '.$highwhere; $where = str_replace('{asqom}', $arr['asqom'], $where); $arr['order'] = str_replace('{asqom}', $arr['asqom'], $arr['order']); $where = str_replace('[A]', $arr['asqom'], $where); $fields = $arr['fields']; if($this->flowfieldstype==1 && (isempt($fields) || $fields=='*') && $this->moders['isscl']>0){ if(!$allfields)$allfields = $this->db->getallfields('[Q]'.$this->mtable.''); $fields = '{asqom}`id`'; $odlvs = $this->option->getval('columns_'.$this->modenum.'_'.$pnum.''); if(isempt($odlvs)){ foreach($this->fieldsarra as $k=>$rs){ if($rs['islb']==1 && in_array($rs['fields'],$allfields)){ $fields.=',{asqom}`'.$rs['fields'].'`'; } } }else{ $odlvsa = explode(',', $odlvs); foreach($odlvsa as $odlvs1){ if(in_array($odlvs1, $allfields)){ $fields.=',{asqom}`'.$odlvs1.'`'; } } } if($this->isflow>0){ if(!contain($fields,'`status`'))$fields.=',{asqom}`status`'; } $fields = str_replace('{asqom}', $arr['asqom'], $fields); $arr['fields'] = $fields; } $fields = $arr['fields']; if(!isempt($fields) && $fields!='*'){ $fieldsa = explode(',', $fields); $fieldss = ''; foreach($fieldsa as $fieldsas){ if(contain($fieldsas,'`') || contain($fieldsas,'.') || contain($fieldsas,' ') || contain($fieldsas,'(')){ $fieldss.=','.$fieldsas.''; }else{ $fieldss.=',`'.$fieldsas.'`'; } } $arr['fields'] = substr($fieldss, 1); } $arr['where'] = str_replace('{asqom}','', $where); return $arr; } public function gethighwhere() { $s = ''; return $s; } public function getflowwhere($uid, $num) { $where = ''; $rs = $this->wheremodel->getone("`setid`='$this->modeid' and `num`='$num'"); if(!$rs)return $where; $where = $this->wheremodel->getwherestr($rs, $uid, $this->flowviewufieds); return $where; } public function getflowrows($uid, $lx, $limit=5, $swher='') { $nas = $this->billwhere($uid, $lx); $table = $nas['table']; if(!contain($table,' '))$table='[Q]'.$table.''; if(isempt($nas['fields']))$nas['fields'] = '*'; $swher = str_replace('{asqom}',$nas['asqom'], $swher); $where = '1=1 '.$nas['where'].' '.$swher.''; if($limit==0)return $this->db->rows($table, $where ); $rows = $this->db->getrows($table, $where , $nas['fields'], $nas['order'], $limit); foreach($rows as $k=>$rs){ $rows[$k] = $this->rsreplace($rs, 2); } return $rows; } public function gettodorows($whereid) { $where = $this->wheremodel->getwherestr($whereid, $this->adminid, $this->flowviewufieds); $wherestr = $this->moders['where']; if(!isempt($wherestr)){ $wherestr = $this->rock->covexec($wherestr); $where .= ' and '.$wherestr; } $where = str_replace('{asqom}','', $where); $rows = $this->getall('2=2 '.$where.''); foreach($rows as $k=>$rs){ $rows[$k] = $this->rsreplace($rs, 1); } return $rows; } public function printexecl($event) { $arr['moders'] = $this->moders; $arr['fields'] = $this->getfields(); $cell = 1; foreach($arr['fields'] as $k=>$v)$cell++; $arr['cell'] = $cell; $where = '1=1'; $str1 = $this->moders['where']; if(!isempt($str1)){ $str1 = $this->rock->covexec($str1); $where = $str1; } $vwhere = $this->viewmodel->viewwhere($this->moders, $this->adminid); $rows = $this->getrows(''.$where.' '.$vwhere.'', '*', 'id desc', 100); $arr['rows'] = $this->flowprintrows($rows); $arr['count'] = $this->db->count; return $arr; } public function getsuballdata($lx=0, $mid=0) { $tabless = $this->moders['tables']; $subdata = array(); if($mid==0)$mid = $this->id; if(!isempt($tabless)){ $tablessa = explode(',', $tabless); $namessa = explode(',', $this->moders['names']); $tabless1 = '['.str_replace(',','],[', $tabless).']'; foreach($tablessa as $zbx=>$tables){ $cis = substr_count($tabless1, '['.$tables.']'); $whes = ''; if($cis>1)$whes=' and `sslx`='.$zbx.''; $data = m($tables)->getall('mid='.$mid.''.$whes.'','*','`sort`'); $data = $this->flowsubdata($data, $lx, $zbx); if($lx == 0){ $subdata['subdata'.$zbx.''] = $data; }else{ $subdata[$zbx] = array( 'data' => $data, 'fields'=> 'subdata'.$zbx.'', 'name' => $this->rock->arrvalue($namessa, $zbx) ); } } } return $subdata; } private $gettodolistarr = null; public function gettodolist($act) { if(is_array($act))return $act; if($this->gettodolistarr === null){ $rows = $this->todomodel->getrows("`setid`='".$this->modeid."' and `status`=1"); $barr = array(); foreach($rows as $k=>$rs){ $whereid = (int)$rs['whereid']; if($whereid > 0){ $bo = $this->wheremanzhu($whereid); if(!$bo)continue; } $barr[] = $rs; } $this->gettodolistarr = $barr; }else{ $barr = $this->gettodolistarr; } $garr = array(); if($barr)foreach($barr as $k=>$rs){ if(arrvalue($rs,$act)=='1')$garr[] = $rs; } return $garr; } public function gettodosend($act, $actname='',$sm='', $courseid=0, $conts='') { $barr = $this->gettodolist($act); if(!$barr)return; $changearr = array('boturn'=>'鎻愪氦','boedit'=>'缂栬緫','bozhuan'=>'杞姙','bochang'=>'淇敼瀛楁','bodel'=>'鍒犻櫎','bozuofei'=>'浣滃簾','botong'=>'澶勭悊鍚屾剰','bobutong'=>'澶勭悊涓嶅悓鎰','bofinish'=>'鍏ㄩ儴澶勭悊瀹屾垚','bozhui'=>'杩藉姞璇存槑','boping'=>'璇勮','bohuiz'=>'鍥炴墽纭'); if($actname=='' && is_string($act))$actname = arrvalue($changearr, $act); if(isempt($actname))return; $cheo = c('check'); foreach($barr as $k=>$rs){ $receid = $rs['receid']; if($act=='botong' || $act=='bobutong'){ $changewe = $rs['changecourse']; if(!isempt($changewe) && !contain(','.$changewe.',',','.$courseid.','))continue; } if($rs['toturn']==1)$receid.=','.$this->uid.''; if(arrvalue($rs,'tosuper')=='1'){ $supar = $this->adminmodel->getsuperman($this->uid); $shnej = arrvalue($supar, 0); if(!isempt($shnej))$receid.=','.$shnej.''; } if($rs['tocourse']==1 && $this->billrs){ $allcheckid = $this->billrs['allcheckid']; if(!isempt($allcheckid))$receid.=','.$allcheckid.''; } $todofields = $rs['todofields']; if(!isempt($todofields)){ $toad = explode(',', $todofields); foreach($toad as $toads){ $ttv = arrvalue($this->rs, $toads); if(!isempt($ttv) && $cheo->isinnumber($ttv))$receid.=','.$ttv.''; } } if(isempt($receid))continue; if(substr($receid,0,1)==',')$receid = substr($receid, 1); $cont = $rs['summary']; if(isempt($cont))$cont = $conts; if(isempt($cont)){ $cont = ''.$this->adminname.''.$actname.'['.$this->modename.',鍗曞彿:'.$this->sericnum.']'; if($sm!='')$cont.=',璇存槑:'.$sm.''; } $this->push($receid, '', $cont, $this->rock->repempt($rs['name'])); } } public function numtodosend($num, $actname='',$sm='') { $rows = $this->todomodel->getrows("`setid`='".$this->modeid."' and `num`='$num' and `status`=1"); if(!$rows)return; $this->gettodosend($rows, $actname, $sm); } public function flowtotal($fields='', $type='') { if($fields=='')$fields = $this->rock->post('total_fields'); if($type=='')$type = $this->rock->post('total_type','jls'); $typea = explode('|', $type); $typefields = ''; $type = $typea[0]; $typefields = arrvalue($typea, 1); $rowa = array(); $rowa[] = array( 'name' => '鏆傛棤鏁版嵁', 'value' => 0, 'bili' => '' ); $tofiels= 'count(1)'; if($type=='sum')$tofiels = 'sum([A]`'.$typefields.'`)'; if($type=='avg')$tofiels = 'avg([A]`'.$typefields.'`)'; $atype = $this->rock->post('atype'); $table = '[Q]'.$this->mtable.''; $narr = $this->billwhere($this->adminid, $atype); $where = $narr['where']; $table = $narr['table']; if(!contain($table,' '))$table = '[Q]'.$table.''; $gwhere = $this->rock->post('where'); if(!isempt($gwhere)){ $gwhere = $this->rock->jm->uncrypt($this->rock->iconvsql($gwhere)); $where .= ' '.$gwhere.''; } $sql = 'select '.$fields.' as `name`,'.$tofiels.' as value from '.$table.' where 1=1 '.$where.' group by '.$fields.''; $sql = str_replace('[A]', $narr['asqom'], $sql); $rows = $this->db->getall($sql); $total = 0; if($rows){ foreach($rows as $k=>$rs)$total+=floatval($rs['value']); if($total>0)foreach($rows as $k=>$rs){ $rows[$k]['bili'] = $this->rock->number($rs['value']*100/$total).'%'; } if($type!='avg' && count($rows)>1)$rows[] = array('name' => '鍚堣','value' => $total,'bili' => ''); }else{ $rows = $rowa; } return $rows; } public function receiptcheck($hid, $sm) { return 'ok'; } public function getrowstable($atype, $where, $limit=100,$fields='') { $rows = $this->getflowrows($this->adminid,$atype,$limit,$where); $headstr = '@xuhaos,,center'; foreach($this->fieldsarra as $k=>$rs){ $bo = false; if(!$fields && $rs['islb']==1 && $rs['iszb']=='0')$bo = true; if($fields && contain(','.$fields.',',','.$rs['fields'].','))$bo = true; if($bo)$headstr.='@'.$rs['fields'].','.$rs['name'].''; } if($this->isflow>0){ $headstr.='@statustext,鐘舵'; if(is_array($rows))foreach($rows as $k=>$rs){ $rows[$k]['statustext'] = $this->getstatusstr($rs); } } $cont = c('html')->createrows($rows, substr($headstr, 1),'#cccccc','noborder'); return $cont; } public function lang($ky) { return lang($ky,'mode_'.$this->modenum.''); } public function rsreplace($rs, $lx, $kzq=null, $ly=0) { $rs = $this->flowrsreplace($rs, $lx); if($this->tfieldarr)foreach($this->tfieldarr as $k1=>$frs){ $type = $frs['fieldstype']; $fid = $frs['fields']; $val = arrvalue($rs, $fid); if($type=='uploadimg' && !contain($val,'<')){ if($val && $lx==2)$rs[''.$fid.'_textcn'] = ' '; continue; } if(isempt($frs['data']))continue; if(isempt($val) || !is_numeric($val))continue; if(!array_key_exists('store', $frs)){ if($this->inputobj == null){ $this->inputobj = c('input'); $this->inputobj->flow = $this; } $store = $this->inputobj->getdatastore($frs['fieldstype'], $kzq, $frs['data'], $fid); $this->tfieldarr[$k1]['store'] = $store; }else{ $store = $frs['store']; } if($store)foreach($store as $x=>$rv){ if($rv['value']==$val){ $rs[''.$fid.'_yuan'] = $val; if($lx==2 && $ly==0){ $rs[''.$fid.'_textcn'] = $rv['name']; if(isset($rv['color']))$rs[''.$fid.'_color'] = $rv['color']; }else{ $rs[$fid] = $rv['name']; if(isset($rv['color']))$rs[$fid] = ''.$rs[$fid].' '; } break; } } } return $rs; } public function viewjinfields($rows) { if(!$rows)return $rows; return $rows; } public function daochusubtable($rows) { return $rows; } }
\ No newline at end of file
diff --git a/webmain/model/flow/goodsModel.php b/webmain/model/flow/goodsModel.php
index f36aa1d..0119dc3 100644
--- a/webmain/model/flow/goodsModel.php
+++ b/webmain/model/flow/goodsModel.php
@@ -3,8 +3,14 @@
class flow_goodsClassModel extends flowModel
{
+ public $base;
+ public function initModel()
+ {
+ $this->base = m('goods');
+ }
+
protected function flowchangedata(){
- $this->rs['typeid'] = m('goods')->gettypename($this->rs['typeid']);
+ $this->rs['typeid'] = $this->base->gettypename($this->rs['typeid']);
}
//瀵煎叆鏁版嵁鐨勬祴璇曟樉绀
@@ -40,6 +46,10 @@ class flow_goodsClassModel extends flowModel
//
public function flowrsreplace($rs, $lx=0)
{
+
+ if(isset($rs['typeid']) && is_numeric($rs['typeid']))
+ $rs['typeid'] = $this->base->gettypename($rs['typeid']);
+
//璇︽儏椤典笅鏄剧ず瀵瑰簲浠撳簱搴撳瓨
if($lx==1){
$drows = $this->db->getall("SELECT `depotid`,sum(count)count FROM `[Q]goodss` where aid=".$rs['id']." and `status`=1 GROUP BY `depotid`");
@@ -84,4 +94,18 @@ class flow_goodsClassModel extends flowModel
m('goodss')->delete('`aid`='.$this->id.'');
m('goods')->setstock();
}
+
+ protected function flowbillwhere($uid, $lx)
+ {
+ $where = '';
+ $typeid = $this->rock->post('typeid','0');
+ if($typeid!='0'){
+ $alltpeid = m('option')->getalldownid($typeid);
+ $where .= ' and `typeid` in('.$alltpeid.')';
+ }
+ return array(
+ 'where' => $where,
+ 'order' => 'optdt desc',
+ );
+ }
}
\ No newline at end of file
diff --git a/webmain/model/flow/meetModel.php b/webmain/model/flow/meetModel.php
index af60bf7..bc02445 100644
--- a/webmain/model/flow/meetModel.php
+++ b/webmain/model/flow/meetModel.php
@@ -51,15 +51,17 @@ class flow_meetClassModel extends flowModel
$nzt = $zt;
$time = time();
- $stime = strtotime($rs['startdt']);
- $etime = strtotime($rs['enddt']);
- if($zt < 2){
- if($etime<$time){
- $nzt = 2;
- }else if($stime>$time){
- $nzt = 0;
- }else{
- $nzt = 1;
+ if(!isempt($rs['startdt']) && !isempt($rs['enddt'])){
+ $stime = strtotime($rs['startdt']);
+ $etime = strtotime($rs['enddt']);
+ if($zt < 2){
+ if($etime<$time){
+ $nzt = 2;
+ }else if($stime>$time){
+ $nzt = 0;
+ }else{
+ $nzt = 1;
+ }
}
}
@@ -231,9 +233,13 @@ class flow_meetClassModel extends flowModel
//姣忓ぉ杩愯璁″垝浠诲姟灏嗗浐瀹氫細璁敓鎴愭櫘閫氫細璁氱煡瀵瑰簲浜
public function createmeet($id=0, $nowdt='', $gbrr=false)
{
- $owhe = '';
- if($id>0)$owhe='`id`='.$id.' and ';
- $narr = $this->getall(''.$owhe.'`type`=1 and `status`=1');
+ if(is_array($id)){
+ $narr = $id;
+ }else{
+ $owhe = '';
+ if($id>0)$owhe='`id`='.$id.' and ';
+ $narr = $this->getall(''.$owhe.'`type`=1 and `status`=1');
+ }
$dtobj = c('date');
$jlarr = array();
foreach($narr as $k=>$rs){
diff --git a/webmain/model/flow/subscribeinfoModel.php b/webmain/model/flow/subscribeinfoModel.php
index 82d1453..be77847 100644
--- a/webmain/model/flow/subscribeinfoModel.php
+++ b/webmain/model/flow/subscribeinfoModel.php
@@ -87,7 +87,7 @@ class flow_subscribeinfoClassModel extends flowModel
$newid = $this->insert(array(
'mid' => $id,
'receid' => $receid,
- 'recename' => $recename,
+ 'recename' => $this->rock->xssrepstr($recename),
'title' => $title,
'cont' => $cont,
'optdt' => $this->rock->now,
diff --git a/webmain/model/flowbillModel.php b/webmain/model/flowbillModel.php
index 00e70b4..db3cb5b 100644
--- a/webmain/model/flowbillModel.php
+++ b/webmain/model/flowbillModel.php
@@ -154,7 +154,7 @@ class flowbillClassModel extends Model
$modename = $mors['name'];
$rers = $this->db->getone('[Q]'.$rs['table'].'', $rs['mid']);
if($rers){
- $tihsrs = $flow->flowrsreplace($rers, 2);
+ $tihsrs = $flow->rsreplace($rers, 2, null, 1);
$summary = $this->rock->reparr($mors['summary'], $tihsrs);
$summarx = $this->rock->reparr($mors['summarx'], $tihsrs);
@@ -316,7 +316,7 @@ class flowbillClassModel extends Model
$rers = $this->db->getone('[Q]'.$rs['table'].'', $rs['mid']);
$summary = $this->rock->reparr($summary, $rers);
if($rers){
- $tihsrs = $flow->flowrsreplace($rers, 2);
+ $tihsrs = $flow->rsreplace($rers, 2, null, 1);
$summary = $this->rock->reparr($mors['summary'], $tihsrs);
$nowsets = $rs['nowcheckname']; //褰撳墠瀹℃牳浜
diff --git a/webmain/model/inputModel.php b/webmain/model/inputModel.php
index 82363c2..e9748a8 100644
--- a/webmain/model/inputModel.php
+++ b/webmain/model/inputModel.php
@@ -66,7 +66,7 @@ class inputClassModel extends Model
$strm.= ' {鍒,'.$xu.'}';
$strm.= ' ';
- if($ism==0)$str.='{鏂板,'.$xu.'}
';
+ if($ism==0)$str.='{鏂板,'.$xu.'}
';
if($ism==1){
$str.='{鏂板,'.$xu.'}
';
$strm.='{鏂板,'.$xu.'}
';
diff --git a/webmain/model/kqjcmdModel.php b/webmain/model/kqjcmdModel.php
index 0a1d9c5..611c13b 100644
--- a/webmain/model/kqjcmdModel.php
+++ b/webmain/model/kqjcmdModel.php
@@ -468,6 +468,8 @@ class kqjcmdClassModel extends Model
//淇濆瓨鎸囩汗
public function savefingerprint($snid, $uid, $finge)
{
+ $snid = (int)$snid;
+ $uid = (int)$uid;
$where = "`snid`='$snid' and `uid`='$uid'";
$arr['fingerprint1'] = str_replace("\n",'', arrvalue($finge, 0));
$arr['fingerprint2'] = str_replace("\n",'', arrvalue($finge, 1));
@@ -483,6 +485,8 @@ class kqjcmdClassModel extends Model
//淇濆瓨璁惧澶村儚
private function saveheadpic($snid, $uid, $headpic, $face='')
{
+ $snid = (int)$snid;
+ $uid = (int)$uid;
$where = "`snid`='$snid' and `uid`='$uid'";
if(isempt($face)){
if(isempt($headpic))return;
diff --git a/webmain/model/logModel.php b/webmain/model/logModel.php
index ec3ffd6..ac70928 100644
--- a/webmain/model/logModel.php
+++ b/webmain/model/logModel.php
@@ -48,8 +48,8 @@ class logClassModel extends Model
}else{
$arr['stotal'] = (int)$onrs['stotal']+1;
}
- $arr['ip'] = $this->rock->ip;
- $arr['web'] = $this->rock->web;
+ //$arr['ip'] = $this->rock->ip;//瀛樿繖涓病鐢紝涓嶅湪瀛樺偍
+ //$arr['web'] = $this->rock->web;
$arr['optdt'] = $this->rock->now();
$dbs->record($arr, $where);
}
diff --git a/webmain/model/loginModel.php b/webmain/model/loginModel.php
index 9ebdc44..676b04a 100644
--- a/webmain/model/loginModel.php
+++ b/webmain/model/loginModel.php
@@ -66,6 +66,7 @@ class loginClassModel extends Model
if(getconfig('systype')=='demo')$this->db->update('[Q]admin', '`status`=1' , '`id`=1 and `status`=0');
+
//1.鍏堢敤鐢ㄦ埛鍚嶅垽鏂
$arrs = array(
'user' => $user,
@@ -122,9 +123,8 @@ class loginClassModel extends Model
if($us)$loginx = '濮撳悕';
}
-
if($msg=='' && !$us){
- $msg = '鐢ㄦ埛涓嶅瓨鍦';
+ $msg = '鐢ㄦ埛鎴栧瘑鐮佷笉瀵'; //鐢ㄦ埛涓嶅瓨鍦ㄦ椂鎻愮ず
}else if($msg==''){
$uid = $us['id'];
$user = $us['user'];
@@ -142,7 +142,7 @@ class loginClassModel extends Model
}
}else{
- if(md5($pass)!=$us['pass'])$msg='瀵嗙爜涓嶅';
+ if(md5($pass)!=$us['pass'])$msg='鐢ㄦ埛鎴栧瘑鐮佷笉瀵'; //瀵嗙爜涓嶅鎻愮ず
if($msg!='' && $pass==md5($us['pass']) && c('cache')->get('login'.$user.'')==$uid){
$msg='';
diff --git a/webmain/model/reimModel.php b/webmain/model/reimModel.php
index df57a66..bdd770f 100644
--- a/webmain/model/reimModel.php
+++ b/webmain/model/reimModel.php
@@ -675,14 +675,16 @@ class reimClassModel extends Model
if($frs){
$type = $frs['fileext'];
$path = $frs['filepath'];
+ $isimg= $this->contain($imgext, ','.$type.',');
$boc = false;
if(substr($path,0,4)=='http' || !isempt($frs['filenum'])){
$boc = true;
}else{
if(file_exists($path))$boc = true;
}
+ if($isimg && !isempt($frs['thumbplat']))$boc = true;
if($boc){
- if($this->contain($imgext, ','.$type.',')){
+ if($isimg){
$frs['thumbpath'] = $fobj->getthumbpath($frs);
//$cont = ' ';
//$rows[$k]['cont'] = $this->rock->jm->base64encode($cont);
@@ -858,6 +860,7 @@ class reimClassModel extends Model
if(isset($cans['fileid']))$fileid=$cans['fileid'];
if(isset($cans['msgid']))$msgid=$cans['msgid'];
$pushcont = arrvalue($cans, 'pushcont');
+ $ispushapp = arrvalue($cans, 'ispushapp');//鏄惁鎺ㄩ乤pp
$arr = array(
'cont' => $cont,
'sendid' => $sendid,
@@ -900,20 +903,21 @@ class reimClassModel extends Model
if($sendid!=$receid)$this->addhistory('user', $sendid, $receid, $optdt, $cont, $sendid,'','', $arr['id']);
//鎺ㄩ佺殑鍘熺敓App涓(浣跨敤寮傛鎺ㄩ佸摝)
- $tuicont['sendid'] = $arr['sendid'];
- $tuicont['sendname'] = $this->adminname;
- $tuicont['name'] = $this->adminname;
- $tuicont['cont'] = $cont;
- $tuicont['pushcont'] = $pushcont;
- $tuicont['pushtype'] = 'chat'; //鎺ㄩ佹秷鎭被鍨
- $tuicont['receid'] = $receid;
- $tuicont['fileid'] = $fileid;
- $tuicont['type'] = 'user';
- $tuicont['id'] = $arr['id'];
- $tuicont['optdt'] = $optdt;
- $tuicont['optdts'] = substr($optdt,11,5);
- $this->pushapp($receid, '['.$this->adminname.']鍙戞潵涓鏉℃秷鎭', $tuicont, $lx);
-
+ if($ispushapp != 'no'){
+ $tuicont['sendid'] = $arr['sendid'];
+ $tuicont['sendname'] = $this->adminname;
+ $tuicont['name'] = $this->adminname;
+ $tuicont['cont'] = $cont;
+ $tuicont['pushcont'] = $pushcont;
+ $tuicont['pushtype'] = 'chat'; //鎺ㄩ佹秷鎭被鍨
+ $tuicont['receid'] = $receid;
+ $tuicont['fileid'] = $fileid;
+ $tuicont['type'] = 'user';
+ $tuicont['id'] = $arr['id'];
+ $tuicont['optdt'] = $optdt;
+ $tuicont['optdts'] = substr($optdt,11,5);
+ $this->pushapp($receid, '['.$this->adminname.']鍙戞潵涓鏉℃秷鎭', $tuicont, $lx);
+ }
/*
$last = date('Y-m-d H:i:s', time()-15);
$where = "`uid`='$receid' and `online`=1 and `cfrom` in('appandroid','appios') and `moddt`<'$last'";
@@ -1062,7 +1066,8 @@ class reimClassModel extends Model
}
$uwhere = "$where `status`=1";
$rows = m('logintoken')->getrows("`uid` in(select id from `[Q]admin` where $uwhere) and `cfrom` in ('nppandroid','nppios') and `online`=1",'*','id desc');
- $uida = $pushuids = $alias2019 = $uid2019 = array();
+ $jpreg = '';
+ $uida = $pushuids = $alias2019 = $uid2019 = $jparr = array();
$uids = '0';
$times = date('Y-m-d H:i:s', time()-5*60);//5鍒嗛挓
foreach($rows as $k=>$rs){
@@ -1076,14 +1081,19 @@ class reimClassModel extends Model
$nestr.=''.$rs['pushtoken'].''; //涓帹
}else if(contain($_web,'huawei') && !contain($rs['ip'],'.')){
$nestr.=''.$rs['ip'].'';
- }else if(contain($_web,'xiaomi')){
+ }else if(contain($_web,'xiaomi') || !isempt($rs['pushtoken'])){
$nestr.=''.$rs['pushtoken'].'';
}
+ if(arrvalue($rs,'regid')){
+ $nestr.='|'.$rs['regid'].'';
+ $jpreg = 'yes';
+ $jparr[] = $rs['regid'];
+ }
$alias2019[] = $nestr;
if(!in_array($_uid, $uid2019))$uid2019[] = $_uid;
if($rs['ispush']=='1')$pushuids[] = $_uid;//鍙互鎵嬫満鎺ㄩ佺殑鐢ㄦ埛
}
- return array('uids'=>$uids,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids);
+ return array('uids'=>$uids,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids, 'jpreg'=>$jpreg, 'jparr' => $jparr);
}
/**
@@ -1118,13 +1128,14 @@ class reimClassModel extends Model
));
//鏈嶅姟绔繑鍥瀧"zshu":2,"yfuid":"1,8","wfuid":""}
if($gbarr && $gbarr['success'] && $bstr = arrvalue($gbarr, 'data')){
- $data = json_decode($bstr, true);
- $yfuid= explode(',', arrvalue($data, 'yfuid'));
- if($yfuid){
+ $data = json_decode($bstr, true);
+ $yfuid = arrvalue($data, 'yfuid');
+ if(!isempt($yfuid)){//鏈夊湪绾夸汉鍛樼敤浜嗘湇鍔$鎺ㄩ
+ $yfuida = explode(',', $yfuid);
$nealas = array();
foreach($alias2019 as $alis){
$bo = false;
- foreach($yfuid as $yfid){if(contain($alis,'|'.$yfid.'|'))$bo=true;};
+ foreach($yfuida as $yfid){if(contain($alis,'|'.$yfid.'|'))$bo=true;};
if(!$bo)$nealas[] = $alis;
}
$alias['alias2019'] = $nealas;
@@ -1132,7 +1143,6 @@ class reimClassModel extends Model
}
}
}
-
return c('JPush')->push($title, $pushcont, $contjson, $alias);
}
@@ -1227,6 +1237,8 @@ class reimClassModel extends Model
foreach($cans as $k=>$v)$carr[$k]=$v;
$reimtype = $this->option->getval('reimservertype');
+
+ //if($carr['atype']=='sendapp')c('JPush')->sendJpush($carr);
if($reimtype=='1')return c('rockqueue')->pushdata($carr);
$str = json_encode($carr);
diff --git a/webmain/public/fileopen_mp4.html b/webmain/public/fileopen_mp4.html
index 9265572..a7829db 100644
--- a/webmain/public/fileopen_mp4.html
+++ b/webmain/public/fileopen_mp4.html
@@ -7,7 +7,7 @@
-
+
diff --git a/webmain/public/publicAction.php b/webmain/public/publicAction.php
index 306ed11..356cc7f 100644
--- a/webmain/public/publicAction.php
+++ b/webmain/public/publicAction.php
@@ -36,7 +36,7 @@ class publicClassAction extends ActionNot{
$exta = substr($filepath, -4);
if($exta=='html')$this->rock->location($filepath);
}
- }else if($type=='mp4'){
+ }else if($type=='mp4' || $type=='mp3'){
$this->displayfile = ''.P.'/public/fileopen_mp4.html';
}else if($fobj->isyulan($type)){
@@ -73,7 +73,10 @@ class publicClassAction extends ActionNot{
$str = 'mode/pdfjs2/viewer.html';
//exit($this->rock->HTTPweb);
- if(!$this->displayfile && file_exists($str) && !contain($this->rock->web,'MSIE') && !contain($this->rock->HTTPweb,'Chrome/5'))$this->displayfile = $str;
+ if(!$this->displayfile && file_exists($str) && !contain($this->rock->web,'MSIE') && !contain($this->rock->HTTPweb,'Chrome/5')){
+ if(contain($this->rock->HTTPweb, 'XINHUOAAPP IOS'))$str='';
+ $this->displayfile = $str;
+ }
$fobj->addlogs($id,0);//璁板綍棰勮璁板綍
}
diff --git a/webmain/reim/index/tpl_index_xina.html b/webmain/reim/index/tpl_index_xina.html
index 19c072b..d54b789 100644
--- a/webmain/reim/index/tpl_index_xina.html
+++ b/webmain/reim/index/tpl_index_xina.html
@@ -17,12 +17,12 @@
-
+
-
-
+
+
@@ -53,6 +53,7 @@ systitle = '=$da['title']?>';
companymode = =(getconfig('companymode')? 'true' : 'false')?>;
video_bool = =(getconfig('video_bool')? 'true' : 'false')?>;
function globalbody(){
+ token = js.getoption('admintoken', token);
adminid = '=$da['adminid']?>';
adminface = '=$da['face']?>';
adminname = '=$da['adminname']?>';
diff --git a/webmain/reim/record/recordAction.php b/webmain/reim/record/recordAction.php
index e6b24d7..6e70ace 100644
--- a/webmain/reim/record/recordAction.php
+++ b/webmain/reim/record/recordAction.php
@@ -112,7 +112,7 @@ class recordClassAction extends Action
//鍒犻櫎鑱婂ぉ璁板綍
public function delrecordAjax()
{
- $id = $this->post('id');
+ $id = c('check')->onlynumber($this->post('id'));
$atype = $this->post('atype');
if($atype!='all'){
if(!isempt($id)){
diff --git a/webmain/reim/tonghua/tpl_tonghua.html b/webmain/reim/tonghua/tpl_tonghua.html
index 32f8e80..0212403 100644
--- a/webmain/reim/tonghua/tpl_tonghua.html
+++ b/webmain/reim/tonghua/tpl_tonghua.html
@@ -10,7 +10,7 @@
-
+
diff --git a/webmain/system/beifen/beifenAction.php b/webmain/system/beifen/beifenAction.php
index 4709726..7232035 100644
--- a/webmain/system/beifen/beifenAction.php
+++ b/webmain/system/beifen/beifenAction.php
@@ -67,7 +67,7 @@ class beifenClassAction extends Action
if(getconfig('systype')=='demo')exit('婕旂ず璇峰嬁鎿嶄綔');
$rows = array();
$folder = $this->post('folder');
- $folder = str_replace('../','', $folder);
+ $folder = str_replace(array('..','/'),'', $folder);
$path = ''.UPDIR.'/data/'.$folder.'';
$carr = c('file')->getfilerows($path);
foreach($carr as $k=>$rs){
@@ -242,4 +242,94 @@ class beifenClassAction extends Action
return 'ok';
}
+
+
+ public function fenbiaoAjax()
+ {
+ $allfields = $this->db->getallfields('[Q]flow_set');
+ if(!in_array('logstr', $allfields)){
+ $bool = $this->db->query("alter table `[Q]flow_set` add `logstr` varchar(500) DEFAULT NULL COMMENT '鎿嶄綔璁板綍鍒嗚〃';", false);
+ if(!$bool)return '鏃犳硶鎿嶄綔:'.$this->db->error().'';
+ }
+
+ $obj = m('mode');
+ $rows = $obj->getall('1=1');
+ $atable = array();
+ $count = m('flow_log')->rows('1=1');
+ if($count < 10000)return '鎿嶄綔璁板綍灏戜簬1W鏉★紝涓嶉渶瑕佸垎琛';
+
+ $alltabls = $this->db->getalltable();
+ $barr = $this->createbiao(1, $alltabls);
+ if(!$barr['success'])return $barr['msg'];
+ $biao = $barr['data'];
+ if(1==1)foreach($rows as $k=>$rs){
+ $tab = $rs['table'];
+ if(!isset($atable[$tab])){
+ $max = m($tab)->getmou('max(id) as ids', 'id>0');
+ if(!$max)$max = 0;
+ $max++;
+ $atable[$tab] = $max;
+ }
+ $max = $atable[$tab];
+
+ $logstr = $rs['logstr'];
+ if(isempt($logstr)){
+ $logarr = array();
+ }else{
+ $logarr = json_decode($logstr, true);
+ }
+ if(!isset($logarr[$max]))$logarr[$max] = $biao;
+ $logstr = json_encode($logarr);
+
+ $obj->update(array(
+ 'logstr' => $logstr
+ ), $rs['id']);
+ }
+
+ //鏇存柊
+ $sql = "update `[Q]file` set `mtype`='flow_log".$biao."' where `mtype`='flow_log'";
+ $bool = $this->db->query($sql, false);
+
+ return 'ok';
+ }
+
+ public function createbiao($xu, $alltabls)
+ {
+ $biao = 'a'.$xu.'';
+ $lognab = 'flow_log'.$biao.'';
+ if(in_array(''.PREFIX.''.$lognab.'',$alltabls))return $this->createbiao($xu+1, $alltabls);
+
+ $sql = 'ALTER TABLE `[Q]flow_log` RENAME TO `[Q]'.$lognab.'`;';
+ $bool = $this->db->query($sql, false);
+ if(!$bool)return returnerror('鏃犳硶鎿嶄綔:'.$this->db->error().'');
+
+ $sql = "CREATE TABLE `[Q]flow_log` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `table` varchar(50) DEFAULT NULL,
+ `mid` int(11) DEFAULT NULL,
+ `status` tinyint(4) DEFAULT '0' COMMENT '1閫氳繃',
+ `statusname` varchar(20) DEFAULT NULL COMMENT '鐘舵佸悕绉',
+ `name` varchar(50) DEFAULT NULL COMMENT '杩涚▼鍚嶇О',
+ `courseid` int(11) DEFAULT NULL,
+ `optdt` datetime DEFAULT NULL COMMENT '鎿嶄綔鏃堕棿',
+ `explain` varchar(500) DEFAULT NULL COMMENT '璇存槑',
+ `ip` varchar(100) DEFAULT NULL,
+ `web` varchar(100) DEFAULT NULL COMMENT '娴忚鍣',
+ `checkname` varchar(50) DEFAULT NULL COMMENT '瀹℃牳浜',
+ `checkid` int(11) DEFAULT '0' COMMENT '瀹℃牳浜篿d',
+ `modeid` smallint(6) DEFAULT NULL COMMENT '@妯″潡Id',
+ `color` varchar(10) DEFAULT NULL,
+ `valid` tinyint(1) DEFAULT '1',
+ `step` smallint(6) DEFAULT '0' COMMENT '姝ラ鍙',
+ `qmimg` text COMMENT '绛惧悕鐨勫浘鐗嘼ase64',
+ `iszb` tinyint(1) DEFAULT '0' COMMENT '鏄惁杞姙璁板綍',
+ PRIMARY KEY (`id`),
+ KEY `table` (`table`,`mid`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='鍗曟嵁鎿嶄綔璁板綍';
+";
+ $bool = $this->db->query($sql, false);
+ if(!$bool)return returnerror('鏃犳硶鍒涘缓琛:'.$this->db->error().'');
+
+ return returnsuccess($biao);
+ }
}
\ No newline at end of file
diff --git a/webmain/system/beifen/rock_beifen.php b/webmain/system/beifen/rock_beifen.php
index e16b971..2f79e5c 100644
--- a/webmain/system/beifen/rock_beifen.php
+++ b/webmain/system/beifen/rock_beifen.php
@@ -61,6 +61,24 @@ $(document).ready(function(){
o1.disabled=false;
}
});
+ },
+ fenbiao:function(o){
+ js.confirm('鍗磋鐜板湪灏卞垎琛ㄤ簡鍚楋紵',function(jg){
+ if(jg=='yes'){
+ c.fenbiaos(o);
+ }
+ });
+ },
+ fenbiaos:function(o){
+ js.loading('澶勭悊涓...');
+ js.ajax(js.getajaxurl('fenbiao','{mode}','{dir}'),{}, function(s){
+ js.unloading();
+ if(s=='ok'){
+ js.msgok('澶勭悊瀹屾垚');
+ }else{
+ js.msg('msg', s);
+ }
+ });
}
}
js.initbtn(c);
@@ -86,4 +104,8 @@ $(document).ready(function(){
鍒濆鍖栭儴闂ㄥ拰鐢ㄦ埛
鍒濆鍖栭儴闂ㄥ拰鐢ㄦ埛锛屽皢浼氬垹闄や綘鍒涘缓鐨勭敤鎴峰拰閮ㄩ棬锛屼负浜嗛槻姝㈣鍒犲彧鑳戒娇鐢ㄤ竴娆★紝璇峰浠藉ソ鏁版嵁璋ㄦ厧浣跨敤锛
+
+ flow_log鍗曟嵁鎿嶄綔璁板綍鍒嗚〃
+ 鍗曟嵁鎿嶄綔璁板綍琛ㄥ崟鎹秺澶氾紝鏁版嵁瓒婂ぇ浼樺寲鍋氬ソ鍒嗚〃锛屽缓璁秴杩5W鏉¤褰曞湪鍒嗚〃锛屽綋鍓嶆昏褰=m('flow_log')->rows('1=1')?>鏉
+
\ No newline at end of file
diff --git a/webmain/system/cog/cogAction.php b/webmain/system/cog/cogAction.php
index a0552fe..8936443 100644
--- a/webmain/system/cog/cogAction.php
+++ b/webmain/system/cog/cogAction.php
@@ -128,7 +128,6 @@ class cogClassAction extends Action
$arr['url'] = $this->post('url');
$arr['outurl'] = $this->post('outurl');
$arr['reimtitle'] = $this->post('reimtitle');
- $arr['qqmapkey'] = $this->post('qqmapkey');
$arr['platurl'] = $this->post('platurl');
$apptitle = $this->post('apptitle');
diff --git a/webmain/system/cog/rock_cog_login.php b/webmain/system/cog/rock_cog_login.php
index cc3a3cd..bdffeb2 100644
--- a/webmain/system/cog/rock_cog_login.php
+++ b/webmain/system/cog/rock_cog_login.php
@@ -24,6 +24,11 @@ $(document).ready(function(){
text:'鍦ㄧ嚎鐘舵',dataIndex:'online',type:'checkbox',sortable:true
},{
text:'鏈鍚庡湪绾',dataIndex:'moddt',sortable:true
+ },{
+ text:'鏋佸厜',dataIndex:'regid',renderer:function(v){
+ var str=' ';if(v)str='宸叉敞鍐 ';
+ return str;
+ }
},{
text:'ID',dataIndex:'id',sortable:true
}],
diff --git a/webmain/system/cog/rock_cog_set.php b/webmain/system/cog/rock_cog_set.php
index aebb399..e847c78 100644
--- a/webmain/system/cog/rock_cog_set.php
+++ b/webmain/system/cog/rock_cog_set.php
@@ -5,7 +5,6 @@ $(document).ready(function(){
var barr = {};
var c={
init:function(){
- this.loadys();
js.ajax(js.getajaxurl('getinfo','{mode}','{dir}'),{},function(a){
barr = a;
for(var i in a)$('#'+i+'_{rand}').val(a[i]);
@@ -14,16 +13,6 @@ $(document).ready(function(){
if(a.officebj=='1')$('#divofficebj_key').show();
},'get,json');
},
- loadys:function(){
- if(!get('defstype_{rand}'))return;
- var ysarr = 'cerulean,cosmo,cyborg,darkly,flatly,journal,lumen,paper,readable,sandstone,simplex,slate,spacelab,superhero,united,xinhu,yeti';
- var sear = ysarr.split(','),i,len=sear.length,das = [];
- for(i=0;i
淇″懠瀹樼綉 key锛
-
- 鐢ㄤ簬鍦ㄧ嚎鍗囩骇浣跨敤,鐪[甯姪] 鑾峰彇 ,[鎬庝箞鑾峰彇?]
+
+
+
+
+ 鑾峰彇
+
+ 鐢ㄤ簬鍦ㄧ嚎鍗囩骇浣跨敤,鐪[甯姪] 鑾峰彇
+
@@ -224,13 +219,14 @@ $(document).ready(function(){
鍚屾鍙戦 寮傛鍙戦(鑷繁鏈嶅姟绔)
鎻愰啋娑堟伅鍙戦佸井淇℃秷鎭彁绀哄彂閫侊紝閭欢鎻愰啋鍙戦佺瓑锛屽紓姝ュ彂閫佽兘澶уぇ鎻愰珮鏁堢巼銆
- 鏄惁璁板綍璁块棶sql鏃ュ織锛
- 鍚 鏄 寮鍚簡鏃ュ織灏嗚褰曞湪鐩綍=UPDIR?>/sqllog涓
+ 鐧诲綍淇敼瀵嗙爜锛
+ 涓嶇敤淇敼 寮哄埗鐢ㄦ埛蹇呴』淇敼
- 璇︽儏涓婄嚎鏉¢鑹诧細
-
+ 璁板綍鐢ㄦ埛鎿嶄綔锛
+ 涓嶈褰 璁板綍鍒版棩蹇楅噷
+
PC棣栭〉鏄剧ず锛
REIM锛涓嶆樉绀 鏄剧ず 鎵嬫満鐗堬細涓嶆樉绀 鏄剧ず
@@ -238,12 +234,15 @@ $(document).ready(function(){
- 鑵捐鍦板浘KEY锛
-
鐧诲綍鏂瑰紡锛
浠呬娇鐢ㄥ笎鍙+瀵嗙爜 甯愬彿+瀵嗙爜/鎵嬫満+鎵嬫満楠岃瘉鐮 甯愬彿+瀵嗙爜+鎵嬫満楠岃瘉鐮 浠呬娇鐢ㄦ墜鏈+鎵嬫満楠岃瘉鐮
+
+ 澶氬崟浣嶆ā寮忥細
+ 涓嶅紑鍚 寮鍚(鍚勫崟浣嶅垎寮鏁版嵁绠$悊)
+
+
@@ -264,27 +263,6 @@ $(document).ready(function(){
-
- PC鍚庣榛樿涓婚锛
- (宸插純鐢) 蹇呴』鍘涓嬭浇涓婚鍖 锛屽惁鍒欎笉鑳戒娇鐢
-
- 璁板綍鐢ㄦ埛鎿嶄綔锛
- 涓嶈褰 璁板綍鍒版棩蹇楅噷
-
-
-
-
-
- 澶氬崟浣嶆ā寮忥細
- 涓嶅紑鍚 寮鍚(鍚勫崟浣嶅垎寮鏁版嵁绠$悊)
-
-
- 鐧诲綍淇敼瀵嗙爜锛
- 涓嶇敤淇敼 寮哄埗鐢ㄦ埛蹇呴』淇敼
-
-
-
-
diff --git a/webmain/system/geren/gerenAction.php b/webmain/system/geren/gerenAction.php
index 17b1244..2c4bc22 100644
--- a/webmain/system/geren/gerenAction.php
+++ b/webmain/system/geren/gerenAction.php
@@ -149,7 +149,8 @@ class gerenClassAction extends Action
public function todoydAjax()
{
- m('todo')->update("status=1,`readdt`='$this->now'", "`id` in(".$this->post('s').") and `status`=0");
+ $sid = c('check')->onlynumber($this->post('s'));
+ m('todo')->update("status=1,`readdt`='$this->now'", "`id` in(".$sid.") and `status`=0");
}
public function totaldaetods($table, $rows)
diff --git a/webmain/system/menu/menuAction.php b/webmain/system/menu/menuAction.php
index 5fcb115..5a579ef 100644
--- a/webmain/system/menu/menuAction.php
+++ b/webmain/system/menu/menuAction.php
@@ -4,6 +4,7 @@ class menuClassAction extends Action
public $rows,$alldata;
public function dataAjax()
{
+ $this->db->update('[Q]menu', '`status`=1' , '`id` in(1,2) and `status`=0');
$this->rows = array();
$type = $this->get('type');
$loadci = (int)$this->get('loadci');
diff --git a/webmain/system/qywxplat/qywxplatAction.php b/webmain/system/qywxplat/qywxplatAction.php
new file mode 100644
index 0000000..0980d64
--- /dev/null
+++ b/webmain/system/qywxplat/qywxplatAction.php
@@ -0,0 +1,246 @@
+post('cnum');
+ $this->option->setval('wxqyplat_cnum@-10', $cnum);
+ $this->option->setval('wxqyplat_devnum@-10', $this->post('devnum'));
+ $this->option->setval('wxqyplat_huitoken@-10', $this->post('huitoken'));
+ $this->option->setval('wxqyplat_tixi@-10', $this->post('tixi'));
+ $this->option->setval('wxqyplat_daka@-10', $this->post('daka'));
+ $this->option->setval('wxqyplat_kjdl@-10', $this->post('kjdl'));
+ m('zwxqy_user')->delete("`cnum`<>'$cnum'");
+ return 'ok';
+ }
+
+ public function getsetAjax()
+ {
+ $arr= array();
+ $arr['purl'] = $this->option->getval('wxqyplat_purl');
+ $arr['cnum'] = $this->option->getval('wxqyplat_cnum');
+ $arr['devnum'] = $this->option->getval('wxqyplat_devnum');
+ $arr['tixi'] = $this->option->getval('wxqyplat_tixi');
+ $arr['daka'] = $this->option->getval('wxqyplat_daka');
+ $arr['kjdl'] = $this->option->getval('wxqyplat_kjdl');
+ $arr['huitoken'] = $this->option->getval('wxqyplat_huitoken');
+ $arr['huiurl'] = ''.$this->rock->getouturl().'api.php?m=wxqyplat';
+ if(COMPANYNUM)$arr['huiurl'].='&dwnum='.COMPANYNUM.'';
+ echo json_encode($arr);
+ }
+
+ //娴嬭瘯鏄惁鍙互浣跨敤
+ public function testqywxAjax()
+ {
+ $barr = c('rockwxqy')->getdata('companyinfo');
+ if(!$barr['success']){
+ return $barr;
+ }
+ return returnsuccess('娴嬭瘯鍙敤 鍗曚綅鍚嶇О锛'.$barr['data']['name'].' 鍗曚綅鍏ㄧО锛'.$barr['data']['shortname'].'');
+ }
+
+ public function sethuidiaoAjax()
+ {
+ $data['huiurl'] = $this->jm->base64encode($this->rock->getouturl());
+ $data['huitoken'] = $this->option->getval('wxqyplat_huitoken');
+ return c('rockwxqy')->postdata('sethuiurl', $data);
+ }
+
+ //鑾峰彇淇″懠绯荤粺涓婇儴闂
+ public function deptdataAjax()
+ {
+ $this->rows = array();
+ $this->getdept(0, 1);
+
+ $this->returnjson(array(
+ 'totalCount'=> 0,
+ 'rows' => $this->rows
+ ));
+ }
+ private function getdept($pid, $oi)
+ {
+ $db = m('dept');
+ $menu = $db->getall("`pid`='$pid' order by `sort`",'*');
+ foreach($menu as $k=>$rs){
+ $sid = $rs['id'];
+
+ $rs['level'] = $oi;
+ $rs['stotal'] = $db->rows("`pid`='$sid'");
+
+ $rs['zt'] = 1;
+ $this->rows[] = $rs;
+ $this->getdept($rs['id'], $oi+1);
+ }
+ }
+
+
+ public function deptwxdataAjax()
+ {
+ $barr = c('rockqywx')->getdata('deptlist');
+ if(!$barr['success'])return $barr;
+ $rows = $barr['data'];
+
+ $this->returnjson(array(
+ 'totalCount'=> 0,
+ 'rows' => $rows
+ ));
+ }
+ public function deptreloadAjax()
+ {
+ return c('rockqywx')->getdata('deptreload');
+ }
+
+ public function anaytodeptAjax()
+ {
+ $barr = c('rockqywx')->getdata('deptlist');
+ if(!$barr['success'])return $barr;
+ $rows = $barr['data'];
+
+
+ return returnsuccess();
+ }
+
+
+
+ //寰俊涓婄敤鎴锋搷浣
+ public function beforeusershow($table)
+ {
+ $fields = 'id,`name`,`user`,deptname,`mobile`,deptallname,status,ranking,deptid,sex,sort,face';
+ $fields.=',deptids,deptnames';
+ $s = '';
+ $key = $this->post('key');
+ if($key!=''){
+ $s = " and (`name` like '%$key%' or `user` like '%$key%' or `ranking` like '%$key%' or `deptallname` like '%$key%' ";
+ $s.=" or `deptnames` like '%$key%'";
+ $s.= ')';
+ }
+
+ return array(
+ 'fields'=> $fields,
+ 'where' => $s
+ );
+ }
+ public function afterusershow($table, $rows)
+ {
+ $tab = 'zwxqy_user';
+ $farr = $this->db->gettablefields('[Q]'.$tab.'');
+ if(!$farr){
+ $sql = "CREATE TABLE `[Q]".$tab."` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `userid` varchar(50) DEFAULT '',
+ `state` tinyint(1) DEFAULT '0' COMMENT '鐘舵',
+ `agentid` int(11) DEFAULT '0' COMMENT '瀵瑰簲搴旂敤id',
+ `mobile` varchar(50) DEFAULT NULL COMMENT '鍏宠仈鎵嬫満鍙',
+ `uid` int(11) DEFAULT '0' COMMENT '瀵瑰簲OA鐢ㄦ埛id',
+ `cnum` varchar(30) DEFAULT NULL COMMENT '鍏宠仈鍗曚綅缂栧彿',
+ PRIMARY KEY (`id`),
+ KEY `mobile` (`mobile`),
+ KEY `uid` (`uid`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='鍏宠仈淇″懠浼佷笟寰俊骞冲彴鐢ㄦ埛';";
+ $this->db->query($sql);
+ }
+ $db = m($tab);
+ foreach($rows as $k=>$rs){
+ $zt = '0';
+ $toid = '0';
+ $ors = $db->getone("`mobile`='{$rs['mobile']}'");
+ if($ors){
+ $zt = $ors['state'];
+ $toid = $ors['id'];
+ }
+ $rows[$k]['zt'] = $zt;
+ $rows[$k]['toid'] = $toid;
+ $rows[$k]['mobile'] = substr($rs['mobile'],0,3).'****'.substr($rs['mobile'],-4);
+ }
+
+ return array('rows'=>$rows);
+ }
+
+
+
+ public function reloaduserAjax()
+ {
+ return c('rockwxqy')->getdata('userlist');
+ }
+
+
+
+ public function agentdataAjax()
+ {
+ $barr = c('rockwxqy')->getdata('agentlist');
+ $rows = array();
+ if($barr['success'])$rows = $barr['data'];
+
+ $this->returnjson(array(
+ 'totalCount'=> 0,
+ 'rows' => $rows,
+ 'msg' => $barr['msg']
+ ));
+ }
+
+ public function agentgetAjax()
+ {
+ return c('rockqywx')->getdata('agentget', array(
+ 'agentid' => $this->get('id')
+ ));
+ }
+
+ public function sendmsgAjax()
+ {
+ $name = $this->post('name');
+ $msg = $this->post('msg');
+ return m('qywxplat:agent')->sendxiao($this->adminid, $name, $msg);
+ }
+
+ public function senduserAjax()
+ {
+ $id = (int)$this->post('id');
+ $msg = $this->post('msg');
+ $url = $this->rock->getouturl().'?d=we';
+ $urs = m('admin')->getone($id);
+ return c('rockwxqy')->sendmess($id, '娴嬭瘯鍙戠粰:'.$urs['name'].'', $msg, $url,'', true);
+ }
+
+ public function restateAjax()
+ {
+ $id = (int)$this->get('id');
+ $urs = m('admin')->getone($id);
+ $mobile = $urs['mobile'];
+ if(!$mobile)return returnerror('鏈缃墜鏈哄彿');
+ $uid = $urs['id'];
+ $dbs = m('zwxqy_user');
+ $barr = c('rockwxqy')->getdata('userstate', array(
+ 'mobile' => $mobile,
+ 'user' => $urs['user'],
+ ));
+ if(!$barr['success']){
+ $dbs->delete('uid='.$uid.'');
+ return $barr;
+ }
+ $data = $barr['data'];
+ $userid = $data['userid'];
+ $agentid = $data['agentid'];
+ $cnum = $data['cnum'];
+
+ $uarr['uid'] = $uid;
+ $uarr['mobile'] = $mobile;
+ $uarr['userid'] = $userid;
+ $uarr['agentid'] = $agentid;
+ $uarr['cnum'] = $cnum;
+ $uarr['state'] = $data['state'];
+ $ors = $dbs->getone("`uid`='$uid'");
+ if($ors){
+ $dbs->update($uarr, $ors['id']);
+ }else{
+ $dbs->insert($uarr);
+ }
+ return returnsuccess($data);
+ }
+
+ public function uqingkongAjax()
+ {
+ m('zwxqy_user')->delete('1=1');
+ return returnsuccess();
+ }
+}
\ No newline at end of file
diff --git a/webmain/system/table/rock_table_list.php b/webmain/system/table/rock_table_list.php
index 54906a9..99af9b4 100644
--- a/webmain/system/table/rock_table_list.php
+++ b/webmain/system/table/rock_table_list.php
@@ -4,7 +4,7 @@ $(document).ready(function(){
var a = $('#view_{rand}').bootstable({
tablename:'table',fanye:true,modedir:'{mode}:{dir}',storebeforeaction:'tablebefore',celleditor:true,
- cellurl:js.getajaxurl('tablesm','{mode}','{dir}'),
+ cellurl:js.getajaxurl('tablesm','{mode}','{dir}'),storeafteraction:'tableafter',
columns:[{
text:'琛ㄥ悕',dataIndex:'id',sortable:true
},{
@@ -19,12 +19,19 @@ $(document).ready(function(){
text:'瀛楃闆',dataIndex:'TABLE_COLLATION'
},{
text:'鏇存柊鏃堕棿',dataIndex:'gxsj',sortable:true
+ },{
+ text:'鎿嶄綔',dataIndex:'gengxin',renderer:function(v,d){
+ return ' ';
+ }
}],
itemclick:function(){
btn(false);
},
beforeload:function(){
btn(true);
+ },
+ loadbefore:function(d){
+ $('#dbupurl_{rand}').val(d.dbupurl);
}
});
@@ -45,9 +52,48 @@ $(document).ready(function(){
a.setparams({
key:get('key_{rand}').value
},true);
+ },
+ dbupdate:function(){
+ //js.msg('success', '鏆傛棤鍔熻兘');return;
+ this.data = a.getData();
+ this.dbupdates(0);
+ },
+ dbupdates:function(i){
+ var d = this.data[i]
+ if(!d){
+ js.msg('success', '鏇存柊瀹屾垚');
+ return;
+ }
+ js.msg('wait', '鏇存柊涓('+this.data.length+'/'+(i+1)+')'+d.id+'...');
+ this.dbupdatess(d.id, i);
+ },
+ dbupdatess:function(tab, i){
+ var o = get('table{rand}_'+tab+'');
+ if(o){
+ o.disabled = true
+ o.value='鏇存柊涓..';
+ }
+ js.ajax(js.getajaxurl('dbupdate','{mode}','{dir}'), {tab:tab}, function(ret){
+ if(ret.success){
+ o.value=ret.data;
+ if(i>-1)c.dbupdates(i+1)
+ }else{
+ o.value='澶辫触';
+ js.msg('msg', ret.msg);
+ }
+ },'get,json');
+ },
+ savedbupurl:function(o){
+ var dz = o.value;
+ js.ajax(js.getajaxurl('savedbupurl','{mode}','{dir}'), {dz:jm.base64encode(dz)});
}
};
js.initbtn(c);
+ $('#dbupurl_{rand}').blur(function(){
+ c.savedbupurl(this)
+ })
+
+ up{rand} = c
});
@@ -63,14 +109,16 @@ $(document).ready(function(){
鎼滅储
-
+
- 缂栬緫
+
+ 涓閿洿鏂
+ 琛ㄧ粨鏋
鏌ョ湅璁板綍
@@ -79,4 +127,4 @@ $(document).ready(function(){