From c09f4dba404c41910d61f60d7b5c593941b73803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E4=B8=AD=E7=A3=90=E7=9F=B3?= Date: Mon, 5 Sep 2022 15:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=91=BCOA=E7=89=88=E6=9C=ACv2.3.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +- config/version.php | 4 +- include/class/mysql.php | 20 ++- include/class/rockClass.php | 1 + include/rockFun.php | 4 +- webmain/flow/input/inputjs/mode_planm.js | 38 +++++ webmain/flow/input/mode_planmAction.php | 69 +++++++++ webmain/flow/page/input_planm.html | 1 + webmain/flow/page/rock_page_planm.php | 59 +++++++ webmain/install/rockxinhu.sql | 178 ++++++++++++++++++---- webmain/main/flow/flowAction.php | 17 +++ webmain/main/flow/rock_flow_set.php | 57 +++++++ webmain/main/flow/rock_flow_whereedit.php | 1 + webmain/main/view/rock_view_edit.php | 1 + webmain/model/agent/gongModel.php | 3 + webmain/model/agent/planmModel.php | 31 ++++ webmain/model/companyModel.php | 10 ++ webmain/model/flow/flow.php | 2 +- webmain/model/flow/gongModel.php | 6 +- webmain/model/flow/planmModel.php | 173 +++++++++++++++++++++ webmain/model/goodsModel.php | 7 +- webmain/model/homeitemsModel.php | 7 + webmain/model/whereModel.php | 2 +- webmain/task/api/weixinAction.php | 2 +- webmain/task/mode/tpl_mode_p.html | 5 +- webmain/task/mode/tpl_mode_x.html | 5 +- webmain/we/index/indexAction.php | 1 + webmain/we/index/tpl_index.html | 2 + webmain/we/login/tpl_login.html | 2 +- 29 files changed, 657 insertions(+), 57 deletions(-) create mode 100644 webmain/flow/input/inputjs/mode_planm.js create mode 100644 webmain/flow/input/mode_planmAction.php create mode 100644 webmain/flow/page/input_planm.html create mode 100644 webmain/flow/page/rock_page_planm.php create mode 100644 webmain/model/agent/planmModel.php create mode 100644 webmain/model/flow/planmModel.php diff --git a/README.md b/README.md index 8b58d23..cedd835 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ 官网网站:http://www.rockoa.com/ 源码仅供学习二次开发使用,禁止二次发布,禁止用于商业用途出售等(违者必究) 版权:Copyright @2016-2022 信呼开发团队 -版本整理时间:2022-07-10 23:59:59 -版本号:V2.3.8 +版本整理时间:2022-09-05 23:59:59 +版本号:V2.3.9 -### V2.3.8更新说明 +### V2.3.9更新说明 1、完善系统安全性。 2、更多升级日志详见:http://www.rockoa.com/view_core.html diff --git a/config/version.php b/config/version.php index 56ee19a..8352812 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ gettables($table)." ($name) "; if(!$sel){ $sql.="values($values)"; }else{ @@ -526,14 +526,14 @@ abstract class mysql{ public function update($table,$content,$where) { $where = $this->getwhere($where); - $sql="update `$table` set $content where $where "; + $sql="update ".$this->gettables($table)." set $content where $where "; return $this->tranbegin($sql); } public function delete($table,$where) { $where = $this->getwhere($where); - $sql="delete from `$table` where $where "; + $sql="delete from ".$this->gettables($table)." where $where "; return $this->tranbegin($sql); } @@ -553,15 +553,25 @@ abstract class mysql{ }else{ $cont = $array; } + $table = $this->gettables($table); if($addbool){ - $sql="insert into `$table` set $cont"; + $sql="insert into $table set $cont"; }else{ $where = $this->getwhere($where); - $sql="update `$table` set $cont where $where"; + $sql="update $table set $cont where $where"; } return $this->tranbegin($sql); } + /** + * 澶勭悊琛ㄥ悕 + */ + public function gettables($str) + { + if(!contain($str,'`'))$str='`'.$str.'`'; + return $str; + } + /** 杩斿洖鎬绘潯鏁 */ diff --git a/include/class/rockClass.php b/include/class/rockClass.php index 12e68c1..730b70d 100644 --- a/include/class/rockClass.php +++ b/include/class/rockClass.php @@ -30,6 +30,7 @@ final class rockClass { $this->ip = $this->getclientip(); $this->host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' ; + if($this->host && substr($this->host,-3)==':80')$this->host = str_replace(':80', '', $this->host); $this->url = ''; $this->isqywx = false; $this->win = php_uname(); diff --git a/include/rockFun.php b/include/rockFun.php index a625a99..662e491 100644 --- a/include/rockFun.php +++ b/include/rockFun.php @@ -168,9 +168,9 @@ function returnerror($msg='', $code=201, $carr=array()) /** * 杩斿洖姝g‘淇℃伅 */ -function returnsuccess($data=array()) +function returnsuccess($data=array(),$msg='') { - $carr['msg'] = ''; + $carr['msg'] = $msg; $carr['code'] = 200; $carr['success'] = true; $carr['data'] = $data; diff --git a/webmain/flow/input/inputjs/mode_planm.js b/webmain/flow/input/inputjs/mode_planm.js new file mode 100644 index 0000000..8826f7c --- /dev/null +++ b/webmain/flow/input/inputjs/mode_planm.js @@ -0,0 +1,38 @@ +//娴佺▼妯″潡銆恜lanm.宸ヤ綔璁″垝銆戜笅褰曞叆椤甸潰鑷畾涔塲s椤甸潰,鍒濆鍑芥暟 +function initbodys(){ + if(mid==0)$(form('leixing')).change(function(){ + changeleixing(this) + }); +} + +function changeleixing(o1){ + if(!form('name'))return; + js.ajax(geturlact('chageleixing'),{lx:o1.value}, function(ret){ + form('name').value = ret.data.name; + },'get,json'); +} + +function changesubmit(d){ + if(form('name')){ + var str = form('name').value; + if(str.indexOf('{?}')>-1)return '璇峰畬鏁磋緭鍏ヨ鍒掑悕绉'; + } +} + +function submittijiao(o2){ + var obj = $('input[name^=zhixing_]'); + var da = {},o1,na,naa; + for(var i=0;i'閿欒鎻愮ず鍐呭','rows'=> array()) 鍙繑鍥炵┖瀛楃涓诧紝鎴栬呮暟缁 rows 鏄彲鍚屾椂淇濆瓨鍒版暟鎹簱涓婃暟缁 + */ + protected function savebefore($table, $arr, $id, $addbo){ + + } + + /** + * 閲嶅啓鍑芥暟锛氫繚瀛樺悗澶勭悊锛屼富瑕佷繚瀛樺叾浠栬〃鏁版嵁 + * $table String 瀵瑰簲琛ㄥ悕 + * $arr Array 琛ㄥ崟鍙傛暟 + * $id Int 瀵瑰簲琛ㄤ笂璁板綍Id + * $addbo Boolean 鏄惁娣诲姞鏃 + */ + protected function saveafter($table, $arr, $id, $addbo){ + + } + + public function chageleixingAjax() + { + $lx = (int)$this->get('lx'); + $str = ''; + $barr['lx'] = $lx; + if($lx==1)$str=''.date('Y').'骞村害宸ヤ綔璁″垝'; + if($lx==2)$str=''.date('Y').'绗瑊?}瀛e害宸ヤ綔璁″垝'; + if($lx==3)$str=''.date('Y').'骞'.date('m').'鏈堜唤宸ヤ綔璁″垝'; + if($lx==4)$str=''.date('Y').'骞'.date('m').'鏈堜唤绗瑊?}鍛ㄥ伐浣滆鍒'; + + $barr['name'] = $str; + + return returnsuccess($barr); + } + + public function leixingdata() + { + + return $this->flow->leixingdata(); + } + + public function savezhixingAjax() + { + $str = $this->post('str'); + $mid = (int)$this->post('mid'); + $arr = json_decode($str, true); + $dbs = m('plans'); + $state = (int)$this->post('ztstate');; + foreach($arr as $id=>$rs){ + $dbs->update(array( + 'zxren' => $rs['zxren'], + 'zxrenid' => $rs['zxrenid'], + 'zxtime' => $rs['zxtime'], + ),$id); + } + m('planm')->update('`state`='.$state.'', $mid); + return returnsuccess($arr); + } +} + \ No newline at end of file diff --git a/webmain/flow/page/input_planm.html b/webmain/flow/page/input_planm.html new file mode 100644 index 0000000..172708a --- /dev/null +++ b/webmain/flow/page/input_planm.html @@ -0,0 +1 @@ +
^name^{name}*^leixing^{leixing}
*^startdt^{startdt}*^enddt^{enddt}
^psren^{psren}*^runren^{runren}
璁″垝浜嬮」
搴忓彿*璁″垝浜嬮」鎵ц浜鎵ц鏃堕棿鎿嶄綔
[xuhao0,0][pitem0,0][zxren0,0][zxtime0,0]{鍒,0}
{鏂板,0}
^explain^{explain}
^file_content^{file_content}
\ No newline at end of file diff --git a/webmain/flow/page/rock_page_planm.php b/webmain/flow/page/rock_page_planm.php new file mode 100644 index 0000000..bcdc836 --- /dev/null +++ b/webmain/flow/page/rock_page_planm.php @@ -0,0 +1,59 @@ + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/webmain/install/rockxinhu.sql b/webmain/install/rockxinhu.sql index bea75ba..6ece91b 100644 --- a/webmain/install/rockxinhu.sql +++ b/webmain/install/rockxinhu.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50610 File Encoding : 65001 -Date: 2022-07-10 17:26:29 +Date: 2022-09-05 15:56:20 */ SET FOREIGN_KEY_CHECKS=0; @@ -71,11 +71,11 @@ CREATE TABLE `xinhu_admin` ( -- ---------------------------- -- Records of xinhu_admin -- ---------------------------- -INSERT INTO `xinhu_admin` VALUES ('1', 'A001', 'admin', '绠$悊鍛', 'e10adc3949ba59abbe56e057f20f883e', '4615', '1', '1', '鐢', '0592-1234569', 'upload/face/1.jpg', '2', '寮鍙戦儴', null, null, null, '淇″懠寮鍙戝洟闃/寮鍙戦儴', '5', '纾愮煶', '椤圭洰涓荤', '1', '[1],[2]', '[5]', '1,3,4', '15800000023', '1', '2016-06-01', null, '2017-03-08 09:52:30', null, null, null, '0', 'guanliyuan', null, '1', '0', null, '1', null, null, '0', '1'); +INSERT INTO `xinhu_admin` VALUES ('1', 'A001', 'admin', '绠$悊鍛', 'e10adc3949ba59abbe56e057f20f883e', '4698', '1', '1', '鐢', '0592-1234569', 'upload/face/1.jpg', '2', '寮鍙戦儴', null, null, null, '淇″懠寮鍙戝洟闃/寮鍙戦儴', '5', '纾愮煶', '椤圭洰涓荤', '1', '[1],[2]', '[5]', '1,3,4', '15800000023', '1', '2016-06-01', null, '2017-03-08 09:52:30', null, null, null, '0', 'guanliyuan', null, '1', '0', null, '1', null, null, '0', '1'); INSERT INTO `xinhu_admin` VALUES ('2', null, 'diaochan', '璨傝潐', 'e10adc3949ba59abbe56e057f20f883e', '156', '1', '0', '濂', '0592-123456', null, '3', '璐㈠姟閮', null, null, null, '淇″懠寮鍙戝洟闃/璐㈠姟閮', '5', '纾愮煶', '璐㈠姟鎬荤洃', '1', '[1],[3]', '[5]', '1,3', '15800000007', '1', '2016-08-09', null, null, null, null, null, '0', 'diaochan', null, '2', '0', null, '1', null, null, '0', '1'); INSERT INTO `xinhu_admin` VALUES ('3', null, 'xiaoqiao', '灏忎箶', 'e10adc3949ba59abbe56e057f20f883e', '281', '1', '0', '濂', null, null, '3', '璐㈠姟閮', null, null, null, '淇″懠寮鍙戝洟闃/璐㈠姟閮', '2', '璨傝潐', '鍑虹撼', '1', '[1],[3]', '[5],[2]', '1', '15800000001', '1', '2017-05-02', null, '2016-08-30 20:34:23', null, null, null, '0', 'xiaoqiao', null, '2', '0', null, '1', null, null, '0', '1'); -INSERT INTO `xinhu_admin` VALUES ('4', null, 'daqiao', '澶т箶', 'e10adc3949ba59abbe56e057f20f883e', '394', '1', '0', '濂', null, null, '4', '琛屾斂浜轰簨閮', '3', '璐㈠姟閮', '浼氳', '淇″懠寮鍙戝洟闃/琛屾斂浜轰簨閮', '5', '纾愮煶', '浜轰簨涓荤', '1', '[1],[4],[3]', '[5]', '1,3', '15800000002', '1', '2017-07-01', null, '2016-10-20 22:27:51', null, null, null, '0', 'daqiao', null, '2', '0', null, '1', null, null, '0', '1'); -INSERT INTO `xinhu_admin` VALUES ('5', null, 'rock', '纾愮煶', 'e10adc3949ba59abbe56e057f20f883e', '426', '1', '0', '鐢', null, null, '5', '绠$悊灞', null, null, null, '淇″懠寮鍙戝洟闃/绠$悊灞', null, null, '钁d簨闀', '0', '[1],[5]', null, '2,3', '15800000003', '1', '2015-11-01', null, null, null, null, null, '0', 'panshi', null, '1', '0', null, '1', null, '1,2,3,4', '0', '1'); +INSERT INTO `xinhu_admin` VALUES ('4', null, 'daqiao', '澶т箶', 'e10adc3949ba59abbe56e057f20f883e', '399', '1', '0', '濂', null, null, '4', '琛屾斂浜轰簨閮', '3', '璐㈠姟閮', '浼氳', '淇″懠寮鍙戝洟闃/琛屾斂浜轰簨閮', '5', '纾愮煶', '浜轰簨涓荤', '1', '[1],[4],[3]', '[5]', '1,3', '15800000002', '1', '2017-07-01', null, '2016-10-20 22:27:51', null, null, null, '0', 'daqiao', null, '2', '0', null, '1', null, null, '0', '1'); +INSERT INTO `xinhu_admin` VALUES ('5', null, 'rock', '纾愮煶', 'e10adc3949ba59abbe56e057f20f883e', '429', '1', '0', '鐢', null, null, '5', '绠$悊灞', null, null, null, '淇″懠寮鍙戝洟闃/绠$悊灞', null, null, '钁d簨闀', '0', '[1],[5]', null, '2,3', '15800000003', '1', '2015-11-01', null, null, null, null, null, '0', 'panshi', null, '1', '0', null, '1', null, '1,2,3,4', '0', '1'); INSERT INTO `xinhu_admin` VALUES ('6', null, 'zhangfei', '寮犻', 'e10adc3949ba59abbe56e057f20f883e', '200', '1', '0', '鐢', null, null, '2', '寮鍙戦儴', null, null, null, '淇″懠寮鍙戝洟闃/寮鍙戦儴', '7', '璧靛瓙榫', '绋嬪簭鍛', '100', '[1],[2]', '[5],[1],[7]', '1', '15800000004', '1', '2017-07-01', null, '2016-11-01 20:15:52', null, null, null, '0', 'zhangfei', null, '1', '0', null, '1', null, null, '0', '0'); INSERT INTO `xinhu_admin` VALUES ('7', null, 'zhaozl', '璧靛瓙榫', 'e10adc3949ba59abbe56e057f20f883e', '241', '1', '0', '鐢', null, null, '2', '寮鍙戦儴', null, null, null, '淇″懠寮鍙戝洟闃/寮鍙戦儴', '1', '绠$悊鍛', '楂樼骇绋嬪簭鍛', '100', '[1],[2]', '[5],[1]', '1', '15800000005', '1', '2016-07-01', null, '2017-06-28 15:34:26', null, null, null, '0', 'zhaozilong', null, '1', '0', null, '1', null, null, '0', '0'); INSERT INTO `xinhu_admin` VALUES ('8', null, 'xinhu', '淇″懠瀹㈡湇', '6846860684f05029abccc09a53cd66f1', '419', '1', '1', '濂', null, null, '2', '寮鍙戦儴', null, null, null, '淇″懠寮鍙戝洟闃/寮鍙戦儴', '1', '绠$悊鍛', '瀹㈡湇', '200', '[1],[2]', '[5],[1]', '1,4', '15800000006', '1', '2018-12-12', null, null, null, 'rainrock829', null, '0', 'xinhukefu', null, '1', '0', null, '1', null, '2', '0', '1'); @@ -373,8 +373,8 @@ CREATE TABLE `xinhu_chargems` ( -- ---------------------------- -- Records of xinhu_chargems -- ---------------------------- -INSERT INTO `xinhu_chargems` VALUES ('1', '0', '1', '2016-12-28 15:24:19', '2022-07-10 17:26:06', null, '1'); -INSERT INTO `xinhu_chargems` VALUES ('2', '1', '1', '2016-12-28 15:21:14', '2022-07-10 17:26:06', null, '0'); +INSERT INTO `xinhu_chargems` VALUES ('1', '0', '1', '2016-12-28 15:24:19', '2022-09-05 15:54:23', null, '1'); +INSERT INTO `xinhu_chargems` VALUES ('2', '1', '1', '2016-12-28 15:21:14', '2022-09-05 15:54:23', null, '0'); -- ---------------------------- -- Table structure for `xinhu_city` @@ -426,7 +426,7 @@ CREATE TABLE `xinhu_company` ( -- ---------------------------- -- Records of xinhu_company -- ---------------------------- -INSERT INTO `xinhu_company` VALUES ('1', 'images/logo.png', '淇″懠寮鍙戝洟闃', null, null, null, '0592-123456', '0592-123456', '0', '0', '5', '纾愮煶', '杞欢鍥', '鍘﹂棬', null, '0', '0', null); +INSERT INTO `xinhu_company` VALUES ('1', 'images/logo.png', '淇″懠寮鍙戝洟闃', null, null, null, '0592-123456', '0592-123456', '0', '0', '5', '纾愮煶', '杞欢鍥', '鍘﹂棬', null, '1', '0', null); INSERT INTO `xinhu_company` VALUES ('2', 'images/logohong.png', '淇″懠寮鍙戝洟闃(娉夊窞鍒嗗叕鍙)', null, '淇″懠鍔炲叕OA娉夊窞鍒嗗叕鍙', null, null, null, '1', '0', null, null, null, null, 'qz', '1', '0', null); INSERT INTO `xinhu_company` VALUES ('3', null, '淇″懠寮鍙戝洟闃(鍖椾含鍒嗗叕鍙)', null, '淇″懠鍔炲叕OA鍖椾含鍒嗗叕鍙', null, null, null, '1', '0', null, null, null, null, 'bj', '0', '0', null); INSERT INTO `xinhu_company` VALUES ('4', 'images/apply.png', '鎴跨瀹惰蒋浠跺叕鍙', null, '鎴跨瀹惰蒋浠跺唴閮∣A绯荤粺', null, null, null, '0', '0', null, null, null, null, 'ruan', '0', '0', null); @@ -830,7 +830,7 @@ CREATE TABLE `xinhu_dept` ( -- ---------------------------- INSERT INTO `xinhu_dept` VALUES ('1', null, '淇″懠寮鍙戝洟闃', '0', '0', null, null, null, '0'); INSERT INTO `xinhu_dept` VALUES ('2', 'dev', '寮鍙戦儴', '1', '1', null, '绠$悊鍛', '1', '0'); -INSERT INTO `xinhu_dept` VALUES ('3', null, '璐㈠姟閮', '1', '2', null, null, null, '0'); +INSERT INTO `xinhu_dept` VALUES ('3', null, '璐㈠姟閮', '1', '2', null, '澶т箶', '4', '0'); INSERT INTO `xinhu_dept` VALUES ('4', null, '琛屾斂浜轰簨閮', '1', '3', null, '澶т箶', '4', '2'); INSERT INTO `xinhu_dept` VALUES ('5', null, '绠$悊灞', '1', '0', null, '纾愮煶', '5', '1'); @@ -1176,7 +1176,7 @@ CREATE TABLE `xinhu_flow_bill` ( KEY `table` (`table`,`mid`) USING BTREE, KEY `status` (`status`), KEY `modeid` (`modeid`) -) ENGINE=MyISAM AUTO_INCREMENT=323 DEFAULT CHARSET=utf8 COMMENT='娴佺▼鍗曟嵁'; +) ENGINE=MyISAM AUTO_INCREMENT=326 DEFAULT CHARSET=utf8 COMMENT='娴佺▼鍗曟嵁'; -- ---------------------------- -- Records of xinhu_flow_bill @@ -1289,6 +1289,9 @@ INSERT INTO `xinhu_flow_bill` VALUES ('282', 'XW-20210413-001', 'work', '11', '4 INSERT INTO `xinhu_flow_bill` VALUES ('289', 'WA-20211015-001', 'goodm', '24', '24', '鐗╁搧棰嗙敤', '澶т箶', '4', '4', '琛屾斂浜轰簨閮', '2021-10-15 15:37:29', '4', '澶т箶', '4', '0', '0', '2021-10-15', '寰呭ぇ涔斿鐞', '0', '47', '4', '澶т箶', null, '2021-10-15 15:37:29', '2021-10-15 15:37:29', '0', '1'); INSERT INTO `xinhu_flow_bill` VALUES ('300', 'CG-20211125-001', 'custappy', '5', '122', '瀹㈡埛鏈嶅姟', '绠$悊鍛', '1', '2', '寮鍙戦儴', '2021-11-25 14:12:13', '1', '绠$悊鍛', '1', '0', '1', '2021-11-25', '绠$悊鍛樺鐞嗗凡瀹屾垚', '1', '0', null, null, null, '2021-11-25 14:23:32', '2021-11-25 14:09:57', '0', '1'); INSERT INTO `xinhu_flow_bill` VALUES ('302', 'YS-20220315-001', 'demo', '19', '72', '婕旂ず娴嬭瘯', '绠$悊鍛', '1', '2', '寮鍙戦儴', '2022-03-15 21:04:10', '1', '绠$悊鍛', '5,2,1', '0', '1', '2022-03-15', '寰呰矀铦夊鐞', '0', '78', '2', '璨傝潐', null, '2022-03-15 21:12:56', '2022-03-15 12:20:42', '0', '1'); +INSERT INTO `xinhu_flow_bill` VALUES ('323', 'PL-20220901001', 'planm', '1', '133', '宸ヤ綔璁″垝', '绠$悊鍛', '1', '2', '寮鍙戦儴', '2022-09-01 20:38:05', '1', '绠$悊鍛', '1,4', '0', '1', '2022-09-01', '绠$悊鍛樺鐞嗗彂甯', '1', '0', null, null, null, '2022-09-01 22:33:07', '2022-09-01 20:13:40', '0', '1'); +INSERT INTO `xinhu_flow_bill` VALUES ('324', 'PL-20220902001', 'planm', '2', '133', '宸ヤ綔璁″垝', '绠$悊鍛', '1', '2', '寮鍙戦儴', '2022-09-02 15:07:31', '1', '绠$悊鍛', '1,4', '0', '1', '2022-09-02', '绠$悊鍛樺鐞嗗彂甯', '1', '0', null, null, null, '2022-09-03 18:20:14', '2022-09-02 15:07:31', '0', '1'); +INSERT INTO `xinhu_flow_bill` VALUES ('325', 'PL-20220904001', 'planm', '3', '133', '宸ヤ綔璁″垝', '澶т箶', '4', '4', '琛屾斂浜轰簨閮', '2022-09-04 12:17:25', '4', '澶т箶', '4', '0', '1', '2022-09-04', '澶т箶澶勭悊鍙戝竷', '1', '0', null, null, null, '2022-09-04 12:19:01', '2022-09-04 12:17:25', '0', '1'); -- ---------------------------- -- Table structure for `xinhu_flow_chao` @@ -1413,7 +1416,7 @@ CREATE TABLE `xinhu_flow_course` ( `csfwid` varchar(200) DEFAULT NULL, PRIMARY KEY (`id`), KEY `setid` (`setid`) -) ENGINE=MyISAM AUTO_INCREMENT=141 DEFAULT CHARSET=utf8 COMMENT='娴佺▼姝ラ琛'; +) ENGINE=MyISAM AUTO_INCREMENT=144 DEFAULT CHARSET=utf8 COMMENT='娴佺▼姝ラ琛'; -- ---------------------------- -- Records of xinhu_flow_course @@ -1505,6 +1508,9 @@ INSERT INTO `xinhu_flow_course` VALUES ('109', '0', '0', '116', '瀹℃牳', null, INSERT INTO `xinhu_flow_course` VALUES ('127', '-2', '30', '33', '鍔犵', null, 'user', '2', '璨傝潐', '0', '1', null, null, '2021-06-25 15:24:05', '1', null, '1', null, '0', '4', '澶т箶', null, null, '0', '0', '0', '0', '1', null, null, '0', '0', '0', '0', null, null); INSERT INTO `xinhu_flow_course` VALUES ('126', '-1', '30', '33', '灏忎箶纭', null, 'user', '3', '灏忎箶', '0', '1', null, null, '2021-06-25 15:23:20', '1', null, '1', null, '0', '4', '澶т箶', null, null, '0', '0', '0', '0', '1', null, null, '0', '0', '0', '0', null, null); INSERT INTO `xinhu_flow_course` VALUES ('133', '0', '0', '122', '鏈嶅姟浜哄憳澶勭悊', null, 'field', 'usid', '鏈嶅姟浜哄憳(usid)', '0', '0', null, null, '2021-11-25 14:16:05', '1', '宸插畬鎴,鏃犳硶瀹屾垚', '1', null, '0', '0', null, null, null, '0', '0', null, '0', '1', null, null, '0', '0', '0', '0', null, null); +INSERT INTO `xinhu_flow_course` VALUES ('141', '0', '0', '133', '璇勫璁″垝', null, 'field', 'psrenid', '璇勫浜(psrenid)', '0', '0', 'cHNyZW5pZCBpcyBub3QgbnVsbA::', null, '2022-09-01 19:59:31', '1', null, '1', null, '0', '0', null, null, null, '0', '0', null, '0', '1', null, null, '0', '0', '0', '0', null, null); +INSERT INTO `xinhu_flow_course` VALUES ('142', '141', '0', '133', '鎵ц浜虹煡鎮', 'zhixi', 'field', 'runrenid', '鎵ц浜(runrenid)', '0', '0', null, null, '2022-09-01 22:24:27', '1', '鐭ラ亾浜', '0', null, '0', '0', null, null, null, '0', '0', null, '0', '1', null, null, '0', '0', '0', '0', null, null); +INSERT INTO `xinhu_flow_course` VALUES ('143', '142', '0', '133', '鍙戝竷鎵ц', null, 'apply', null, null, '0', '0', null, null, '2022-09-01 20:41:55', '1', '鍙戝竷,涓嶅彂甯', '1', null, '0', '0', null, null, null, '0', '0', null, '0', '1', null, null, '0', '0', '0', '0', null, null); -- ---------------------------- -- Table structure for `xinhu_flow_element` @@ -1543,7 +1549,7 @@ CREATE TABLE `xinhu_flow_element` ( PRIMARY KEY (`id`), KEY `mid` (`mid`), KEY `fields` (`fields`) -) ENGINE=MyISAM AUTO_INCREMENT=1465 DEFAULT CHARSET=utf8 COMMENT='妯″潡鍏冪礌'; +) ENGINE=MyISAM AUTO_INCREMENT=1476 DEFAULT CHARSET=utf8 COMMENT='妯″潡鍏冪礌'; -- ---------------------------- -- Records of xinhu_flow_element @@ -2365,7 +2371,7 @@ INSERT INTO `xinhu_flow_element` VALUES ('854', '34', '鍏Н閲戜釜浜', 'gongge INSERT INTO `xinhu_flow_element` VALUES ('855', '34', '鍏Н閲戝崟浣', 'gongunit', 'number', '41', '0', '0', null, '0', '0', null, '0', '0', null, null, '0', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('856', '84', '鐘舵', 'status', 'checkbox', '2', '1', '0', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, '鍚敤', '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('857', '83', '鐘舵', 'status', 'checkbox', '8', '1', '0', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, '鍚敤', '0', '0', '0', null); -INSERT INTO `xinhu_flow_element` VALUES ('858', '24', '棰嗙敤鐨勭墿鍝', 'wupinlist', 'text', '2', null, '0', null, '0', '0', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('858', '24', '棰嗙敤鐨勭墿鍝', 'wupinlist', 'text', '2', null, '0', null, '0', '0', null, '0', '0', null, null, '0', null, '1', '0', '1', '0', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('859', '34', '椁愯ˉ璐', 'foodbt', 'number', '1', '0', '0', null, '0', '0', null, '0', '0', null, null, '0', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('860', '34', '楂樻俯娲ヨ创', 'hotbt', 'number', '1', '0', '0', null, '0', '0', null, '0', '0', null, null, '0', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('861', '34', '鐢佃剳琛ヨ创', 'dnbt', 'number', '1', '0', '0', null, '0', '0', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, null, '0', '0', '0', null); @@ -2481,7 +2487,7 @@ INSERT INTO `xinhu_flow_element` VALUES ('1043', '99', '寰呭姙浜', 'distren', ' INSERT INTO `xinhu_flow_element` VALUES ('1044', '99', '鎻愰啋缁', 'recename', 'changedeptusercheck', '0', null, '0', 'receid', '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1045', '99', '璇存槑', 'explain', 'textarea', '0', null, '0', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1046', '98', '璺熻繘浜', 'optname', 'text', '7', null, '0', null, '0', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); -INSERT INTO `xinhu_flow_element` VALUES ('1047', '24', '瑕佸綊杩樺悧', 'lygh', 'select', '4', '0', '0', '0|涓嶉渶瑕,1|闇瑕', '1', '1', null, '1', '0', null, null, '0', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1047', '24', '瑕佸綊杩樺悧', 'lygh', 'select', '4', '0', '0', '0|涓嶉渶瑕,1|闇瑕', '1', '1', null, '1', '0', null, null, '0', null, '0', '0', '0', '1', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1048', '100', '棰嗙敤鍗', 'custname', 'selectdatafalse', '0', null, '1', 'getgoodly,custid', '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, '璇诲彇浣犵敵璇疯繃鐨勯鐢ㄥ崟', '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1049', '100', '棰嗙敤鍗昳d', 'custid', 'hidden', '1', '0', '1', null, '1', '0', null, '0', '0', null, null, '0', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1050', '100', '璇存槑', 'explain', 'textarea', '2', null, '0', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); @@ -2579,6 +2585,17 @@ INSERT INTO `xinhu_flow_element` VALUES ('1461', '57', '浠樻鏃堕棿', 'paydt', INSERT INTO `xinhu_flow_element` VALUES ('1462', '57', '鎵灞炴棩鏈', 'dt', 'date', '3', '{date}', '1', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1463', '57', '鍒涘缓浜', 'createname', 'text', '11', null, '0', null, '0', '1', null, '0', '0', null, null, '0', null, '1', '1', '0', '1', '0', null, null, '0', '0', '0', null); INSERT INTO `xinhu_flow_element` VALUES ('1464', '57', '鎵灞炰汉', 'optname', 'text', '0', null, '0', null, '0', '1', null, '0', '0', null, null, '0', null, '1', '1', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1465', '133', '鍚嶇О', 'name', 'text', '0', null, '0', null, '1', '1', null, '0', '0', null, null, '200', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1466', '133', '璁″垝绫诲瀷', 'leixing', 'select', '1', '0', '1', 'leixingdata', '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1467', '133', '寮濮嬫椂闂', 'startdt', 'datetime', '2', '{now}', '1', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '1', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1468', '133', '鎴鏃堕棿', 'enddt', 'datetime', '3', null, '1', null, '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1469', '133', '璇勫浜', 'psren', 'changeusercheck', '4', null, '0', 'psrenid', '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1470', '133', '鎵ц浜', 'runren', 'changedeptusercheck', '5', '{admin}|u{uid}', '1', 'runrenid', '1', '1', null, '0', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1471', '133', '璁″垝浜嬮」', 'pitem', 'text', '0', null, '1', null, '1', '1', null, '1', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1472', '133', '鎵ц浜', 'zxren', 'changedeptusercheck', '1', null, '0', 'zxrenid', '1', '1', null, '1', '0', null, null, '0', null, '1', '0', '0', '1', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1473', '133', '鎵ц鏃堕棿', 'zxtime', 'datetime', '2', null, '0', null, '1', '1', null, '1', '0', null, null, '0', null, '1', '0', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1474', '133', '璇存槑', 'explain', 'textarea', '6', null, '0', null, '1', '1', null, '0', '0', null, null, '500', null, '0', '0', '0', '0', '0', null, null, '0', '0', '0', null); +INSERT INTO `xinhu_flow_element` VALUES ('1475', '133', '鎵ц鐘舵', 'state', 'select', '7', '0', '0', '0|寰呮墽琛,1|宸插畬鎴,2|鎵ц涓', '0', '1', null, '0', '0', null, null, '0', null, '1', '1', '0', '1', '0', null, null, '0', '0', '0', null); -- ---------------------------- -- Table structure for `xinhu_flow_extent` @@ -2597,7 +2614,7 @@ CREATE TABLE `xinhu_flow_extent` ( `fieldstr` varchar(500) DEFAULT NULL COMMENT '鐩稿叧瀛楁', PRIMARY KEY (`id`), KEY `modeid` (`modeid`) -) ENGINE=MyISAM AUTO_INCREMENT=271 DEFAULT CHARSET=utf8 COMMENT='妯″潡鏉冮檺'; +) ENGINE=MyISAM AUTO_INCREMENT=272 DEFAULT CHARSET=utf8 COMMENT='妯″潡鏉冮檺'; -- ---------------------------- -- Records of xinhu_flow_extent @@ -2831,6 +2848,7 @@ INSERT INTO `xinhu_flow_extent` VALUES ('261', '鍏ㄤ綋浜哄憳', 'all', '82', '2', INSERT INTO `xinhu_flow_extent` VALUES ('262', '鍏ㄤ綋浜哄憳', 'all', '82', '3', 'YHVpZGA9e3VpZH0:', null, '1', '0', null); INSERT INTO `xinhu_flow_extent` VALUES ('263', '鍏ㄤ綋浜哄憳', 'all', '82', '1', null, null, '1', '0', null); INSERT INTO `xinhu_flow_extent` VALUES ('264', '澶т箶', 'u4', '19', '1', null, null, '1', '0', null); +INSERT INTO `xinhu_flow_extent` VALUES ('271', '鍏ㄤ綋浜哄憳', 'all', '133', '1', null, null, '1', '0', null); -- ---------------------------- -- Table structure for `xinhu_flow_log` @@ -2858,7 +2876,7 @@ CREATE TABLE `xinhu_flow_log` ( `iszb` tinyint(1) DEFAULT '0' COMMENT '鏄惁杞姙璁板綍', PRIMARY KEY (`id`), KEY `table` (`table`,`mid`) -) ENGINE=MyISAM AUTO_INCREMENT=4322 DEFAULT CHARSET=utf8 COMMENT='鍗曟嵁鎿嶄綔璁板綍'; +) ENGINE=MyISAM AUTO_INCREMENT=4370 DEFAULT CHARSET=utf8 COMMENT='鍗曟嵁鎿嶄綔璁板綍'; -- ---------------------------- -- Records of xinhu_flow_log @@ -3297,6 +3315,18 @@ INSERT INTO `xinhu_flow_log` VALUES ('4222', 'demo', '19', '1', '鍚屾剰', '涓 INSERT INTO `xinhu_flow_log` VALUES ('4313', 'custfina', '11', '0', '宸蹭粯娆', '鏍囧凡浠樻', '0', '2022-05-25 21:33:06', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '57', 'green', '1', '0', null, '0'); INSERT INTO `xinhu_flow_log` VALUES ('4312', 'custfina', '12', '1', null, '鎻愪氦', '0', '2022-05-25 21:31:11', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '36', null, '1', '0', null, '0'); INSERT INTO `xinhu_flow_log` VALUES ('4311', 'custfina', '11', '1', null, '鎻愪氦', '0', '2022-05-25 21:30:53', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '57', null, '1', '0', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4326', 'infor', '6', '1', null, '璇勮', '0', '2022-08-20 15:02:32', '涓嶉敊\n鍝堝搱\n鍝堝搱2', '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '1', null, '1', '0', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4354', 'planm', '1', '1', null, '鎻愪氦', '0', '2022-09-01 20:13:40', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '133', null, '1', '0', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4358', 'planm', '1', '1', '鍚屾剰', '璇勫璁″垝', '141', '2022-09-01 22:31:25', null, 'unknow', 'Chrome', '澶т箶', '4', '133', 'green', '1', '1', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4359', 'planm', '1', '1', '鐭ラ亾浜', '鎵ц浜虹煡鎮', '142', '2022-09-01 22:31:33', null, 'unknow', 'Chrome', '澶т箶', '4', '133', null, '1', '2', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4360', 'planm', '1', '1', '鐭ラ亾浜', '鎵ц浜虹煡鎮', '142', '2022-09-01 22:32:52', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '133', null, '1', '2', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4361', 'planm', '1', '1', '鍙戝竷', '鍙戝竷鎵ц', '143', '2022-09-01 22:33:07', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '133', null, '1', '3', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4362', 'planm', '2', '1', null, '鎻愪氦', '0', '2022-09-02 15:07:31', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '133', null, '1', '0', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4363', 'planm', '2', '1', '鐭ラ亾浜', '鎵ц浜虹煡鎮', '142', '2022-09-03 18:20:08', null, 'unknow', 'Chrome', '澶т箶', '4', '133', null, '1', '1', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4364', 'planm', '2', '1', '鍙戝竷', '鍙戝竷鎵ц', '143', '2022-09-03 18:20:14', null, '127.0.0.1', 'Chrome', '绠$悊鍛', '1', '133', null, '1', '2', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4365', 'planm', '3', '1', null, '鎻愪氦', '0', '2022-09-04 12:17:25', null, 'unknow', 'Chrome', '澶т箶', '4', '133', null, '1', '0', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4366', 'planm', '3', '1', '鐭ラ亾浜', '鎵ц浜虹煡鎮', '142', '2022-09-04 12:18:56', null, 'unknow', 'Chrome', '澶т箶', '4', '133', null, '1', '1', null, '0'); +INSERT INTO `xinhu_flow_log` VALUES ('4367', 'planm', '3', '1', '鍙戝竷', '鍙戝竷鎵ц', '143', '2022-09-04 12:19:01', null, 'unknow', 'Chrome', '澶т箶', '4', '133', null, '1', '2', null, '0'); -- ---------------------------- -- Table structure for `xinhu_flow_menu` @@ -3488,7 +3518,7 @@ CREATE TABLE `xinhu_flow_set` ( `sortdir` varchar(50) DEFAULT NULL COMMENT '榛樿鎺掑簭', `isys` tinyint(1) DEFAULT '0' COMMENT '鎻愯棰勫', PRIMARY KEY (`id`,`num`) -) ENGINE=MyISAM AUTO_INCREMENT=133 DEFAULT CHARSET=utf8 COMMENT='娴佺▼妯″潡'; +) ENGINE=MyISAM AUTO_INCREMENT=134 DEFAULT CHARSET=utf8 COMMENT='娴佺▼妯″潡'; -- ---------------------------- -- Records of xinhu_flow_set @@ -3590,6 +3620,7 @@ INSERT INTO `xinhu_flow_set` VALUES ('116', '娉ㄥ唽瀹℃牳', 'regcheck', '913', ' INSERT INTO `xinhu_flow_set` VALUES ('82', '渚跨', 'bianjian', '29', 'bianjian', null, '{content}', 'optdt:{suodt}\ncont:{content}', '鍩虹', '0', '0', '0', '0', null, '0', 'all', '鍏ㄤ綋浜哄憳', '2021-08-31 18:45:45', '1', '1', null, null, null, '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', null, '0'); INSERT INTO `xinhu_flow_set` VALUES ('122', '瀹㈡埛鏈嶅姟', 'custfuwu', '57', 'custappy', 'dtype=1', '{custname}鏈嶅姟閲戦锛歿money}', 'title:{custname}\noptdt:{optdt}\ncont:{explain}
閲戦锛歿money}', '瀹㈡埛', '0', '0', '0', '0', 'CG-Ymd-', '1', 'all', '鍏ㄤ綋浜哄憳', '2021-11-25 14:15:45', '1', '1', null, null, '寰?澶勭悊,宸插畬鎴,鏈畬鎴', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', null, '0'); INSERT INTO `xinhu_flow_set` VALUES ('57', '浠樻鍗', 'custfinb', '54', 'custfina', 'type=1', '鏃ユ湡[{dt}],{custname},{ispay}', 'title:{custname}\noptdt:{optdt}\ncont:閲戦锛歿money}[br]瀵瑰簲鍚堝悓锛歿htnum}', '瀹㈡埛', '0', '0', '0', '0', 'CD-Ymd-', '0', 'all', '鍏ㄤ綋浜哄憳', '2022-05-25 20:56:37', '1', '1', null, null, null, '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', null, '0'); +INSERT INTO `xinhu_flow_set` VALUES ('133', '宸ヤ綔璁″垝', 'planm', '30', 'planm', null, '{name}锛屾墽琛屼汉锛歿runren}', 'title:{name}\ncont:鎵ц浜猴細{runren}[br]寮濮嬫椂闂达細{startdt}[br]璇勫浜猴細{psren}[br]鎵ц鐘舵侊細{state}', '鍩虹', '0', '0', '0', '0', 'PL-Ymd', '1', 'all', '鍏ㄤ綋浜哄憳', '2022-09-04 17:28:18', '1', '1', 'plans', '璁″垝浜嬮」', '寰?澶勭悊,宸插彂甯,鏈氳繃', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', null, '0'); -- ---------------------------- -- Table structure for `xinhu_flow_todo` @@ -3697,7 +3728,7 @@ CREATE TABLE `xinhu_flow_where` ( `syrname` varchar(200) DEFAULT NULL COMMENT '姝ゆ潯浠跺彲閫傜敤瀵硅薄', PRIMARY KEY (`id`), KEY `setid` (`setid`) -) ENGINE=MyISAM AUTO_INCREMENT=366 DEFAULT CHARSET=utf8 COMMENT='鍗曟嵁鏉′欢'; +) ENGINE=MyISAM AUTO_INCREMENT=371 DEFAULT CHARSET=utf8 COMMENT='鍗曟嵁鏉′欢'; -- ---------------------------- -- Records of xinhu_flow_where @@ -3980,6 +4011,11 @@ INSERT INTO `xinhu_flow_where` VALUES ('340', '122', 'my', null, '鎴戠殑鐢宠', INSERT INTO `xinhu_flow_where` VALUES ('341', '122', 'myfw', null, '鏈嶅姟浜哄憳鏄垜', 'e3VzaWQsdWlkaW59', null, null, '1', null, null, null, null, null, '1', '1', null, null); INSERT INTO `xinhu_flow_where` VALUES ('342', '122', 'all', 'all', '鎵鏈夊鎴锋湇鍔', 'MT0x', null, null, '0', null, null, null, null, null, '1', '1', null, null); INSERT INTO `xinhu_flow_where` VALUES ('354', '73', 'alljxc', 'alljxc', '浠撳簱绠$悊', 'MT0x', null, null, '0', null, null, null, null, null, '1', '1', null, null); +INSERT INTO `xinhu_flow_where` VALUES ('366', '133', 'mycj', null, '鎴戠殑鍒涘缓', 'YHVpZGA9e3VpZH0:', null, null, '2', null, null, null, null, null, '1', '1', null, null); +INSERT INTO `xinhu_flow_where` VALUES ('367', '133', 'my', null, '鎴戠殑璁″垝寰呭畬鎴', 'e3J1bnJlbmlkLHJlY2Vub3R9IGFuZCBgc3RhdHVzYD0xIGFuZCBgc3RhdGVgPD4x', null, null, '0', null, null, null, null, null, '1', '1', null, null); +INSERT INTO `xinhu_flow_where` VALUES ('368', '133', 'bumen', null, '閮ㄩ棬璁″垝', 'MT0x', null, null, '2', '閮ㄩ棬璐熻矗浜烘墠鑳芥樉绀烘暟鎹', null, null, null, null, '1', '1', null, null); +INSERT INTO `xinhu_flow_where` VALUES ('369', '133', 'all', 'all', '鎵鏈夊伐浣滆鍒', 'MT0x', null, null, '0', null, null, null, null, null, '1', '1', null, null); +INSERT INTO `xinhu_flow_where` VALUES ('370', '133', 'myxg', null, '鎴戞墍鏈夌浉鍏宠鍒', 'e3J1bnJlbmlkLHJlY2Vub3R9', null, null, '1', null, null, null, null, null, '1', '1', null, null); -- ---------------------------- -- Table structure for `xinhu_godepot` @@ -4868,7 +4904,7 @@ CREATE TABLE `xinhu_im_group` ( `deptid` varchar(100) DEFAULT NULL COMMENT '瀵瑰簲閮ㄩ棬id', PRIMARY KEY (`id`), KEY `num` (`num`) -) ENGINE=MyISAM AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COMMENT='IM浼氳瘽琛'; +) ENGINE=MyISAM AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COMMENT='IM浼氳瘽琛'; -- ---------------------------- -- Records of xinhu_im_group @@ -4918,6 +4954,7 @@ INSERT INTO `xinhu_im_group` VALUES ('56', '璺熻繘璁″垝', '0', '瀹㈡埛', '2', ' INSERT INTO `xinhu_im_group` VALUES ('57', '鍗曟嵁鏌ョ湅', '0', '娴佺▼', '2', '12', null, null, null, 'images/project.png', 'danju', null, null, 'link', '1', null, null, null, '0', 'flowsearch', '?d=we&m=flow&a=view', null); INSERT INTO `xinhu_im_group` VALUES ('58', '鑰冨嫟琛', '0', '鑰冨嫟', '2', '8', null, null, null, 'images/bwl2.png', 'kqbiao', null, null, 'auto', '1', null, null, null, '0', null, null, null); INSERT INTO `xinhu_im_group` VALUES ('59', '渚跨', '0', '鍩虹', '2', '30', null, null, null, 'images/daily.png', 'bianjian', null, null, 'auto', '1', null, null, null, '0', null, null, null); +INSERT INTO `xinhu_im_group` VALUES ('66', '宸ヤ綔璁″垝', '0', '鍩虹', '2', '26', null, null, null, 'images/bwl.png', 'planm', null, null, 'auto', '1', null, null, null, '0', null, null, null); -- ---------------------------- -- Table structure for `xinhu_im_groupuser` @@ -4926,7 +4963,7 @@ DROP TABLE IF EXISTS `xinhu_im_groupuser`; CREATE TABLE `xinhu_im_groupuser` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gid` smallint(6) NOT NULL DEFAULT '0', - `uid` smallint(6) NOT NULL DEFAULT '0', + `uid` int(11) NOT NULL DEFAULT '0', `istx` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=150 DEFAULT CHARSET=utf8 COMMENT='IM浼氳瘽浜哄憳'; @@ -4984,13 +5021,13 @@ CREATE TABLE `xinhu_im_history` ( -- ---------------------------- -- Records of xinhu_im_history -- ---------------------------- -INSERT INTO `xinhu_im_history` VALUES ('1', 'group', '2', '2', '8', '2022-07-10 13:51:13', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('2', 'group', '2', '7', '8', '2022-07-10 13:51:13', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('3', 'group', '2', '6', '8', '2022-07-10 13:51:13', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('4', 'group', '2', '8', '8', '2022-07-10 13:51:13', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('5', 'group', '2', '5', '8', '2022-07-10 13:51:14', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('6', 'group', '2', '1', '8', '2022-07-10 13:51:14', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -INSERT INTO `xinhu_im_history` VALUES ('7', 'group', '2', '4', '8', '2022-07-10 13:51:14', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('1', 'group', '2', '2', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('2', 'group', '2', '7', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('3', 'group', '2', '6', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('4', 'group', '2', '8', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('5', 'group', '2', '5', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('6', 'group', '2', '1', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); +INSERT INTO `xinhu_im_history` VALUES ('7', 'group', '2', '4', '8', '2022-09-05 15:19:51', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '1', null, null, '0'); -- ---------------------------- -- Table structure for `xinhu_im_menu` @@ -5010,7 +5047,7 @@ CREATE TABLE `xinhu_im_menu` ( `recename` varchar(300) DEFAULT NULL COMMENT '鍙娇鐢ㄤ汉鍛', PRIMARY KEY (`id`), KEY `mid` (`mid`) -) ENGINE=MyISAM AUTO_INCREMENT=187 DEFAULT CHARSET=utf8 COMMENT='IM涓嬪簲鐢ㄨ彍鍗'; +) ENGINE=MyISAM AUTO_INCREMENT=193 DEFAULT CHARSET=utf8 COMMENT='IM涓嬪簲鐢ㄨ彍鍗'; -- ---------------------------- -- Records of xinhu_im_menu @@ -5199,6 +5236,12 @@ INSERT INTO `xinhu_im_menu` VALUES ('183', '58', '0', '閲嶆柊鍒嗘瀽', '0', '0', INSERT INTO `xinhu_im_menu` VALUES ('184', '59', '0', '鎴戞墍鏈変究绗', '0', '0', 'my', null, null, null, null); INSERT INTO `xinhu_im_menu` VALUES ('185', '59', '0', '寰呭畬鎴愮殑', '0', '0', 'mywfc', 'weiwc', null, null, null); INSERT INTO `xinhu_im_menu` VALUES ('186', '59', '0', '鏂板', '0', '1', 'add', null, null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('187', '66', '0', '寰呭畬鎴愮殑', '0', '0', 'my', 'mydwc', null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('188', '66', '0', '鏇村鏌ョ湅', '0', '0', null, null, null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('189', '66', '0', '锛嬫柊澧', '0', '1', 'add', null, null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('190', '66', '188', '鎴戠殑鍒涘缓', '0', '0', 'mycj', null, null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('191', '66', '188', '鎴戠浉鍏宠鍒', '0', '0', 'myxg', null, null, null, null); +INSERT INTO `xinhu_im_menu` VALUES ('192', '66', '188', '鎵鏈夊伐浣滆鍒', '0', '0', 'all', null, null, 'u1', '绠$悊鍛'); -- ---------------------------- -- Table structure for `xinhu_im_mess` @@ -5225,7 +5268,7 @@ CREATE TABLE `xinhu_im_mess` ( -- ---------------------------- -- Records of xinhu_im_mess -- ---------------------------- -INSERT INTO `xinhu_im_mess` VALUES ('1', '2022-07-10 13:51:13', '1', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '8', '2', '2,7,6,8,5,1,4', 'group', null, '0', null); +INSERT INTO `xinhu_im_mess` VALUES ('1', '2022-09-05 15:19:51', '1', '5aSn5a625pyJ5ZWl6Zeu6aKY6L!Z6YeM6K!05ZWK77yB', '8', '2', '2,7,6,8,5,1,4', 'group', null, '0', null); -- ---------------------------- -- Table structure for `xinhu_im_messzt` @@ -5305,7 +5348,7 @@ CREATE TABLE `xinhu_infor` ( -- ---------------------------- INSERT INTO `xinhu_infor` VALUES ('1', '娆㈣繋浣跨敤淇″懠宸ヤ綔鍙', '2018-04-26 17:27:10', '閫氱煡鍏憡', '

\n 娆㈣繋浣跨敤锛屾湁浠讳綍闂鍙互闅忔椂鑱旂郴鎴戜滑锛屽府浣犺В绛斿摝銆 \n

\n

\n 淇″懠鏄竴娆惧紑婧愬厤璐圭殑宸ヤ綔鍙拌蒋浠讹紝鍙坊鍔犲簲鐢紝绠$悊锛宲c涓婏紝app閮藉彲浠ヤ娇鐢紝鎴戜滑鐨勪唬鐮佸叏閮ㄥ紑鏀撅紝鍙嚜鐢变娇鐢ㄣ俓n

', null, null, null, '1', '绠$悊鍛', null, null, '淇″懠寮鍙戝洟闃', '2016-08-01', '1', null, '0', '0', '0', '0', null, null, '0', '0', '0'); INSERT INTO `xinhu_infor` VALUES ('2', '鍏充簬鍐欐棩鎶ュ埗搴﹁鏄', '2019-04-13 19:54:43', '瑙勫垯鍒跺害', '

\n 1銆佹瘡涓汉宸ヤ綔鏃ュ湪涓嬬彮鍚庡繀椤诲啓宸ヤ綔鏃ユ姤锛屽叏澶╄鍋囧彲涓嶇敤鍐欙紝鍙鏈変笂鐝氨闇瑕佸啓锛屽嵆浣夸綘涓婄彮1鍒嗛挓銆俓n

\n

\n 2銆佷篃鍙互闅斿ぉ鍐欍俓n

\n

\n 鏈啓澶勭綒 \n

\n

\n 1銆佹湭鍐欎竴娆℃墸浜斿潡锛岀疮璁″姞鍊嶃俓n

', null, 'u1,u2,u3,u4,u5,u6,u7,u8,u9', null, '1', '绠$悊鍛', null, null, '浜哄姏琛屾斂閮', '2016-08-01', '1', 'images/kqbanner1.jpg', '0', '0', '0', '0', null, null, '0', '0', '0'); -INSERT INTO `xinhu_infor` VALUES ('6', '淇″懠鏇存柊鍙戝竷V2.3.8鐗堟湰', '2022-07-10 11:07:54', '閫氱煡鍏憡', '

\n 鐗堟湰娣诲姞浜嗗彂甯冨涓嬪姛鑳藉晩銆俓n

\n

\n 1銆佺郴缁熷姛鑳藉畬鍠勩俓n

\n

\n 2銆佹洿鏂颁簡寰堝锛岃嚜宸辩湅鍗囩骇鏃ュ織銆俓n

', 'http://www.rockoa.com/view_down.html', 'd1', '淇″懠寮鍙戝洟闃', '1', '绠$悊鍛', null, null, '淇″懠寮鍙戝洟闃', '2022-07-10', '1', 'images/logo.png', '0', '0', '0', '1', null, null, '1', '1', '0'); +INSERT INTO `xinhu_infor` VALUES ('6', '淇″懠鏇存柊鍙戝竷V2.3.9鐗堟湰', '2022-09-05 14:49:27', '閫氱煡鍏憡', '

\n 鐗堟湰娣诲姞浜嗗彂甯冨涓嬪姛鑳藉晩銆俓n

\n

\n 1銆佺郴缁熷姛鑳藉畬鍠勩俓n

\n

\n 2銆佹洿鏂颁簡寰堝锛岃嚜宸辩湅鍗囩骇鏃ュ織銆俓n

', 'http://www.rockoa.com/view_down.html', 'u1,u6', '绠$悊鍛,寮犻', '1', '绠$悊鍛', null, null, '淇″懠寮鍙戝洟闃', '2022-09-05', '1', 'images/logo.png', '0', '0', '0', '1', null, null, '1', '1', '0'); INSERT INTO `xinhu_infor` VALUES ('9', '浣犱滑瑙夊緱杩欎釜绯荤粺濡備綍锛', '2019-06-03 13:17:05', '閫氱煡鍏憡', '寮濮嬫姇绁ㄦ媺銆', null, 'd1', '淇″懠寮鍙戝洟闃', '1', '绠$悊鍛', '2018-08-31 12:42:00', '2017-08-26 12:42:00', '寮鍙戦儴', '2017-08-26', '1', null, '1', '1', '0', '0', '2019-04-15', null, '1', '0', '0'); -- ---------------------------- @@ -6039,7 +6082,7 @@ CREATE TABLE `xinhu_menu` ( `types` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `pid` (`pid`,`status`) -) ENGINE=MyISAM AUTO_INCREMENT=407 DEFAULT CHARSET=utf8 COMMENT='绯荤粺鑿滃崟'; +) ENGINE=MyISAM AUTO_INCREMENT=411 DEFAULT CHARSET=utf8 COMMENT='绯荤粺鑿滃崟'; -- ---------------------------- -- Records of xinhu_menu @@ -6079,7 +6122,7 @@ INSERT INTO `xinhu_menu` VALUES ('33', '鎵撳崱璁板綍', '57', '0', 'main,kaoqin,d INSERT INTO `xinhu_menu` VALUES ('34', '鍗曟嵁鎿嶄綔鑿滃崟', '7', '9', 'main,flow,menu', null, null, null, '1', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('36', '鑰冨嫟淇℃伅', '57', '4', 'main,kaoqin,info', null, null, null, '1', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('37', '瀹㈡埛缁熻', '63', '10', null, null, null, null, '0', '1', null, '0', '0', '0', '0'); -INSERT INTO `xinhu_menu` VALUES ('38', '涓汉鍔炲叕', '0', '0', null, 'desktop', null, null, '0', '1', null, '0', '0', '0', '0'); +INSERT INTO `xinhu_menu` VALUES ('38', '涓汉鍔炲叕', '0', '0', null, 'desktop', null, null, '1', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('39', '涓汉涓績', '38', '0', null, null, null, null, '0', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('40', '娴佺▼', '0', '1', null, null, null, null, '1', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('41', '鎴戠殑鐢宠', '40', '2', 'main,fwork,bill,atype=my', 'align-left', null, 'applymy', '0', '1', null, '0', '0', '0', '0'); @@ -6354,6 +6397,10 @@ INSERT INTO `xinhu_menu` VALUES ('371', '闊宠棰戦氳瘽璁板綍', '14', '6', 'rei INSERT INTO `xinhu_menu` VALUES ('372', '鍙鍖栨ā鍧楄璁', '7', '2', 'open:?d=main&m=flowview', 'desktop', null, 'keshihau', '1', '1', null, '0', '0', '1', '0'); INSERT INTO `xinhu_menu` VALUES ('386', '鎵鏈夊鎴锋湇鍔', '126', '9', 'flow,page,custfuwu,atype=all,pnum=all', null, null, null, '1', '1', null, '0', '0', '0', '0'); INSERT INTO `xinhu_menu` VALUES ('387', '瀹㈡埛鏈嶅姟', '64', '9', 'flow,page,custfuwu,atype=my', null, null, null, '0', '1', null, '0', '0', '0', '0'); +INSERT INTO `xinhu_menu` VALUES ('407', '宸ヤ綔璁″垝鎺堟潈鏌ョ湅', '410', '21', 'flow,page,planm,atype=grant', null, null, null, '0', '1', null, '0', '0', '0', '0'); +INSERT INTO `xinhu_menu` VALUES ('408', '鎴戠殑宸ヤ綔璁″垝', '410', '6', 'flow,page,planm,atype=my', 'time', null, 'myplan', '0', '1', null, '0', '0', '0', '0'); +INSERT INTO `xinhu_menu` VALUES ('409', '鎵鏈夊伐浣滆鍒', '410', '30', 'flow,page,planm,atype=all,pnum=all', null, null, null, '1', '1', null, '0', '0', '0', '0'); +INSERT INTO `xinhu_menu` VALUES ('410', '宸ヤ綔璁″垝', '38', '20', null, null, null, null, '1', '1', null, '0', '0', '0', '0'); -- ---------------------------- -- Table structure for `xinhu_news` @@ -6465,7 +6512,7 @@ CREATE TABLE `xinhu_option` ( PRIMARY KEY (`id`), KEY `num` (`num`), KEY `pid` (`pid`) -) ENGINE=MyISAM AUTO_INCREMENT=771 DEFAULT CHARSET=utf8 COMMENT='绯荤粺閫夐」'; +) ENGINE=MyISAM AUTO_INCREMENT=774 DEFAULT CHARSET=utf8 COMMENT='绯荤粺閫夐」'; -- ---------------------------- -- Records of xinhu_option @@ -6898,6 +6945,71 @@ INSERT INTO `xinhu_option` VALUES ('766', '鏈垎绫', '0', '754', null, null, ' INSERT INTO `xinhu_option` VALUES ('767', '閲囪喘閫璐у嚭搴', '0', '761', null, '22', '0', null, '1', null, '0', null, null, null, '0'); INSERT INTO `xinhu_option` VALUES ('768', '璋冩嫧鍏ュ簱', '0', '758', null, '2', '0', null, '1', null, '0', null, null, null, '0'); INSERT INTO `xinhu_option` VALUES ('769', '璋冩嫧鍑哄簱', '0', '761', null, '23', '0', null, '1', null, '0', null, null, null, '0'); +INSERT INTO `xinhu_option` VALUES ('772', '鎵嬫満绔槸鍚︽樉绀鸿仈绯讳汉', '0', '475', 'appsy_lxrshow', '鏄', '0', null, '1', null, '0', null, null, '涓嶆樉绀哄搴斿兼敼鎴愨滃惁鈥', '0'); + +-- ---------------------------- +-- Table structure for `xinhu_planm` +-- ---------------------------- +DROP TABLE IF EXISTS `xinhu_planm`; +CREATE TABLE `xinhu_planm` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) DEFAULT '0', + `optdt` datetime DEFAULT NULL COMMENT '鎿嶄綔鏃堕棿', + `optid` int(11) DEFAULT '0', + `optname` varchar(20) DEFAULT NULL COMMENT '鎿嶄綔浜', + `applydt` date DEFAULT NULL COMMENT '鐢宠鏃ユ湡', + `explain` varchar(500) DEFAULT NULL COMMENT '璇存槑', + `status` tinyint(1) DEFAULT '1' COMMENT '鐘舵', + `isturn` tinyint(1) DEFAULT '1' COMMENT '鏄惁鎻愪氦', + `comid` smallint(6) DEFAULT '0' COMMENT '瀵瑰簲鍗曚綅id', + `name` varchar(200) DEFAULT NULL COMMENT '鍚嶇О', + `leixing` smallint(6) DEFAULT '0' COMMENT '绫诲瀷', + `startdt` datetime DEFAULT NULL COMMENT '寮濮嬫椂闂', + `enddt` datetime DEFAULT NULL COMMENT '鎴鏃堕棿', + `psren` varchar(100) DEFAULT NULL COMMENT '璇勫浜', + `psrenid` varchar(100) DEFAULT NULL COMMENT '璇勫浜虹殑ID', + `runren` varchar(500) DEFAULT NULL COMMENT '鎵ц浜', + `runrenid` varchar(500) DEFAULT NULL COMMENT '鎵ц浜虹殑ID', + `state` smallint(6) DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='宸ヤ綔璁″垝'; + +-- ---------------------------- +-- Records of xinhu_planm +-- ---------------------------- +INSERT INTO `xinhu_planm` VALUES ('1', '1', '2022-09-01 20:38:05', '1', '绠$悊鍛', '2022-09-01', null, '1', '1', '1', '2022骞09鏈堜唤绗1鍛ㄥ伐浣滆鍒', '4', '2022-09-01 20:13:15', '2022-09-01 20:13:19', '澶т箶', '4', '寮鍙戦儴,璐㈠姟閮', 'd2,d3', '1'); +INSERT INTO `xinhu_planm` VALUES ('2', '1', '2022-09-02 15:07:31', '1', '绠$悊鍛', '2022-09-02', null, '1', '1', '1', '2022骞09鏈堜唤宸ヤ綔璁″垝', '3', '2022-09-02 15:03:00', '2022-09-30 15:06:00', null, null, '琛屾斂浜轰簨閮', 'd4', '1'); +INSERT INTO `xinhu_planm` VALUES ('3', '4', '2022-09-04 12:17:25', '4', '澶т箶', '2022-09-04', null, '1', '1', '2', '2022绗3瀛e害宸ヤ綔璁″垝', '2', '2022-09-04 12:16:24', '2022-09-15 12:17:00', null, null, '璐㈠姟閮', 'd3', '2'); + +-- ---------------------------- +-- Table structure for `xinhu_plans` +-- ---------------------------- +DROP TABLE IF EXISTS `xinhu_plans`; +CREATE TABLE `xinhu_plans` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `mid` int(11) DEFAULT '0' COMMENT '瀵瑰簲涓昏〃planm.id', + `sort` int(11) DEFAULT '0' COMMENT '鎺掑簭鍙', + `comid` smallint(6) DEFAULT '0' COMMENT '瀵瑰簲鍗曚綅id', + `pitem` varchar(50) DEFAULT NULL COMMENT '璁″垝浜嬮」', + `zxren` varchar(500) DEFAULT NULL COMMENT '鎵ц浜', + `zxrenid` varchar(500) DEFAULT NULL COMMENT '鎵ц浜虹殑ID', + `zxtime` datetime DEFAULT NULL COMMENT '鎵ц鏃堕棿', + PRIMARY KEY (`id`), + KEY `mid` (`mid`) +) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of xinhu_plans +-- ---------------------------- +INSERT INTO `xinhu_plans` VALUES ('1', '1', '0', '1', '9鏈堥攢鍞杈惧埌600涓', '寮鍙戦儴', 'd2', null); +INSERT INTO `xinhu_plans` VALUES ('2', '1', '1', '1', '鎵╁睍鏂板鎴', '璐㈠姟閮,琛屾斂浜轰簨閮', 'd3,d4', null); +INSERT INTO `xinhu_plans` VALUES ('3', '1', '2', '1', '瀛︿範鏂版妧鑳', '寮犻', 'u6', '2022-09-02 23:02:44'); +INSERT INTO `xinhu_plans` VALUES ('4', '2', '0', '1', '寮鍙戠エ', '澶т箶', 'u4', '2022-09-03 18:51:00'); +INSERT INTO `xinhu_plans` VALUES ('5', '2', '1', '1', '鎶ョ◣', '澶т箶', 'u4', '2022-09-03 19:42:55'); +INSERT INTO `xinhu_plans` VALUES ('6', '2', '2', '1', '鐢虫姤绀句繚', '澶т箶', 'u4', '2022-09-29 19:42:00'); +INSERT INTO `xinhu_plans` VALUES ('7', '3', '0', '2', '璐㈠姟鐩爣瀛︿範1', '灏忎箶', 'u3', null); +INSERT INTO `xinhu_plans` VALUES ('8', '3', '1', '2', '璐㈠姟鐩爣瀛︿範2', null, null, null); +INSERT INTO `xinhu_plans` VALUES ('9', '3', '2', '2', '璐㈠姟鐩爣瀛︿範3', null, null, null); -- ---------------------------- -- Table structure for `xinhu_project` @@ -7307,7 +7419,7 @@ CREATE TABLE `xinhu_task` ( INSERT INTO `xinhu_task` VALUES ('1', '娴佺▼浠庢柊鍖归厤', '绯荤粺', 'flow,pipei', 'd,d', '00:10:00,12:10:00', '姣忓ぉ0,12鐐', '1', '0', null, null, '0', null, null, null, null, null); INSERT INTO `xinhu_task` VALUES ('2', '鏁版嵁澶囦唤', '绯荤粺', 'sys,beifen', 'd', '00:20:00', '姣忓ぉ鍑屾櫒00:20', '1', '0', null, null, '0', null, null, null, null, null); INSERT INTO `xinhu_task` VALUES ('3', '绯荤粺鍗囩骇鎻愰啋', '绯荤粺', 'sys,upgtx', 'd', '00:25:00', '姣忓ぉ鍑屾櫒00:25', '0', '0', null, null, '0', null, null, null, '1,8', '绠$悊鍛,淇″懠瀹㈡湇'); -INSERT INTO `xinhu_task` VALUES ('4', '5鍒嗛挓杩愯1娆', '绯荤粺', 'minute5,run', 'i5', '00', '姣5鍒嗛挓杩愯涓娆', '1', '0', null, null, '0', null, null, '杩欎釜鏄繀椤荤殑锛屼笉鍙垹闄ゅ仠鐢', null, null); +INSERT INTO `xinhu_task` VALUES ('4', '5鍒嗛挓杩愯1娆', '绯荤粺', 'minute5,run', 'i5', '00', '姣5鍒嗛挓杩愯涓娆', '1', '1', '2022-09-05 15:20:01', null, '0', null, 'success', '杩欎釜鏄繀椤荤殑锛屼笉鍙垹闄ゅ仠鐢', null, null); INSERT INTO `xinhu_task` VALUES ('5', '鑰冨嫟淇℃伅鎻愰啋', '鑰冨嫟', 'kaoqin,todo', 'd', '09:25:00', '姣忓ぉ9鐐', '1', '0', null, null, '21', null, null, '鍦ㄦā鍧椼愯冨嫟淇℃伅銆戜笅璁剧疆鎻愰啋鍒板摢浜涘钩鍙般', null, null); INSERT INTO `xinhu_task` VALUES ('6', '鐢ㄦ埛鏁版嵁鏇存柊', '鐢ㄦ埛', 'sys,dataup', 'd', '00:10:00', '姣忓ぉ', '1', '0', null, null, '1', null, null, null, null, null); INSERT INTO `xinhu_task` VALUES ('7', '鑰冨嫟鍒嗘瀽', '鑰冨嫟', 'kaoqin,anay', 'd', '02:15:00', '姣忓ぉ2鐐', '1', '0', null, null, '22', null, null, '鍒嗘瀽鍏ㄤ綋浜哄憳鏄ㄥぉ鐨勮冨嫟', null, null); diff --git a/webmain/main/flow/flowAction.php b/webmain/main/flow/flowAction.php index df8c19b..d3095ce 100644 --- a/webmain/main/flow/flowAction.php +++ b/webmain/main/flow/flowAction.php @@ -28,6 +28,23 @@ class flowClassAction extends Action return $where; } + public function getcompanydataAjax() + { + $rows = array(); + $msg = ''; + if(!getconfig('platdwnum')){ + $msg = '褰撳墠涓嶆槸SAAS妯″紡涓嶉渶瑕佹搷浣'; + }else{ + if(!COMPANYNUM){ + $rows = m('company')->getall('`iscreate`=1','id,name'); + if(!$rows)$msg='娌℃湁鍒涘缓杩囦换浣曞崟浣'; + }else{ + $msg = '璇峰湪绠$悊妯″紡涓嬫搷浣'; + } + } + return returnsuccess($rows, $msg); + } + public function flowwheresave_before($table,$das) { $str = m('where')->checkwhere($das['setid'], $das['wheresstr']); diff --git a/webmain/main/flow/rock_flow_set.php b/webmain/main/flow/rock_flow_set.php index 4625cc3..5bfe4ca 100644 --- a/webmain/main/flow/rock_flow_set.php +++ b/webmain/main/flow/rock_flow_set.php @@ -198,8 +198,59 @@ $(document).ready(function(){ shengsheng:function(){ var sid = a.getchecked(); addtabs({'name':'鍒涘缓瀹夎鍖',url:'main,flow,createinstall,sid='+jm.base64encode(sid)+'',num:'createinstall'}); + }, + tongbudanwu:function(){ + var sid = a.getchecked(); + if(!sid){ + js.msgerror('澶嶉夋涓病鏈夐変腑妯″潡');return; + } + this.xuandanwefe(sid,0); + }, + xuandanwefe:function(sid,lx){ + js.tanbody('senddw','鍚屾鍒板崟浣嶆暟鎹噷', 350, 200, { + html:'
', + btn:[{text:'纭畾鍚屾'}] + }); + js.ajax(js.getajaxurl('getcompanydata','{mode}','{dir}'),{},function(ret){ + var str = '',da=ret.data; + for(var i=0;i'+da[i].name+''; + } + if(!str)str=ret.msg; + $('#senddwdiv').html(str); + },'get,json'); + + $('#senddw_btn0').click(function(){ + c.sendgongwenjsok(sid,lx); + }); + }, + + sendgongwenjsok:function(id1,lx){ + var da = js.getformdata('sendform'); + if(!da.xuanzhe){ + js.msgerror('璇烽夋嫨鍗曚綅'); + return; + } + da.modeids = id1; + da.lx = lx; + js.loading('鍚屾涓...'); + js.tanclose('senddw'); + js.ajax(publicmodeurl('company','anaymodedata'),da,function(ret){ + js.msgok(ret.data); + },'post,json'); + }, + tongbumenu:function(){ + $.selectdata({ + title:'閫夋嫨闇瑕佸悓姝ョ殑鑿滃崟', + url:js.getajaxurl('getmenu','upgrade','system',{glx:1}), + checked:true,maxshow:500, + onselect:function(d1,sna,sid){ + if(sid)c.xuandanwefe(sid, 1) + } + }); } + }; js.initbtn(c); @@ -211,6 +262,10 @@ $(document).ready(function(){ name:'PC绔綍鍏ラ〉闈㈠竷灞',lx:1 },{ name:'娓呯┖姝ゆā鍧楁暟鎹',lx:2 + },{ + name:'鍚屾鍒板崟浣嶆暟鎹',lx:3 + },{ + name:'鍚屾鑿滃崟鍒板崟浣嶆暟鎹',lx:4 }], itemsclick:function(d, i){ var id = a.changedata.id; @@ -218,6 +273,8 @@ $(document).ready(function(){ if(d.lx==1)c.input(0); if(d.lx==0)c.elements(); if(d.lx==2)c.clearalldata(id); + if(d.lx==3)c.tongbudanwu(); + if(d.lx==4)c.tongbumenu(); } }); }); diff --git a/webmain/main/flow/rock_flow_whereedit.php b/webmain/main/flow/rock_flow_whereedit.php index 06f08e4..374abb8 100644 --- a/webmain/main/flow/rock_flow_whereedit.php +++ b/webmain/main/flow/rock_flow_whereedit.php @@ -178,6 +178,7 @@ $(document).ready(function(){         + diff --git a/webmain/main/view/rock_view_edit.php b/webmain/main/view/rock_view_edit.php index 4f25441..104cfc0 100644 --- a/webmain/main/view/rock_view_edit.php +++ b/webmain/main/view/rock_view_edit.php @@ -154,6 +154,7 @@ $(document).ready(function(){     + diff --git a/webmain/model/agent/gongModel.php b/webmain/model/agent/gongModel.php index 70df592..ff414fa 100644 --- a/webmain/model/agent/gongModel.php +++ b/webmain/model/agent/gongModel.php @@ -22,6 +22,9 @@ class agent_gongClassModel extends agentModel $where.= " and (`zstart` is null or `zstart`<='{$this->rock->date}')"; $where.= " and (`zsend` is null or `zsend`>='{$this->rock->date}')"; + $wdate = m('admin')->getmou('workdate', $uid); + if(!isempt($wdate))$where.=" and `indate`>='$wdate'"; + $where .= m('admin')->getcompanywhere(1); $stotal = m('infor')->rows($where); return $stotal; diff --git a/webmain/model/agent/planmModel.php b/webmain/model/agent/planmModel.php new file mode 100644 index 0000000..9938642 --- /dev/null +++ b/webmain/model/agent/planmModel.php @@ -0,0 +1,31 @@ +getwdtotal($this->adminid); + $titles = ''; + return array('stotal'=>$stotal,'titles'=> $titles); + } + + private function getwdtotal($uid) + { + + $stotal = m('flow:planm')->getwwctotals($uid); + return $stotal; + } + + + protected function agenttotals($uid) + { + $a = array( + 'mydwc' => $this->getwdtotal($uid) + ); + return $a; + } + +} \ No newline at end of file diff --git a/webmain/model/companyModel.php b/webmain/model/companyModel.php index b42aa7b..94227c9 100644 --- a/webmain/model/companyModel.php +++ b/webmain/model/companyModel.php @@ -17,6 +17,16 @@ class companyClassModel extends Model 'name' => '鏈椤剁骇', ); $this->getselectdatas($rows, $barr, '0', 0); + $idarr = array(); + foreach($barr as $k=>$rs)$idarr[] = $rs['value']; + foreach($rows as $k=>$rs){ + if(!in_array($rs['id'], $idarr)){ + $barr[] = array( + 'name' => $rs['name'], + 'value' => $rs['id'], + ); + } + } return $barr; } private function getselectdatas($rows,&$barr, $pid='0', $level=0) diff --git a/webmain/model/flow/flow.php b/webmain/model/flow/flow.php index 68cd404..9c5956f 100644 --- a/webmain/model/flow/flow.php +++ b/webmain/model/flow/flow.php @@ -12,4 +12,4 @@
'.$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 .= ''; } } } $contvimr .= '
'.$n.'
'.$vs.'
'.str_replace(' ','
',$n).'
'.$vs.'
'; } 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'] = $rs['explain']; 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' => $this->adminname, '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', $this->urs['deptid']); $whes = ''; $this->sericnum = $arr['sericnum']; }else{ $udeptid = $birs['udeptid']; if($udeptid==0)$arr['udeptid']=$this->urs['deptid']; } $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); $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')->delfiles($this->mtable, $this->id); $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."'"); $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 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'=>'璇勮','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'=>'缂栬緫','optnum'=>'edit','lx'=>'11','optmenuid'=>-11); } if($this->isdeleteqx()==1){ $arr[] = array('name'=>'鍒犻櫎','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 = arrvalue($this->rs,'uid','0'); if(isset($this->rs['optid']))$uids.=','.$this->rs['optid'].''; $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($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']==1){ $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']==1){ 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) { $rows = $this->getflowrows($this->adminid,$atype,$limit,$where); $headstr = '@xuhaos,,center'; foreach($this->fieldsarra as $k=>$rs){ if($rs['islb']==1 && $rs['iszb']=='0') $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 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 .= ''; } } } $contvimr .= '
'.$n.'
'.$vs.'
'.str_replace(' ','
',$n).'
'.$vs.'
'; } 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",'
', $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' => $this->adminname, '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', $this->urs['deptid']); $whes = ''; $this->sericnum = $arr['sericnum']; }else{ $udeptid = $birs['udeptid']; if($udeptid==0)$arr['udeptid']=$this->urs['deptid']; } $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')->delfiles($this->mtable, $this->id); $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."'"); $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 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'=>'璇勮','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'=>'缂栬緫','optnum'=>'edit','lx'=>'11','optmenuid'=>-11); } if($this->isdeleteqx()==1){ $arr[] = array('name'=>'鍒犻櫎','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 = arrvalue($this->rs,'uid','0'); if(isset($this->rs['optid']))$uids.=','.$this->rs['optid'].''; $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($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']==1){ $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']==1){ 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) { $rows = $this->getflowrows($this->adminid,$atype,$limit,$where); $headstr = '@xuhaos,,center'; foreach($this->fieldsarra as $k=>$rs){ if($rs['islb']==1 && $rs['iszb']=='0') $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 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/gongModel.php b/webmain/model/flow/gongModel.php index 8ef917f..097d479 100644 --- a/webmain/model/flow/gongModel.php +++ b/webmain/model/flow/gongModel.php @@ -101,8 +101,8 @@ class flow_gongClassModel extends flowModel $h = c('html'); $cont = $h->htmlremove($this->rs['content']); - $cont = $h->substrstr($cont,0, 50); - if(strlen($cont)>40)$cont.='...'; + $cont = $h->substrstr($cont,0, 40); + if(strlen($cont)>41)$cont.='...'; if(isempt($cont))$cont = $this->rs['title']; //涓虹┖鏃 $this->push($this->rs['receid'], '閫氱煡鍏憡', $cont, $this->rs['title'],1); @@ -159,6 +159,8 @@ class flow_gongClassModel extends flowModel if($lx=='my' || $lx=='wexx'){ $whyere= "and (`zstart` is null or `zstart`<='{$this->rock->date}')"; $whyere.= " and (`zsend` is null or `zsend`>='{$this->rock->date}')"; + $wdate = $this->adminmodel->getmou('workdate', $uid); + if(!isempt($wdate))$whyere.=" and `indate`>='$wdate'"; } if($typeid>0){ diff --git a/webmain/model/flow/planmModel.php b/webmain/model/flow/planmModel.php new file mode 100644 index 0000000..a5746fb --- /dev/null +++ b/webmain/model/flow/planmModel.php @@ -0,0 +1,173 @@ +'1','name'=>'骞村害'); + $arr[] = array('value'=>'2','name'=>'瀛e害'); + $arr[] = array('value'=>'3','name'=>'鏈堝害'); + $arr[] = array('value'=>'4','name'=>'鍛'); + $arr[] = array('value'=>'5','name'=>'椤圭洰'); + $arr[] = array('value'=>'0','name'=>'鍏朵粬'); + return $arr; + } + + private function leixingval($lx) + { + $data = $this->leixingdata(); + $str = $lx; + foreach($data as $kv=>$rv){ + if($rv['value']==$lx){ + $str = $rv['name'].'璁″垝'; + break; + } + } + return $str; + } + + public function flowrsreplace($rs, $lx=0){ + + $rs['leixing'] = $this->leixingval($rs['leixing']); + $str = ''; + if($rs['startdt']>$this->rock->now){ + $str = '鏈紑濮'; + }else if($rs['enddt']<$this->rock->now){ + + }else{ + $str = '鎵ц涓'; + } + if($rs['state']==1)$str='宸插畬鎴'; + if($rs['state']==2)$str='鎵ц涓'; + if($rs['state']==0)$str='寰呮墽琛'; + if($rs['enddt']<$this->rock->now)$str.=',宸叉埅姝'; + if($rs['startdt']>$this->rock->now)$str='鏈紑濮'; + + $rs['state'] = $str; + return $rs; + } + + //鑷畾涔夊鏍镐汉璇诲彇 + protected function flowcheckname($num){ + $sid = ''; + $sna = ''; + if($num=='zhixi'){ + $ssid = ''; + $runrenid = $this->rs['runrenid']; + if(!isempt($runrenid)){ + $dbs = m('dept'); + $runa = explode(',', $runrenid); + foreach($runa as $id1){ + $id1d = str_replace(array('d','u'),'', $id1); + if(contain($id1,'d')){ + $drs = $dbs->getone($id1d); + if($drs && !isempt($drs['headid']))$ssid.=','.$drs['headid'].''; + }else{ + $ssid.=','.$id1d.''; + } + } + } + if($ssid){ + $ssid = substr($ssid, 1); + $rows = $this->adminmodel->getall('id in('.$ssid.') and `status`=1'); + if($rows){ + foreach($rows as $k=>$rs){ + $sid.=','.$rs['id'].''; + $sna.=','.$rs['name'].''; + } + $sid = substr($sid, 1); + $sna = substr($sna, 1); + } + } + } + return array($sid, $sna); + } + + protected function flowbillwhere($uid, $lx) + { + $where = ''; + if($lx=='bumen'){ + $dbs = m('dept'); + $detpids= ''; + $drows = $dbs->getall($this->rock->dbinstr('headid', $uid)); //璇诲彇鎴戣礋璐g殑閮ㄩ棬 + foreach($drows as $k=>$rs)$detpids.=','.$rs['id'].''; + if($detpids!=''){ + $detpids = substr($detpids,1); + for($i=1;$i<=2;$i++){ + $drows = $dbs->getall('`pid` in('.$detpids.')'); + foreach($drows as $k=>$rs)$detpids.=','.$rs['id'].''; + if(!$drows)break; + } + } + if(!$detpids){ + $where='and 1=2'; + }else{ + $drows = $dbs->getall('`id` in('.$detpids.')'); + $whewea = array(); + foreach($drows as $k=>$rs){ + $whewea[] = $this->rock->dbinstr('runrenid', 'd'.$rs['id'].''); + } + $where = 'and ('.join(' or ', $whewea).')'; + } + } + return $where; + } + + //鍒ゆ柇鏄笉鏄啀鎵ц浜洪噷闈€ + private $runboolpdid = 0; + public function runboolpd() + { + if($this->rs['status']!=1 + || ($this->rs['enddt']<$this->rock->now && $this->rs['state']==1) + || $this->rs['startdt']>$this->rock->now)return false; + if($this->runboolpdid>0){ + if($this->runboolpdid==1)return true; + if($this->runboolpdid==2)return false; + } + $bo = $this->adminmodel->containjoin($this->rs['runrenid'], $this->adminid); + $this->runboolpdid = $bo ? 1: 2; + return $bo; + } + + //鏄惁鍙墽琛 + protected function flowdatalog($arr) + { + $runbool = $this->runboolpd(); + + return array( + 'modelujs' => $runbool, + ); + } + + //瀛愯〃鏁版嵁鏇挎崲澶勭悊 + protected function flowsubdata($rows, $lx=0){ + if($lx!=1 || !$rows || !$this->runboolpd())return $rows; + $inputobj = c('input'); + foreach($rows as $k=>$rs){ + $rows[$k]['zxren'] = $inputobj->inputchangeuser(array( + 'type' => 'changedeptusercheck', + 'changerange' => $this->rs['runrenid'], + 'name' => 'zhixing_zxren_'.$rs['id'].'', + 'id' => 'zhixing_zxrenid_'.$rs['id'].'', + 'value' => $rs['zxren'], + 'valueid' => $rs['zxrenid'], + 'title' => '鎵ц浜' + )); + $rows[$k]['zxtime'] = ''; + } + $zt = $this->rs['state']; + $rows[] = array( + 'pitem'=>'鎵ц鐘舵', + 'zxren'=>'', + 'zxtime'=>'
' + ); + return $rows; + } + + //缁熻鏈畬鎴 + public function getwwctotals($uid) + { + $where = m('admin')->getjoinstr('runrenid', $uid,0,1); + $where = "`status`=1 and `state`<>1 and `startdt`<'{$this->rock->now}' $where"; + return m('planm')->rows($where); + } +} \ No newline at end of file diff --git a/webmain/model/goodsModel.php b/webmain/model/goodsModel.php index 7abab02..a902617 100644 --- a/webmain/model/goodsModel.php +++ b/webmain/model/goodsModel.php @@ -203,14 +203,17 @@ class goodsClassModel extends Model */ public function getgoodninfo($mid, $glx=0, $mgx=5) { - $rows = $this->db->getall("select a.`count`,a.couns,a.`price`,b.`unit`,b.`num`,b.`name`,b.`guige`,b.`xinghao` from `[Q]goodn` a left join `[Q]goods` b on a.`aid`=b.`id` where a.`mid`='$mid' order by a.`sort`"); + $rows = $this->db->getall("select a.`count`,a.couns,a.`price`,b.`unit`,b.`num`,b.`name`,b.`guige`,b.`xinghao`,a.`lygh` from `[Q]goodn` a left join `[Q]goods` b on a.`aid`=b.`id` where a.`mid`='$mid' order by a.`sort`"); $str = ''; if($glx==1){ foreach($rows as $k1=>$rs1){ if($k1>$mgx)break; $str.=''.$rs1['name'].''; if(!isempt($rs1['xinghao']))$str.='('.$rs1['xinghao'].')'; - $str .=':'.$rs1['count'].''.$rs1['unit'].';'; + $str .=':'.$rs1['count'].''.$rs1['unit'].''; + if($rs1['lygh']=='1')$str.='(闇褰掕繕)'; + if($rs1['lygh']=='2')$str.='(宸插綊杩)'; + $str.=';'; } return $str; } diff --git a/webmain/model/homeitemsModel.php b/webmain/model/homeitemsModel.php index 9b00995..0d1608a 100644 --- a/webmain/model/homeitemsModel.php +++ b/webmain/model/homeitemsModel.php @@ -71,6 +71,13 @@ class homeitemsClassModel extends Model if(in_array('receiptmy', $nubar) && !isset($arr['receiptmy']))$arr['receiptmy'] = m('flow:receipt')->getweitotal($uid); if(in_array('myhong', $nubar) && !isset($arr['myhong']))$arr['myhong'] = m('official')->rows('`uid`='.$uid.' and `type`=0 and `status`=1 and `thid`=0');//缁熻鏈绾㈢殑 if(in_array('officidus', $nubar) && !isset($arr['officidus']))$arr['officidus'] = m('officidu')->rows('`status` in(0,3) and `isturn`=1 and '.$this->rock->dbinstr('runrenid',$uid).''); + + //鏈畬鎴愬伐浣滆鍒 + if(in_array('myplan', $nubar) && !isset($arr['myplan'])){ + $obj = m('flow:planm'); + if(method_exists($obj,'getwwctotals'))$arr['myplan'] = $obj->getwwctotals($uid); + } + return $arr; } diff --git a/webmain/model/whereModel.php b/webmain/model/whereModel.php index ea972f0..4dd460f 100644 --- a/webmain/model/whereModel.php +++ b/webmain/model/whereModel.php @@ -226,7 +226,7 @@ class whereClassModel extends Model */ public function checkwhere($modeid, $str) { - if(isempt($str))return ''; + if(isempt($str) || $this->rock->post('yuanwhere')!='1')return ''; $where = $this->rock->jm->base64decode($str); if($where=='all' || contain($where, '{super}') || contain($where, '{allsuper}') || diff --git a/webmain/task/api/weixinAction.php b/webmain/task/api/weixinAction.php index cc5dcbf..f2e0ded 100644 --- a/webmain/task/api/weixinAction.php +++ b/webmain/task/api/weixinAction.php @@ -45,7 +45,7 @@ class weixinClassAction extends apiAction{ $arr['scale'] = (int)$this->post('scale'); $arr['precision'] = (int)$this->post('precision'); $arr['label'] = $this->getvals('label'); - $arr['explain'] = $this->getvals('sm'); + $arr['explain'] = $this->rock->xssrepstr($this->getvals('sm')); $arr['optdt'] = $now; $arr['uid'] = $uid; $arr['comid'] = $comid; diff --git a/webmain/task/mode/tpl_mode_p.html b/webmain/task/mode/tpl_mode_p.html index 29884b7..2dc5263 100644 --- a/webmain/task/mode/tpl_mode_p.html +++ b/webmain/task/mode/tpl_mode_p.html @@ -419,7 +419,8 @@ if($stype!=''){ @@ -427,7 +428,7 @@ if($stype=='' && $cheikbo){ '; +if(($modelujs || $flowinfor['checkfields']) && $da['inputjspath']!='')echo ''; }?> diff --git a/webmain/task/mode/tpl_mode_x.html b/webmain/task/mode/tpl_mode_x.html index f478f71..020a1a1 100644 --- a/webmain/task/mode/tpl_mode_x.html +++ b/webmain/task/mode/tpl_mode_x.html @@ -377,7 +377,8 @@ if($da['arr']['isplview']=='1'){ ?> @@ -385,7 +386,7 @@ if($cheikbo){ '; +if(($modelujs || $flowinfor['checkfields']) && $da['inputjspath']!='')echo ''; }?> diff --git a/webmain/we/index/indexAction.php b/webmain/we/index/indexAction.php index 48b3aff..83b87c1 100644 --- a/webmain/we/index/indexAction.php +++ b/webmain/we/index/indexAction.php @@ -19,6 +19,7 @@ class indexClassAction extends ActionNot{ if(is_string($ybarr))return $ybarr; $this->assign('xhauthkey', getconfig('authkey', $ybarr['authkey'])); $this->assign('tplmess', $this->option->getval('wxgzh_tplmess')); + $this->assign('lxrshow', $this->option->getval('appsy_lxrshow')); } public function bd6($str) diff --git a/webmain/we/index/tpl_index.html b/webmain/we/index/tpl_index.html index 9f04e89..7de6c88 100644 --- a/webmain/we/index/tpl_index.html +++ b/webmain/we/index/tpl_index.html @@ -204,12 +204,14 @@ maincolor = '';

搴旂敤

+

鑱旂郴浜

+
diff --git a/webmain/we/login/tpl_login.html b/webmain/we/login/tpl_login.html index 648c3af..7392004 100644 --- a/webmain/we/login/tpl_login.html +++ b/webmain/we/login/tpl_login.html @@ -170,7 +170,7 @@ function dingdengl(bo){ dingdlogn(result.code); }, onFail : function(err) { - shidengl(1); + shidengl(err.errorMessage); } }); });