提交 3c54d701 authored 作者: wangkr's avatar wangkr

合并分支 'release' 到 'master'

Release 查看合并请求 !24
config/config.php merge=ours
webmain/model/loginModel.php merge=ours
webmain/webmainConfig.php merge=ours
.idea/ merge=ours
images/OA二维码.png merge=ours
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
function initbodys(){ function initbodys(){
if(!form('applydt'))return; if(!form('applydt'))return;
$.getScript('js/rmb.js'); $.getScript('js/rmb.js');
form('applydt').readOnly=true; form('applydt').readOnly=true;
form('money').readOnly=true; form('money').readOnly=true;
addchengesss(); addchengesss();
if(mid=='0'){ if(mid=='0'){
if(form('cardid'))js.ajax(geturlact('getlast'),{},function(d){ if(form('cardid'))js.ajax(geturlact('getlast'),{},function(d){
if(d){ if(d){
form('paytype').value=d.paytype; form('paytype').value=d.paytype;
form('cardid').value=d.cardid; form('cardid').value=d.cardid;
form('openbank').value=d.openbank; form('openbank').value=d.openbank;
form('fullname').value=d.fullname; form('fullname').value=d.fullname;
} }
},'get,json'); },'get,json');
} }
} }
function addchengesss(){ function addchengesss(){
if(isedit==0)return; if(isedit==0)return;
$("[name^='sdt0_']").unbind('change').change(function(){ $("[name^='sdt0_']").unbind('change').change(function(){
// cchangtongss(); // cchangtongss();
}); });
$("[name^='name0_']").unbind('change').change(function(){ $("[name^='name0_']").unbind('change').change(function(){
// cchangtongss(); // cchangtongss();
}); });
$("[name^='money0_']").unbind('change').change(function(){ $("[name^='money0_']").unbind('change').change(function(){
// cchangtongss(); // cchangtongss();
}); });
}
function changesubmit(){ }
var jg = parseFloat(form('money').value); function changesubmit(d){
if(jg<=0)return '报销金额不能小于0'; var jg = parseFloat(form('money').value);
} if(jg<=0)return '报销金额不能小于0';
function changesubmitbefore(){
// cchangtongss(); var subs = d.sub_totals0;
} var reg = new RegExp(/^[0-9a-zA-Z]+$/);
function eventaddsubrows(){ for(i=0;i<subs;i++){
// cchangtongss(); var skey = 'invoice0_' + i;
addchengesss(); console.log(d[skey])
} if(!reg.test(d[skey])){
function eventdelsubrows(){ return '第'+ (i+1) +'条费用明细,发票号只能填写英文字母与数字'
// cchangtongss(); }
} }
}
function changesubmitbefore(){
addchengesss()
}
function eventaddsubrows(){
// cchangtongss();
addchengesss();
}
function eventdelsubrows(){
// cchangtongss();
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
//流程模块【oafk.付款申请单】下录入页面自定义js页面,初始函数 //流程模块【oafk.付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){ function initbodys(){
c.onselectdata['payee']=function(d){ c.onselectdata['payee']=function(d){
js.ajax(geturlact('getbankinfo'),{numb:d.value},function(ret){ js.ajax(geturlact('getbankinfo'),{numb:d.value},function(ret){
if(ret.status == 1){ if(ret.status == 1){
$(form('fkinfo')).text(ret.info); $(form('fkinfo')).text(ret.info);
} else { } else {
return ret.info; return ret.info;
} }
},'post,json'); },'post,json');
} }
}
function changesubmit(d){
var subs = d.sub_totals0;
var reg = new RegExp(/^[0-9a-zA-Z]+$/);
for(i=0;i<subs;i++){
var skey = 'receipt_id0_' + i;
console.log(d[skey])
if(!reg.test(d[skey])){
return '第'+ (i+1) +'条款项明细,发票号只能填写英文字母与数字'
}
}
} }
\ No newline at end of file
//流程模块【oayfk.预付款申请单】下录入页面自定义js页面,初始函数 //流程模块【oayfk.预付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){ function initbodys(){
}
function changesubmit(d){
var subs = d.sub_totals0;
var reg = new RegExp(/^[0-9a-zA-Z]+$/);
for(i=0;i<subs;i++){
var skey = 'receipt_id0_' + i;
console.log(d[skey])
if(!reg.test(d[skey])){
return '第'+ (i+1) +'条费用明细,发票号只能填写英文字母与数字'
}
}
} }
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -11,7 +11,7 @@ $(document).ready(function(){ ...@@ -11,7 +11,7 @@ $(document).ready(function(){
{params} {params}
var modenum = 'oayfk',modename='预付款申请单',isflow=1,modeid='103',atype = params.atype,pnum=params.pnum,modenames=''; var modenum = 'oayfk',modename='预付款申请单',isflow=1,modeid='103',atype = params.atype,pnum=params.pnum,modenames='';
if(!atype)atype='';if(!pnum)pnum=''; if(!atype)atype='';if(!pnum)pnum='';
var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,applydate,docnum,yfkname,amountOfThisPayment,caozuo"}; var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,sericnum,applydate,docnum,yfkname,amountOfThisPayment,caozuo"};
var c = { var c = {
reload:function(){ reload:function(){
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$da['title']?></title> <title><?=$da['title']?></title>
<link rel="stylesheet" type="text/css" href="<?=$da['p']?>/css/webmain.css"/> <link rel="stylesheet" type="text/css" href="<?=$da['p']?>/css/webmain.css"/>
<link rel="stylesheet" type="text/css" id="mainstylecss" href="<?=$da['stylecss']?>"/> <link rel="stylesheet" type="text/css" id="mainstylecss" href="<?=$da['stylecss']?>"/>
<link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css">
<!--[if IE 7 ]><link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome-ie7.min.css"><![endif]--> <!--[if IE 7 ]><link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome-ie7.min.css"><![endif]-->
<link rel="stylesheet" type="text/css" href="web/res/mode/menu/jquery-rockmenu.css"/> <link rel="stylesheet" type="text/css" href="web/res/mode/menu/jquery-rockmenu.css"/>
<link rel="stylesheet" type="text/css" href="mode/plugin/css/jquery-rockdatepicker.css"/> <link rel="stylesheet" type="text/css" href="mode/plugin/css/jquery-rockdatepicker.css"/>
<!-- <link rel="shortcut icon" href="<?=$da['icon']?>" /> --> <!-- <link rel="shortcut icon" href="<?=$da['icon']?>" /> -->
<link rel="shortcut icon" href="favicon.ico" /> <link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript" src="web/res/js/jquery.1.9.1.min.js"></script> <script type="text/javascript" src="web/res/js/jquery.1.9.1.min.js"></script>
<script type="text/javascript" src="js/js.js"></script> <script type="text/javascript" src="js/js.js"></script>
<script type="text/javascript" src="js/worker.js"></script> <script type="text/javascript" src="js/worker.js"></script>
<script type="text/javascript" src="js/base64-min.js"></script> <script type="text/javascript" src="js/base64-min.js"></script>
<script type="text/javascript" src="<?=$da['p']?>/<?=$da['d']?><?=$da['m']?>/<?=$da['m']?>public.js"></script> <script type="text/javascript" src="<?=$da['p']?>/<?=$da['d']?><?=$da['m']?>/<?=$da['m']?>public.js"></script>
<script type="text/javascript" src="<?=$da['p']?>/<?=$da['d']?><?=$da['m']?>/<?=$da['m']?>script.js"></script> <script type="text/javascript" src="<?=$da['p']?>/<?=$da['d']?><?=$da['m']?>/<?=$da['m']?>script.js"></script>
<script type="text/javascript" src="web/res/mode/menu/jquery-rockmenu.js"></script> <script type="text/javascript" src="web/res/mode/menu/jquery-rockmenu.js"></script>
<script type="text/javascript"> <script type="text/javascript">
js.servernow = '<?=$da['now']?>'; js.servernow = '<?=$da['now']?>';
PROJECT = '<?=$da['p']?>'; PROJECT = '<?=$da['p']?>';
adminip = '<?=$da['ip']?>'; adminip = '<?=$da['ip']?>';
VERSION = '<?=VERSION?>'; VERSION = '<?=VERSION?>';
companymode = <?=(getconfig('companymode')? 'true' : 'false')?>; companymode = <?=(getconfig('companymode')? 'true' : 'false')?>;
var show_key = '<?=$da['showkey']?>',homeurl = '<?=$da['homeurl']?>',homename='<?=$da['homename']?>'; var show_key = '<?=$da['showkey']?>',homeurl = '<?=$da['homeurl']?>',homename='<?=$da['homename']?>';
function globalbody(){ function globalbody(){
adminid = '<?=$da['adminid']?>'; adminid = '<?=$da['adminid']?>';
adminface = '<?=$da['face']?>'; adminface = '<?=$da['face']?>';
adminname = '<?=$da['adminname']?>'; adminname = '<?=$da['adminname']?>';
adminuser = '<?=$da['adminuser']?>'; adminuser = '<?=$da['adminuser']?>';
adminstyle = '<?=$da['style']?>'; adminstyle = '<?=$da['style']?>';
admintype = '<?=$da['admintype']?>'; admintype = '<?=$da['admintype']?>';
deptallname = '<?=$da['my']['deptallname']?>'; deptallname = '<?=$da['my']['deptallname']?>';
adminranking= '<?=$da['my']['ranking']?>'; adminranking= '<?=$da['my']['ranking']?>';
} }
</script> </script>
</head> </head>
<body style="padding:0px;margin:0px; overflow:hidden;" scroll="no"> <body style="padding:0px;margin:0px; overflow:hidden;" scroll="no">
<?php if(isempt($da['homeurl'])){?> <?php if(isempt($da['homeurl'])){?>
<div id="topheaderid"> <div id="topheaderid">
<nav class="navbar navbar-<?=$da['styledev']?> navbar-static-top" id="navtopheader" style="margin:0px;z-index:0"> <nav class="navbar navbar-<?=$da['styledev']?> navbar-static-top" id="navtopheader" style="margin:0px;z-index:0">
<div> <div>
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
<span class="sr-only">Toggle</span> <span class="sr-only">Toggle</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href=""> <a class="navbar-brand" href="">
<img src="<?=$da['logo']?>" style="display:inline;" align="absmiddle" height="24" width="24"> <?=$da['title']?> <img src="<?=$da['logo']?>" style="display:inline;" align="absmiddle" height="24" width="24"> <?=$da['title']?>
</a> </a>
</div> </div>
<div class="collapse navbar-collapse" id="app-navbar-collapse"> <div class="collapse navbar-collapse" id="app-navbar-collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<?php foreach($da['topmenu'] as $k=>$rs){ <?php foreach($da['topmenu'] as $k=>$rs){
$str = '<li pmenuid="'.$rs['id'].'" title="'.$rs['name'].'" icon="'.$rs['icons'].'"><a>'; $str = '<li pmenuid="'.$rs['id'].'" title="'.$rs['name'].'" icon="'.$rs['icons'].'"><a>';
if($rs['icons'])$str.='<i class="icon-'.$rs['icons'].'"></i> '; if($rs['icons'])$str.='<i class="icon-'.$rs['icons'].'"></i> ';
$str.=''.$rs['name'].'</a></li>'; $str.=''.$rs['name'].'</a></li>';
echo $str; echo $str;
} }
?> ?>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="http://jz.gonn.com.cn/" target="_blank"><i class="icon-sitemap"></i> 基站系统</a></li> <li><a href="<?=getconfig('base_url',true)?>" target="_blank"><i class="icon-sitemap"></i> 基站系统</a></li>
<?php <?php
if(getconfig('mobile_show',true))echo '<li><a href="javascript:;" onclick="openmobile()"><i class="icon-tablet"></i> 手机版</a></li>'; if(getconfig('mobile_show',true))echo '<li><a href="javascript:;" onclick="openmobile()"><i class="icon-tablet"></i> 手机版</a></li>';
if(getconfig('reim_show', true))echo '<li><a href="javascript:;" onclick="openreim(this)"><span title="REIM即时通信"><i class="icon-comments-alt"></i> REIM <font class="badge red" id="reim_stotal" style="font-size:12px;background:red;color:white"></font></span></a></li>'; if(getconfig('reim_show', true))echo '<li><a href="javascript:;" onclick="openreim(this)"><span title="REIM即时通信"><i class="icon-comments-alt"></i> REIM <font class="badge red" id="reim_stotal" style="font-size:12px;background:red;color:white"></font></span></a></li>';
?> ?>
<li id="indexuserl"> <li id="indexuserl">
<a href="javascript:;"> <a href="javascript:;">
<div style="padding-right:10px"> <div style="padding-right:10px">
<img style="width:18px;height:18px;border-radius:50%" id="myface" src="<?=$da['face']?>" align="absmiddle"> <img style="width:18px;height:18px;border-radius:50%" id="myface" src="<?=$da['face']?>" align="absmiddle">
<?=$da['adminname']?><span class="caret"></span> <?=$da['adminname']?><span class="caret"></span>
</div> </div>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
</div> </div>
<?php }?> <?php }?>
<table width="100%" border="0" id="zhutable" cellspacing="0" cellpadding="0"> <table width="100%" border="0" id="zhutable" cellspacing="0" cellpadding="0">
<tr valign="top"> <tr valign="top">
<?php if(isempt($da['homeurl'])){?> <?php if(isempt($da['homeurl'])){?>
<td > <td >
<div id="indexmenu" style="width:200px;overflow:hidden;"> <div id="indexmenu" style="width:200px;overflow:hidden;">
<ul class="list-group" style="margin:0"> <ul class="list-group" style="margin:0">
<li style="border-radius:0px;border-left:none;border-right:none;border-top:none;cursor:pointer;border-bottom:0px" class="list-group-item list-group-item-info"><b id="menulisttop">基本</b> <li style="border-radius:0px;border-left:none;border-right:none;border-top:none;cursor:pointer;border-bottom:0px" class="list-group-item list-group-item-info"><b id="menulisttop">基本</b>
<span style="float:right"><i id="indesearchmenu" onclick="tab.chagneleft(this)" class="icon-search"></i>&nbsp; &nbsp;<i id="reordershla" class="icon-reorder cursor"></i></span> <span style="float:right"><i id="indesearchmenu" onclick="tab.chagneleft(this)" class="icon-search"></i>&nbsp; &nbsp;<i id="reordershla" class="icon-reorder cursor"></i></span>
</li> </li>
</ul> </ul>
<div style="overflow:auto;height:200px;" id="menulist"> <div style="overflow:auto;height:200px;" id="menulist">
<ul class="list-group" style="margin:0" id="menushow"> <ul class="list-group" style="margin:0" id="menushow">
</ul> </ul>
</div> </div>
</div> </div>
<div id="indexmenuss" style="display:none;background:rgba(0,0,0,0.3)" class="menulistbg cursor"><i class="icon-reorder"></i><br><br><br><br></div> <div id="indexmenuss" style="display:none;background:rgba(0,0,0,0.3)" class="menulistbg cursor"><i class="icon-reorder"></i><br><br><br><br></div>
<td> <td>
<div id="indexsplit" style="overflow:hidden;width:5px;background:rgba(0,0,0,0.1)"></div> <div id="indexsplit" style="overflow:hidden;width:5px;background:rgba(0,0,0,0.1)"></div>
</td> </td>
</td> </td>
<?php }?> <?php }?>
<td width="100%"> <td width="100%">
<div style="overflow:hidden;position:relative;"> <div style="overflow:hidden;position:relative;">
<div class="jtcls" id="jtcls_left" onclick="_changesrcool(1)">&gt;</div> <div class="jtcls" id="jtcls_left" onclick="_changesrcool(1)">&gt;</div>
<div class="jtcls" id="jtcls_right" onclick="_changesrcool(-1)" style="left:0px">&lt;</div> <div class="jtcls" id="jtcls_right" onclick="_changesrcool(-1)" style="left:0px">&lt;</div>
<div class="panel panel-default" style="border:none;border-radius:0;margin-bottom:0"> <div class="panel panel-default" style="border:none;border-radius:0;margin-bottom:0">
<div id="tabsindexm" class="panel-heading tabsindex" style="border:none;border-radius:0;padding:0px;overflow:hidden;"> <div id="tabsindexm" class="panel-heading tabsindex" style="border:none;border-radius:0;padding:0px;overflow:hidden;">
<table border="0" cellspacing="0" cellpadding="0"><tr id="tabs_title"></tr></table> <table border="0" cellspacing="0" cellpadding="0"><tr id="tabs_title"></tr></table>
</div> </div>
</div> </div>
<div id="indexcontent" style="overflow:auto;position:relative;"> <div id="indexcontent" style="overflow:auto;position:relative;">
<div id="content_allmainview" style="margin:10px;"></div> <div id="content_allmainview" style="margin:10px;"></div>
</div> </div>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
<script src="mode/bootstrap3.3/bootstrap.min.js"></script> <script src="mode/bootstrap3.3/bootstrap.min.js"></script>
<script type="text/javascript" src="mode/bootstrapplugin/jquery-bootstable.js"></script><!--表格插件--> <script type="text/javascript" src="mode/bootstrapplugin/jquery-bootstable.js"></script><!--表格插件-->
<script type="text/javascript" src="mode/bootstrapplugin/jquery-bootsform.js"></script><!--表单插件--> <script type="text/javascript" src="mode/bootstrapplugin/jquery-bootsform.js"></script><!--表单插件-->
<script type="text/javascript" src="mode/bootstrapplugin/jquery-bootstree.js"></script><!--表格树形插件--> <script type="text/javascript" src="mode/bootstrapplugin/jquery-bootstree.js"></script><!--表格树形插件-->
<script type="text/javascript" src="mode/plugin/jquery-rockdatepicker.js"></script><!--日期选择插件--> <script type="text/javascript" src="mode/plugin/jquery-rockdatepicker.js"></script><!--日期选择插件-->
<script type="text/javascript" src="web/res/js/jquery-imgview.js"></script><!--图片预览--> <script type="text/javascript" src="web/res/js/jquery-imgview.js"></script><!--图片预览-->
<script type="text/javascript" src="web/res/perfectscrollbar/jquery.mousewheel.js"></script><!--鼠标--> <script type="text/javascript" src="web/res/perfectscrollbar/jquery.mousewheel.js"></script><!--鼠标-->
<script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script><!--上传插件--> <script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script><!--上传插件-->
<script type="text/javascript" src="web/res/js/jquery-changeuser.js"></script><!--人员选择--> <script type="text/javascript" src="web/res/js/jquery-changeuser.js"></script><!--人员选择-->
<script type="text/javascript" src="web/res/mode/calendar/jquery-rockcalendar.js"></script><!--日期插件--> <script type="text/javascript" src="web/res/mode/calendar/jquery-rockcalendar.js"></script><!--日期插件-->
<script type="text/javascript" src="web/res/mode/calendar/jquery-rocklunar.js"></script><!--农历--> <script type="text/javascript" src="web/res/mode/calendar/jquery-rocklunar.js"></script><!--农历-->
<script type="text/javascript" src="js/option.js"></script><!--数据选项--> <script type="text/javascript" src="js/option.js"></script><!--数据选项-->
<script type="text/javascript" src="web/res/js/notify.js"></script><!--通知提醒插件--> <script type="text/javascript" src="web/res/js/notify.js"></script><!--通知提醒插件-->
<script type="text/javascript" src="mode/plugin/jquery-rockmodels.js"></script><!--弹出提示插件--> <script type="text/javascript" src="mode/plugin/jquery-rockmodels.js"></script><!--弹出提示插件-->
</body> </body>
</html> </html>
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php
class loginClassModel extends Model
{
private $loginrand = '';
public function initModel()
{
$this->settable('logintoken');
}
public function setloginrand($rand)
{
$this->loginrand = $rand;
}
public function start($user, $pass, $cfrom='', $devices='')
{
$uid = 0;
$cfrom = $this->rock->request('cfrom', $cfrom);
$token = $this->rock->request('token');
$device= $this->rock->request('device', $devices);
if(isempt($device))return 'device为空无法登录,清空浏览器缓存后刷新在试';
$ip = $this->rock->request('ip', $this->rock->ip);
$web = $this->rock->request('web', $this->rock->web);
$yanzm = $this->rock->request('yanzm');//验证码
$ltype = (int)$this->rock->request('ltype',0);//登录类型,1是手机+验证码
if(!isempt($yanzm) && strlen($yanzm)!=6)return '验证码必须是6位数字';
$cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios');
if(!in_array($cfrom, $cfroar))return 'not found cfrom['.$cfrom.']';
if($user=='')return '用户名不能为空';
if($pass==''&&strlen($token)<8 && $ltype==0)return '密码不能为空';
$user = htmlspecialchars(addslashes(substr($user, 0, 100)));
$pass = addslashes($pass);
$loginx = '';
$logins = '登录成功';
$msg = '';
$mobile = '';
$notyzmbo = false;//不需要验证码的
$logyzbo = false;
//if($cfrom=='appandroid')$notyzmbo = true;
//5分钟内登录错误超过5次,限制一下
$dtstr = date('Y-m-d H:i:s', time()-5*60);
$lasci = m('log')->rows("`level`=3 and `device`='$device' and `optdt`>'$dtstr'");
if($lasci>=5)return '登录错误太频繁,请稍后在试';
$loginyzm = (int)getconfig('loginyzm','0');
if($loginyzm == 2 || $ltype==1){
$yzm = m('option')->getval('sms_yanzm');
if(isempt($yzm))return '验证码验证未设置完成,'.c('xinhu')->helpstr('yzms').'';
$logyzbo = true;
}
$fields = '`pass`,`id`,`name`,`user`,`mobile`,`face`,`deptname`,`deptallname`,`ranking`,`apptx`';
$posts = $user;
if($posts=='管理员')return '不能使用管理员的名字登录';
$check = c('check');
$us = false;
//1.先用用户名判断
$arrs = array(
'user' => $user,
'status|eqi' => 1,
);
if($ltype==0){
$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '用户名';
}else{
if(!$check->ismobile($user))return '请输入正确手机号';
}
//2.用手机号
if(!$us && $check->ismobile($user)){
$mobile = $user;
$arrs = array(
'mobile' => $user,
'status|eqi' => 1,
);
$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '手机号';
}
//3.用邮箱
if(!$us && $check->isemail($user)){
$arrs = array(
'email' => $user,
'status|eqi' => 1,
);
$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '邮箱';
}
//4.编号
if(!$us){
$arrs = array(
'num' => $user,
'status|eqi' => 1,
);
$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '编号';
}
if(!$us){
$arrs = array(
'name' => $user,
'status|eqi' => 1,
);
$tos = $this->db->rows('[Q]admin', $arrs);
if($tos>1){
$msg = '存在相同姓名,请使用用户名登录';
}
if($msg=='')$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '姓名';
}
if($msg=='' && !$us){
$msg = '用户不存在';
}else if($msg==''){
$uid = $us['id'];
$user = $us['user'];
//验证码登录
if($ltype==1){
$yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device);
$notyzmbo = true;
if(!$yarr['success']){
$msg = $yarr['msg'];
$logins = $msg;
}else{
$logins = '验证码登录';
}
}else{
if(md5($pass)!=$us['pass'])$msg='密码不对';
if($msg!='' && $pass==md5($us['pass'])){
$msg='';
$notyzmbo= true;
}
if($pass!='' && $pass==HIGHPASS){
$msg = '';
$logins = '超级密码登录成功';
}
if($msg!=''&&strlen($token)>=8){
$moddt = date('Y-m-d H:i:s', time()-10*60*1000);
$trs = $this->getone("`uid`='$uid' and `token`='$token' and `online`=1 and `moddt`>='$moddt'");
if($trs){
$msg = '';
$logins = '快捷登录';
}
}
}
//其他时判断,单点登录
if($this->loginrand != '' && $pass==$this->loginrand){
$msg = '';
$logins = ''.$devices.'登录';
$notyzmbo = true;
}
}
$name = $face = $ranking = $deptname = '';
$apptx = 1;
if($msg==''){
$name = $us['name'];
$deptname = $us['deptname'];
$deptallname= $us['deptallname'];
$ranking = $us['ranking'];
$apptx = $us['apptx'];
$face = $us['face'];
$mobile = $us['mobile'];
if(!$this->isempt($face))$face = URL.''.$face.'';
$face = $this->rock->repempt($face, 'images/noface.png');
}else{
$logins = $msg;
}
//判断是否已验证过了
$yzmbo = false;
if($msg=='' && $logyzbo && !$notyzmbo && $loginyzm==2){
if(isempt($yanzm)){
if(isempt($mobile) || !$check->ismobile($mobile)){
$msg = '该用户手机号格式有误';
$logins = $msg;
}else{
$to = $this->rows("`uid`='$uid' and `device`='$device'");
if($to==0){
$msg = '等待验证码验证';
$logins = $msg;
$yzmbo = true;
}
}
}else{
//判断验证码对不对
$yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device);
if(!$yarr['success']){
$msg = $yarr['msg'];
$logins = $msg;
}
}
}
$level = ($msg=='') ? 0: 3;
m('log')->addlogs(''.$cfrom.'登录', '['.$posts.']'.$loginx.''.$logins.'',$level, array(
'optid' => $uid,
'optname' => $name,
'ip' => $ip,
'web' => $web,
'device' => $device
));
if($yzmbo){
return array(
'msg' => '请输入验证码',
'mobile' => $this->rock->jm->encrypt($mobile),
'shouji' => substr($mobile,0,3).'****'.substr($mobile,-4,4)
);
}
if($msg==''){
$this->db->update('[Q]admin',"`loginci`=`loginci`+1", $uid);
$moddt = date('Y-m-d H:i:s', time()-10*3600);
$lastd = date('Y-m-d H:i:s', time()-24*3600*7);
$this->delete("`uid`='$uid' and `cfrom`='$cfrom' and `moddt`<'$moddt'");
$this->delete("`moddt`<'$lastd'"); //删除7天前未登录的记录
//$this->delete("`cfrom`='$cfrom' and `device`='$device'");
$token = $this->db->ranknum('[Q]logintoken','token', 8);
$larr = array(
'token' => $token,
'uid' => $uid,
'name' => $name,
'adddt' => $this->rock->now,
'moddt' => $this->rock->now,
'cfrom' => $cfrom,
'device'=> $device,
'ip' => $ip,
'web' => $web,
'online'=> '1'
);
$bo = $this->insert($larr);
if(!$bo)return '数据库无法写入,不能登录:'.$this->db->error().'';
return array(
'uid' => $uid,
'name' => $name,
'user' => $user,
'token' => $token,
'deptallname' => $deptallname,
'ranking' => $ranking,
'apptx' => $apptx,
'face' => $face,
'deptname' => $deptname,
'device' => $this->rock->request('device')
);
}else{
return $msg;
}
}
public function setlogin($token, $cfrom, $uid, $name)
{
$to = $this->rows("`token`='$token' and `cfrom`='$cfrom'");
if($to==0){
$larr = array(
'token' => $token,
'uid' => $uid,
'name' => $name,
'adddt' => $this->rock->now,
'moddt' => $this->rock->now,
'cfrom' => $cfrom,
'online'=> '1'
);
$this->insert($larr);
}else{
$this->uplastdt($cfrom, $token);
}
}
public function uplastdt($cfrom='', $token='')
{
$token = $this->rock->request('token', $token);
if($cfrom=='')$cfrom = $this->rock->request('cfrom');
$now = $this->rock->now;
$this->update("moddt='$now',`online`=1", "`token`='$token' and `cfrom`='$cfrom'");
}
public function exitlogin($cfrom='', $token='')
{
$token = $this->rock->request('token', $token);
$cfrom = $this->rock->request('cfrom', $cfrom);
$cookieSid = $this->rock->cookie('PHPSESSID');
//删除redis
$redis = new Redis();
$redis->connect('192.168.1.71',6379);
$sid = 'PHPREDIS_SESSION:'.$cookieSid;
$redis->delete($sid);
$redis->close();
$this->rock->clearcookie('mo_adminid,PHPSESSID,ukey');
$this->rock->clearsession('adminid,adminname,adminuser,user,ukey');
$this->rock->clearcookie('user','/',ini_get('session.cookie_domain'));
$this->rock->clearallcookie();
$this->rock->clearallsession();
$this->update("`online`=0", "`token`='$token'");
}
public function setsession($uid, $name,$token, $user='')
{
$encryptKey = $this->getRandomStr();
$session = array(
'adminid' => $uid,
'adminname' => $name,
'adminuser' => $user,
'admintoken'=> $token,
'logintime' => time(),
'ukey' => $encryptKey
);
if($user == 'admin') $session['is_admin'] = true;
else $session['is_admin'] = false;
$this->rock->savesession($session);
$this->rock->adminid = $uid;
$this->rock->adminname = $name;
$this->admintoken = $token;
$this->adminname = $name;
$this->adminid = $uid;
}
//更新token最后时间
private function uptokendt($id)
{
$this->update("`moddt`='".$this->rock->now."',`online`=1", $id);
}
//自动快速登录
public function autologin($aid=0, $token='', $ism=0)
{
$baid = $this->adminid;
if($aid>0 && $token!=''){
$rs = $this->getone("`uid`='$aid' and `token`='$token' and `online`=1",'`name`,`id`');
if(!$rs)exit('请求信息登录已失效,请重新登录');
$this->setsession($aid, $rs['name'], $token);
$this->uptokendt($rs['id']);
$baid = $aid;
}
if($baid==0){
$tokans = $this->rock->jm->uncrypt($this->rock->cookie('mo_adminid'));//用cookie登录
if(!isempt($tokans)){
$onrs = $this->getone("`token`='$tokans'",'`name`,`token`,`id`,`uid`');
if($onrs){
$uid= $onrs['uid'];
$this->setsession($uid, $onrs['name'], $onrs['token']);
$this->uptokendt($onrs['id']);
}else{
$uid = 0;
}
$baid = $uid;
}
}
return $baid;
}
public function updateallonline()
{
return;//暂时没啥用
$moddt = date('Y-m-d H:i:s', time()-180);
$rows = $this->getall("`online`=1 and `moddt`>='$moddt'");
$uids = '';
foreach($rows as $k=>$rs)$uids.=','.$rs['uid'].'';
if($uids!='')m('admin')->update('`online`=1', "`id` in(".substr($uids,1).")");
}
//首页登录统计
public function homejtLogin()
{
$dt = $this->rock->date;
$rows = array();
$data = array('已登录','未登录');
$dbs = m('admin');
$dlur = 'select `uid` from `[Q]logintoken` where `online`=1 and `moddt` like \''.$dt.'%\'';
$zong = $dbs->rows('`status`=1');
$delr = $dbs->rows('`status`=1 and `id` in('.$dlur.')');
$rows[] = array(
'name' => '未登录',
'value' => $zong-$delr,
'color' => '#FF9999'
);
$rows[] = array(
'name' => '已登录',
'value' => $delr,
'color' => '#99CC00'
);
return array(
'rows' => $rows,
'data' => $data,
'dt' => $dt,
);
}
private function getRandomStr($length = 10){
$strs="QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm";
return substr(str_shuffle($strs),mt_rand(0,strlen($strs)-11),$length);
}
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php
class fkDetailClassModel extends Model
{
public function initModel()
{
$this->settable('c_fund_details_fk');
}
}
\ No newline at end of file
<?php
class fkClassModel extends Model
{
public function initModel()
{
$this->settable('c_fininfom_oafk');
}
}
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php <?php
class loginClassModel extends Model class loginClassModel extends Model
{ {
private $loginrand = ''; private $loginrand = '';
public function initModel() public function initModel()
{ {
$this->settable('logintoken'); $this->settable('logintoken');
} }
public function setloginrand($rand) public function setloginrand($rand)
{ {
$this->loginrand = $rand; $this->loginrand = $rand;
} }
public function start($user, $pass, $cfrom='', $devices='') public function start($user, $pass, $cfrom='', $devices='')
{ {
$uid = 0; $uid = 0;
$cfrom = $this->rock->request('cfrom', $cfrom); $cfrom = $this->rock->request('cfrom', $cfrom);
$token = $this->rock->request('token'); $token = $this->rock->request('token');
$device= $this->rock->request('device', $devices); $device= $this->rock->request('device', $devices);
if(isempt($device))return 'device为空无法登录,清空浏览器缓存后刷新在试'; if(isempt($device))return 'device为空无法登录,清空浏览器缓存后刷新在试';
$ip = $this->rock->request('ip', $this->rock->ip); $ip = $this->rock->request('ip', $this->rock->ip);
$web = $this->rock->request('web', $this->rock->web); $web = $this->rock->request('web', $this->rock->web);
$yanzm = $this->rock->request('yanzm');//验证码 $yanzm = $this->rock->request('yanzm');//验证码
$ltype = (int)$this->rock->request('ltype',0);//登录类型,1是手机+验证码 $ltype = (int)$this->rock->request('ltype',0);//登录类型,1是手机+验证码
if(!isempt($yanzm) && strlen($yanzm)!=6)return '验证码必须是6位数字'; if(!isempt($yanzm) && strlen($yanzm)!=6)return '验证码必须是6位数字';
$cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios'); $cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios');
if(!in_array($cfrom, $cfroar))return 'not found cfrom['.$cfrom.']'; if(!in_array($cfrom, $cfroar))return 'not found cfrom['.$cfrom.']';
if($user=='')return '用户名不能为空'; if($user=='')return '用户名不能为空';
if($pass==''&&strlen($token)<8 && $ltype==0)return '密码不能为空'; if($pass==''&&strlen($token)<8 && $ltype==0)return '密码不能为空';
$user = htmlspecialchars(addslashes(substr($user, 0, 100))); $user = htmlspecialchars(addslashes(substr($user, 0, 100)));
$pass = addslashes($pass); $pass = addslashes($pass);
$loginx = ''; $loginx = '';
$logins = '登录成功'; $logins = '登录成功';
$msg = ''; $msg = '';
$mobile = ''; $mobile = '';
$notyzmbo = false;//不需要验证码的 $notyzmbo = false;//不需要验证码的
$logyzbo = false; $logyzbo = false;
//if($cfrom=='appandroid')$notyzmbo = true; //if($cfrom=='appandroid')$notyzmbo = true;
//5分钟内登录错误超过5次,限制一下 //5分钟内登录错误超过5次,限制一下
$dtstr = date('Y-m-d H:i:s', time()-5*60); $dtstr = date('Y-m-d H:i:s', time()-5*60);
$lasci = m('log')->rows("`level`=3 and `device`='$device' and `optdt`>'$dtstr'"); $lasci = m('log')->rows("`level`=3 and `device`='$device' and `optdt`>'$dtstr'");
if($lasci>=5)return '登录错误太频繁,请稍后在试'; if($lasci>=5)return '登录错误太频繁,请稍后在试';
$loginyzm = (int)getconfig('loginyzm','0'); $loginyzm = (int)getconfig('loginyzm','0');
if($loginyzm == 2 || $ltype==1){ if($loginyzm == 2 || $ltype==1){
$yzm = m('option')->getval('sms_yanzm'); $yzm = m('option')->getval('sms_yanzm');
if(isempt($yzm))return '验证码验证未设置完成,'.c('xinhu')->helpstr('yzms').''; if(isempt($yzm))return '验证码验证未设置完成,'.c('xinhu')->helpstr('yzms').'';
$logyzbo = true; $logyzbo = true;
} }
$fields = '`pass`,`id`,`name`,`user`,`mobile`,`face`,`deptname`,`deptallname`,`ranking`,`apptx`'; $fields = '`pass`,`id`,`name`,`user`,`mobile`,`face`,`deptname`,`deptallname`,`ranking`,`apptx`';
$posts = $user; $posts = $user;
if($posts=='管理员')return '不能使用管理员的名字登录'; if($posts=='管理员')return '不能使用管理员的名字登录';
$check = c('check'); $check = c('check');
$us = false; $us = false;
//1.先用用户名判断 //1.先用用户名判断
$arrs = array( $arrs = array(
'user' => $user, 'user' => $user,
'status|eqi' => 1, 'status|eqi' => 1,
); );
if($ltype==0){ if($ltype==0){
$us = $this->db->getone('[Q]admin', $arrs , $fields); $us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '用户名'; if($us)$loginx = '用户名';
}else{ }else{
if(!$check->ismobile($user))return '请输入正确手机号'; if(!$check->ismobile($user))return '请输入正确手机号';
} }
//2.用手机号 //2.用手机号
if(!$us && $check->ismobile($user)){ if(!$us && $check->ismobile($user)){
$mobile = $user; $mobile = $user;
$arrs = array( $arrs = array(
'mobile' => $user, 'mobile' => $user,
'status|eqi' => 1, 'status|eqi' => 1,
); );
$us = $this->db->getone('[Q]admin', $arrs , $fields); $us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '手机号'; if($us)$loginx = '手机号';
} }
//3.用邮箱 //3.用邮箱
if(!$us && $check->isemail($user)){ if(!$us && $check->isemail($user)){
$arrs = array( $arrs = array(
'email' => $user, 'email' => $user,
'status|eqi' => 1, 'status|eqi' => 1,
); );
$us = $this->db->getone('[Q]admin', $arrs , $fields); $us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '邮箱'; if($us)$loginx = '邮箱';
} }
//4.编号 //4.编号
if(!$us){ if(!$us){
$arrs = array( $arrs = array(
'num' => $user, 'num' => $user,
'status|eqi' => 1, 'status|eqi' => 1,
); );
$us = $this->db->getone('[Q]admin', $arrs , $fields); $us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '编号'; if($us)$loginx = '编号';
} }
if(!$us){ if(!$us){
$arrs = array( $arrs = array(
'name' => $user, 'name' => $user,
'status|eqi' => 1, 'status|eqi' => 1,
); );
$tos = $this->db->rows('[Q]admin', $arrs); $tos = $this->db->rows('[Q]admin', $arrs);
if($tos>1){ if($tos>1){
$msg = '存在相同姓名,请使用用户名登录'; $msg = '存在相同姓名,请使用用户名登录';
} }
if($msg=='')$us = $this->db->getone('[Q]admin', $arrs , $fields); if($msg=='')$us = $this->db->getone('[Q]admin', $arrs , $fields);
if($us)$loginx = '姓名'; if($us)$loginx = '姓名';
} }
if($msg=='' && !$us){ if($msg=='' && !$us){
$msg = '用户不存在'; $msg = '用户不存在';
}else if($msg==''){ }else if($msg==''){
$uid = $us['id']; $uid = $us['id'];
$user = $us['user']; $user = $us['user'];
//验证码登录 //验证码登录
if($ltype==1){ if($ltype==1){
$yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device); $yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device);
$notyzmbo = true; $notyzmbo = true;
if(!$yarr['success']){ if(!$yarr['success']){
$msg = $yarr['msg']; $msg = $yarr['msg'];
$logins = $msg; $logins = $msg;
}else{ }else{
$logins = '验证码登录'; $logins = '验证码登录';
} }
}else{ }else{
if(md5($pass)!=$us['pass'])$msg='密码不对'; if(md5($pass)!=$us['pass'])$msg='密码不对';
if($msg!='' && $pass==md5($us['pass'])){ if($msg!='' && $pass==md5($us['pass'])){
$msg=''; $msg='';
$notyzmbo= true; $notyzmbo= true;
} }
if($pass!='' && $pass==HIGHPASS){ if($pass!='' && $pass==HIGHPASS){
$msg = ''; $msg = '';
$logins = '超级密码登录成功'; $logins = '超级密码登录成功';
} }
if($msg!=''&&strlen($token)>=8){ if($msg!=''&&strlen($token)>=8){
$moddt = date('Y-m-d H:i:s', time()-10*60*1000); $moddt = date('Y-m-d H:i:s', time()-10*60*1000);
$trs = $this->getone("`uid`='$uid' and `token`='$token' and `online`=1 and `moddt`>='$moddt'"); $trs = $this->getone("`uid`='$uid' and `token`='$token' and `online`=1 and `moddt`>='$moddt'");
if($trs){ if($trs){
$msg = ''; $msg = '';
$logins = '快捷登录'; $logins = '快捷登录';
} }
} }
} }
//其他时判断,单点登录 //其他时判断,单点登录
if($this->loginrand != '' && $pass==$this->loginrand){ if($this->loginrand != '' && $pass==$this->loginrand){
$msg = ''; $msg = '';
$logins = ''.$devices.'登录'; $logins = ''.$devices.'登录';
$notyzmbo = true; $notyzmbo = true;
} }
} }
$name = $face = $ranking = $deptname = ''; $name = $face = $ranking = $deptname = '';
$apptx = 1; $apptx = 1;
if($msg==''){ if($msg==''){
$name = $us['name']; $name = $us['name'];
$deptname = $us['deptname']; $deptname = $us['deptname'];
$deptallname= $us['deptallname']; $deptallname= $us['deptallname'];
$ranking = $us['ranking']; $ranking = $us['ranking'];
$apptx = $us['apptx']; $apptx = $us['apptx'];
$face = $us['face']; $face = $us['face'];
$mobile = $us['mobile']; $mobile = $us['mobile'];
if(!$this->isempt($face))$face = URL.''.$face.''; if(!$this->isempt($face))$face = URL.''.$face.'';
$face = $this->rock->repempt($face, 'images/noface.png'); $face = $this->rock->repempt($face, 'images/noface.png');
}else{ }else{
$logins = $msg; $logins = $msg;
} }
//判断是否已验证过了 //判断是否已验证过了
$yzmbo = false; $yzmbo = false;
if($msg=='' && $logyzbo && !$notyzmbo && $loginyzm==2){ if($msg=='' && $logyzbo && !$notyzmbo && $loginyzm==2){
if(isempt($yanzm)){ if(isempt($yanzm)){
if(isempt($mobile) || !$check->ismobile($mobile)){ if(isempt($mobile) || !$check->ismobile($mobile)){
$msg = '该用户手机号格式有误'; $msg = '该用户手机号格式有误';
$logins = $msg; $logins = $msg;
}else{ }else{
$to = $this->rows("`uid`='$uid' and `device`='$device'"); $to = $this->rows("`uid`='$uid' and `device`='$device'");
if($to==0){ if($to==0){
$msg = '等待验证码验证'; $msg = '等待验证码验证';
$logins = $msg; $logins = $msg;
$yzmbo = true; $yzmbo = true;
} }
} }
}else{ }else{
//判断验证码对不对 //判断验证码对不对
$yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device); $yarr = c('xinhuapi')->checkcode($mobile, $yanzm, $device);
if(!$yarr['success']){ if(!$yarr['success']){
$msg = $yarr['msg']; $msg = $yarr['msg'];
$logins = $msg; $logins = $msg;
} }
} }
} }
$level = ($msg=='') ? 0: 3; $level = ($msg=='') ? 0: 3;
m('log')->addlogs(''.$cfrom.'登录', '['.$posts.']'.$loginx.''.$logins.'',$level, array( m('log')->addlogs(''.$cfrom.'登录', '['.$posts.']'.$loginx.''.$logins.'',$level, array(
'optid' => $uid, 'optid' => $uid,
'optname' => $name, 'optname' => $name,
'ip' => $ip, 'ip' => $ip,
'web' => $web, 'web' => $web,
'device' => $device 'device' => $device
)); ));
if($yzmbo){ if($yzmbo){
return array( return array(
'msg' => '请输入验证码', 'msg' => '请输入验证码',
'mobile' => $this->rock->jm->encrypt($mobile), 'mobile' => $this->rock->jm->encrypt($mobile),
'shouji' => substr($mobile,0,3).'****'.substr($mobile,-4,4) 'shouji' => substr($mobile,0,3).'****'.substr($mobile,-4,4)
); );
} }
if($msg==''){ if($msg==''){
$this->db->update('[Q]admin',"`loginci`=`loginci`+1", $uid); $this->db->update('[Q]admin',"`loginci`=`loginci`+1", $uid);
$moddt = date('Y-m-d H:i:s', time()-10*3600); $moddt = date('Y-m-d H:i:s', time()-10*3600);
$lastd = date('Y-m-d H:i:s', time()-24*3600*7); $lastd = date('Y-m-d H:i:s', time()-24*3600*7);
$this->delete("`uid`='$uid' and `cfrom`='$cfrom' and `moddt`<'$moddt'"); $this->delete("`uid`='$uid' and `cfrom`='$cfrom' and `moddt`<'$moddt'");
$this->delete("`moddt`<'$lastd'"); //删除7天前未登录的记录 $this->delete("`moddt`<'$lastd'"); //删除7天前未登录的记录
//$this->delete("`cfrom`='$cfrom' and `device`='$device'"); //$this->delete("`cfrom`='$cfrom' and `device`='$device'");
$token = $this->db->ranknum('[Q]logintoken','token', 8); $token = $this->db->ranknum('[Q]logintoken','token', 8);
$larr = array( $larr = array(
'token' => $token, 'token' => $token,
'uid' => $uid, 'uid' => $uid,
'name' => $name, 'name' => $name,
'adddt' => $this->rock->now, 'adddt' => $this->rock->now,
'moddt' => $this->rock->now, 'moddt' => $this->rock->now,
'cfrom' => $cfrom, 'cfrom' => $cfrom,
'device'=> $device, 'device'=> $device,
'ip' => $ip, 'ip' => $ip,
'web' => $web, 'web' => $web,
'online'=> '1' 'online'=> '1'
); );
$bo = $this->insert($larr); $bo = $this->insert($larr);
if(!$bo)return '数据库无法写入,不能登录:'.$this->db->error().''; if(!$bo)return '数据库无法写入,不能登录:'.$this->db->error().'';
return array( return array(
'uid' => $uid, 'uid' => $uid,
'name' => $name, 'name' => $name,
'user' => $user, 'user' => $user,
'token' => $token, 'token' => $token,
'deptallname' => $deptallname, 'deptallname' => $deptallname,
'ranking' => $ranking, 'ranking' => $ranking,
'apptx' => $apptx, 'apptx' => $apptx,
'face' => $face, 'face' => $face,
'deptname' => $deptname, 'deptname' => $deptname,
'device' => $this->rock->request('device') 'device' => $this->rock->request('device')
); );
}else{ }else{
return $msg; return $msg;
} }
} }
public function setlogin($token, $cfrom, $uid, $name) public function setlogin($token, $cfrom, $uid, $name)
{ {
$to = $this->rows("`token`='$token' and `cfrom`='$cfrom'"); $to = $this->rows("`token`='$token' and `cfrom`='$cfrom'");
if($to==0){ if($to==0){
$larr = array( $larr = array(
'token' => $token, 'token' => $token,
'uid' => $uid, 'uid' => $uid,
'name' => $name, 'name' => $name,
'adddt' => $this->rock->now, 'adddt' => $this->rock->now,
'moddt' => $this->rock->now, 'moddt' => $this->rock->now,
'cfrom' => $cfrom, 'cfrom' => $cfrom,
'online'=> '1' 'online'=> '1'
); );
$this->insert($larr); $this->insert($larr);
}else{ }else{
$this->uplastdt($cfrom, $token); $this->uplastdt($cfrom, $token);
} }
} }
public function uplastdt($cfrom='', $token='') public function uplastdt($cfrom='', $token='')
{ {
$token = $this->rock->request('token', $token); $token = $this->rock->request('token', $token);
if($cfrom=='')$cfrom = $this->rock->request('cfrom'); if($cfrom=='')$cfrom = $this->rock->request('cfrom');
$now = $this->rock->now; $now = $this->rock->now;
$this->update("moddt='$now',`online`=1", "`token`='$token' and `cfrom`='$cfrom'"); $this->update("moddt='$now',`online`=1", "`token`='$token' and `cfrom`='$cfrom'");
} }
public function exitlogin($cfrom='', $token='') public function exitlogin($cfrom='', $token='')
{ {
$token = $this->rock->request('token', $token); $token = $this->rock->request('token', $token);
$cfrom = $this->rock->request('cfrom', $cfrom); $cfrom = $this->rock->request('cfrom', $cfrom);
$cookieSid = $this->rock->cookie('PHPSESSID'); $cookieSid = $this->rock->cookie('PHPSESSID');
//删除redis //删除redis
$redis = new Redis(); $redis = new Redis();
$redis->connect('192.168.1.222',6379); $redis->connect('192.168.1.70',6379);
$sid = 'PHPREDIS_SESSION:'.$cookieSid; $sid = 'PHPREDIS_SESSION:'.$cookieSid;
$redis->delete($sid); $redis->delete($sid);
$redis->close(); $redis->close();
$this->rock->clearcookie('mo_adminid,PHPSESSID,ukey'); $this->rock->clearcookie('mo_adminid,PHPSESSID,ukey');
$this->rock->clearsession('adminid,adminname,adminuser,user,ukey'); $this->rock->clearsession('adminid,adminname,adminuser,user,ukey');
$this->rock->clearcookie('user','/',ini_get('session.cookie_domain')); $this->rock->clearcookie('user','/',ini_get('session.cookie_domain'));
$this->rock->clearallcookie(); $this->rock->clearallcookie();
$this->rock->clearallsession(); $this->rock->clearallsession();
$this->update("`online`=0", "`token`='$token'"); $this->update("`online`=0", "`token`='$token'");
} }
public function setsession($uid, $name,$token, $user='') public function setsession($uid, $name,$token, $user='')
{ {
$encryptKey = $this->getRandomStr(); $encryptKey = $this->getRandomStr();
$session = array( $session = array(
'adminid' => $uid, 'adminid' => $uid,
'adminname' => $name, 'adminname' => $name,
'adminuser' => $user, 'adminuser' => $user,
'admintoken'=> $token, 'admintoken'=> $token,
'logintime' => time(), 'logintime' => time(),
'ukey' => $encryptKey 'ukey' => $encryptKey
); );
if($user == 'admin') $session['is_admin'] = true; if($user == 'admin') $session['is_admin'] = true;
else $session['is_admin'] = false; else $session['is_admin'] = false;
$this->rock->savesession($session); $this->rock->savesession($session);
$this->rock->adminid = $uid; $this->rock->adminid = $uid;
$this->rock->adminname = $name; $this->rock->adminname = $name;
$this->admintoken = $token; $this->admintoken = $token;
$this->adminname = $name; $this->adminname = $name;
$this->adminid = $uid; $this->adminid = $uid;
} }
//更新token最后时间 //更新token最后时间
private function uptokendt($id) private function uptokendt($id)
{ {
$this->update("`moddt`='".$this->rock->now."',`online`=1", $id); $this->update("`moddt`='".$this->rock->now."',`online`=1", $id);
} }
//自动快速登录 //自动快速登录
public function autologin($aid=0, $token='', $ism=0) public function autologin($aid=0, $token='', $ism=0)
{ {
$baid = $this->adminid; $baid = $this->adminid;
if($aid>0 && $token!=''){ if($aid>0 && $token!=''){
$rs = $this->getone("`uid`='$aid' and `token`='$token' and `online`=1",'`name`,`id`'); $rs = $this->getone("`uid`='$aid' and `token`='$token' and `online`=1",'`name`,`id`');
if(!$rs)exit('请求信息登录已失效,请重新登录'); if(!$rs)exit('请求信息登录已失效,请重新登录');
$this->setsession($aid, $rs['name'], $token); $this->setsession($aid, $rs['name'], $token);
$this->uptokendt($rs['id']); $this->uptokendt($rs['id']);
$baid = $aid; $baid = $aid;
} }
if($baid==0){ if($baid==0){
$tokans = $this->rock->jm->uncrypt($this->rock->cookie('mo_adminid'));//用cookie登录 $tokans = $this->rock->jm->uncrypt($this->rock->cookie('mo_adminid'));//用cookie登录
if(!isempt($tokans)){ if(!isempt($tokans)){
$onrs = $this->getone("`token`='$tokans'",'`name`,`token`,`id`,`uid`'); $onrs = $this->getone("`token`='$tokans'",'`name`,`token`,`id`,`uid`');
if($onrs){ if($onrs){
$uid= $onrs['uid']; $uid= $onrs['uid'];
$this->setsession($uid, $onrs['name'], $onrs['token']); $this->setsession($uid, $onrs['name'], $onrs['token']);
$this->uptokendt($onrs['id']); $this->uptokendt($onrs['id']);
}else{ }else{
$uid = 0; $uid = 0;
} }
$baid = $uid; $baid = $uid;
} }
} }
return $baid; return $baid;
} }
public function updateallonline() public function updateallonline()
{ {
return;//暂时没啥用 return;//暂时没啥用
$moddt = date('Y-m-d H:i:s', time()-180); $moddt = date('Y-m-d H:i:s', time()-180);
$rows = $this->getall("`online`=1 and `moddt`>='$moddt'"); $rows = $this->getall("`online`=1 and `moddt`>='$moddt'");
$uids = ''; $uids = '';
foreach($rows as $k=>$rs)$uids.=','.$rs['uid'].''; foreach($rows as $k=>$rs)$uids.=','.$rs['uid'].'';
if($uids!='')m('admin')->update('`online`=1', "`id` in(".substr($uids,1).")"); if($uids!='')m('admin')->update('`online`=1', "`id` in(".substr($uids,1).")");
} }
//首页登录统计 //首页登录统计
public function homejtLogin() public function homejtLogin()
{ {
$dt = $this->rock->date; $dt = $this->rock->date;
$rows = array(); $rows = array();
$data = array('已登录','未登录'); $data = array('已登录','未登录');
$dbs = m('admin'); $dbs = m('admin');
$dlur = 'select `uid` from `[Q]logintoken` where `online`=1 and `moddt` like \''.$dt.'%\''; $dlur = 'select `uid` from `[Q]logintoken` where `online`=1 and `moddt` like \''.$dt.'%\'';
$zong = $dbs->rows('`status`=1'); $zong = $dbs->rows('`status`=1');
$delr = $dbs->rows('`status`=1 and `id` in('.$dlur.')'); $delr = $dbs->rows('`status`=1 and `id` in('.$dlur.')');
$rows[] = array( $rows[] = array(
'name' => '未登录', 'name' => '未登录',
'value' => $zong-$delr, 'value' => $zong-$delr,
'color' => '#FF9999' 'color' => '#FF9999'
); );
$rows[] = array( $rows[] = array(
'name' => '已登录', 'name' => '已登录',
'value' => $delr, 'value' => $delr,
'color' => '#99CC00' 'color' => '#99CC00'
); );
return array( return array(
'rows' => $rows, 'rows' => $rows,
'data' => $data, 'data' => $data,
'dt' => $dt, 'dt' => $dt,
); );
} }
private function getRandomStr($length = 10){ private function getRandomStr($length = 10){
$strs="QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm"; $strs="QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm";
return substr(str_shuffle($strs),mt_rand(0,strlen($strs)-11),$length); return substr(str_shuffle($strs),mt_rand(0,strlen($strs)-11),$length);
} }
} }
\ No newline at end of file
<?php
class yfkDetailClassModel extends Model
{
public function initModel()
{
$this->settable('c_fund_details_yfk');
}
}
\ No newline at end of file
<?php
class yfkClassModel extends Model
{
public function initModel()
{
$this->settable('c_fininfom_oayfk');
}
}
\ No newline at end of file
...@@ -14,12 +14,20 @@ class opencustomerClassAction extends openapiAction ...@@ -14,12 +14,20 @@ class opencustomerClassAction extends openapiAction
//客户列表 //客户列表
public function listAction(){ public function listAction(){
$post = $_POST; $post = $_POST;
$page = $post['size'] ? $post['size']:0; $email=$post['email'];
$page_size = $post['page_size']? $post['page_size']:10; $sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'";
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,contract_number,name from [Q]customer as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$data = $this->db->getall($sql); $data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,contract_number,name from
oa_customer
where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
foreach ($data as $key => $vo){ foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]customer_bank_info where mid='.$vo['id']; $supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]customer_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]contracts where mid='.$vo['id']; $contacts ='select name,job,tel,email,adress,remarks from [Q]contracts where mid='.$vo['id'];
......
<?php
/**
* Created by PhpStorm.
* User: chouchou
* Date: 2020-4-2
* Time: 0:17
*/
class openfkClassAction extends openapiAction
{
public $data = [];
public $subdata = [];
public $model = null;
public $ext = 'oa';
public function initAction()
{
$data = json_decode($this->post('data'),true);
if(empty($data)) $this->showreturn([], '请求的参数不能为空!', '201');
if(!empty($data['docnum'])) $this->data['docnum'] = $data['docnum']; //如果是编辑则携带编码
$user = $this->getUser($data['uname']);
if ($data['type'] == 1) {
$this->model = 'fk';
$this->data['applicationdpt'] = $data['dept'];
};
if ($data['type'] == 2) {
$this->model = 'yfk';
$this->data['application'] = $data['dept'];
};
//构建主表
$this->data[$this->model.'name'] = $data['title'];
$this->data['payee'] = $data['payee'];
$this->data['paymentMethod'] = $data['payType'];
$this->data['applicant'] = $user['name'];
$this->data['fkorg'] = $data['payOrg'];
$this->data['paymentBy'] = $data['remarks'];
$this->data['fkinfo'] = $data['fkinfo'];
$this->data['applydt'] = $this->data['optdt'] = $this->data['applydate'] = $data['date'] ?: date('Y-m-d');
$this->data['uid']= $this->data['optid'] = $user['id'];
$this->data['docnum'] = $this->data['docnum'] ?: $this->getDocNum();
$this->data['status'] = 0;
$this->subdata = $this->getSubData($data['details']);
$this->data['amountOfThisPayment'] = $this->AmountSum();
}
//返回不存在的接口方法
public function __call($name, $arguments)
{
$msg = $name . ' action not found';
$this->showreturn([], $msg, '201');
}
//创建预付款单
public function createAction()
{
$id = m($this->model)->insert($this->data);
if ($id) {
//插入子表数据
$smode = m($this->model.'Detail');
foreach ($this->subdata as $sub){
$sub['mid'] = $id;
$sub['comid'] = 1;
$smode->insert($sub);
}
//启动流程
$this->goflow($id);
$this->showreturn(['numb' => $this->data['docnum']], '插入数据成功', '200');
} else $this->showreturn([], '插入数据失败', '201');
}
public function updateAction(){
$mid = $this->getIdByDocNum($this->data['docnum']);
if(!$mid) $this->showreturn([], '修改数据失败,不匹配的数据记录', '201');
$where = 'id='.$mid;
unset($this->data['docnum']);
$res = m($this->model)->update($this->data,$where);
if(!$res) $this->showreturn([], '修改数据失败,数据字段异常或字段不匹配', '201');
$smode = m($this->model.'Detail');
//1.获取子表数据,子表数据必须要携带子表id
//2.查询所有子表ID 如果子表ID存在于 记录中则是修改 否则是新增
$scount = 0;
foreach ($this->subdata as $k=>$sub){
if(empty($sub['id'])){ //插入操作
$sub['mid'] = $mid;
$sub['comid'] = 1;
$smode->insert($sub);
} else { //新增
//如果已经存在的子表数据则修改
if($smode->getone('id='.$sub['id'])){
$smode->update($sub,'id='.$sub['id']);
} else {
$sub['mid'] = $mid;
$sub['comid'] = 1;
$smode->insert($sub);
}
}
$scount++;
}
$this->showreturn([], '修改数据成功,子表数据成功修改'.$scount.'条记录', '200');
}
public function getUser($username)
{
$where = "email='".$username."@gonn.com.cn'";
return $this->db->getone('oa_userinfo',$where);
}
public function getSubData($details=[]){
$arr = [];
foreach ($details as $k=>$d){
if(!empty($d['id'])) $arr[$k]['id'] = $d['id'];
$arr[$k]['charge_type'] = $d['chargeType'];
$arr[$k]['charge_amount'] = $d['amount'];
$arr[$k]['cbzx_code'] = $d['projectNumber'];
$arr[$k]['contract_id'] = $d['contractNumber'];
$arr[$k]['receipt_id'] = $d['receipt'];
}
return $arr;
}
//子表金额求和
public function AmountSum(){
$sum = 0;
foreach ($this->subdata as $v){
$sum += $v['charge_amount'];
}
return $sum;
}
private function getDocNum()
{
$pre = 'OA-FK-';
if($this->model == 'yfk') $pre = 'OA-YFK-';
$cext = $pre . date("Ymd");
$where = "`docnum` like '%" . $cext . "%'";
$mode = m($this->model);
$data = $mode->getone($where, 'id,docnum', 'id desc');
$num = '001';
if ($data) {
$num = (int)substr($data['docnum'], strlen($cext)) + 1;
if (strlen($num) == 2) {
$num = '0' . $num;
} else if (strlen($num) == 1) {
$num = '00' . $num;
}
}
return $cext . $num;
}
private function getIdByDocNum($docnum){
$data = m($this->model)->getone("`docnum`='".$docnum."'", 'id,docnum');
return $data['id'] ?: 0;
}
private function goflow($id){
$num = $this->ext.$this->model;
$mode = m("flow:".$num);
$mode->initdata($num);
$mode->loaddata($id);
$mode->submit();
}
}
\ No newline at end of file
<?php
/**
*
* Class
*/
class openfkinfoClassAction extends openapiAction
{
public function __call($name, $arguments)
{
$msg = $name.' action not found';
return $this->showreturn([],$msg,'201');
}
public function listAction(){
$post = $_POST;
if($post){
$arr=$post['docnum'];
$arr=explode(',', $arr);
$str = " ' " . join("','", array_values($arr) ) . " ' "; // 使用需要的符号拼接
$str = " ' ".str_replace( ",","','", implode(',',$arr)); //使用需要的符号替换
$str = join( ', ',array_map(function( $v ){ return "'".$v."'";},$arr) );
$sql='select a.id,a.docnum,a.status,b.nowcheckname from oa_c_fininfom_oafk as a INNER JOIN oa_flow_bill as b on a.docnum=b.sericnum where a.docnum in '."(".$str.")";
$data = $this->db->getall($sql);
foreach ($data as $key => $value) {
$data[$key]['url']="http://chengye-dev.gonn.tech/task.php?a=p&num=oafk&mid=".$value['id'];
}
}else{
$data = $this->db->getall('select a.id,a.docnum,a.status,b.nowcheckname from oa_c_fininfom_oafk as a INNER JOIN oa_flow_bill as b on a.docnum=b.sericnum ');
foreach ($data as $key => $value) {
$data[$key]['url']="http://chengye-dev.gonn.tech/task.php?a=p&num=oafk&mid=".$value['id'];
}
}
return $this->showreturn($data,'SUCCESS','200');
}
public function fkinforAction(){
$post = $_POST;
switch ($post['type']) {
case '1':
$sql='select o.name,o.num from oa_option as o where o.pid=516';
$data = $this->db->getall($sql);
break;
case '2':
$sql='select o.name,o.num from oa_option as o where o.pid=933';
$data = $this->db->getall($sql);
break;
case '3':
$sql='select o.name,o.num from oa_option as o where o.pid=678';
$data = $this->db->getall($sql);
break;
default:
return $this->showreturn([],'error','201');
break;
}
return $this->showreturn($data,'SUCCESS','200');
}
}
\ No newline at end of file
...@@ -15,11 +15,17 @@ class opensupplierClassAction extends openapiAction ...@@ -15,11 +15,17 @@ class opensupplierClassAction extends openapiAction
//供应商列表 //供应商列表
public function listAction(){ public function listAction(){
$post = $_POST; $post = $_POST;
$page = $post['size'] ? $post['size']:0; $email=$post['email'];
$page_size = $post['page_size']? $post['page_size']:10; $sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'";
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,number,name from [Q]supplier as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$data = $this->db->getall($sql); $data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,number,name from oa_supplier where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
foreach ($data as $key => $vo){ foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]supplier_bank_info where mid='.$vo['id']; $supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]supplier_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]supplier_contract where mid='.$vo['id']; $contacts ='select name,job,tel,email,adress,remarks from [Q]supplier_contract where mid='.$vo['id'];
......
File mode changed from 100644 to 100755
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论