提交 fbfc2f8f authored 作者: chengye's avatar chengye

Merge branch 'test' of ssh://39.155.253.71:33222/PHP/Jz-Php into test

...@@ -40,15 +40,14 @@ class SingleSign { ...@@ -40,15 +40,14 @@ class SingleSign {
$isAdmin = substr($str,$pos,1); $isAdmin = substr($str,$pos,1);
$user['is_admin'] = $isAdmin; $user['is_admin'] = $isAdmin;
if($user['is_admin'] == true) { preg_match('/adminuser\|s\:(\d+)\:/',$str,$match);
if($match){
$pos = stripos($str,'adminuser|s:') + strlen('adminuser|s:');
$pos += strlen($match[1]) + 2;
$user['username'] = substr($str,$pos,$match[1]+0);
}
if($user['is_admin'] == true && $user['username'] == 'admin') {
$user['username'] = 'gonnadmin'; $user['username'] = 'gonnadmin';
} else {
preg_match('/adminuser\|s\:(\d+)\:/',$str,$match);
if($match){
$pos = stripos($str,'adminuser|s:') + strlen('adminuser|s:');
$pos += strlen($match[1]) + 2;
$user['username'] = substr($str,$pos,$match[1]+0);
}
} }
$pos = stripos($str,'ukey|s:10:') + 11; $pos = stripos($str,'ukey|s:10:') + 11;
......
<?php
namespace app\admin\validate;
use think\Validate;
class FkAddValidate extends Validate
{
protected $rule = [
'title' => 'require',
'payee' => 'require',
'payOrg' => 'require',
'date' => 'require|date',
'fkinfo' => 'require'
];
protected $message = [
'title.require' => '标题必填',
'payee.require' => '收款方必填',
'payOrg.require' => '付款组织必填',
'date.require' => '日期必填',
'date.date' => '日期格式错误'
];
}
\ No newline at end of file
...@@ -404,7 +404,16 @@ class Payment extends Base ...@@ -404,7 +404,16 @@ class Payment extends Base
public function payoa(){ public function payoa(){
$payment_id = Request::param('payment_id'); $payment_id = Request::param('payment_id');
$user = Session::get('user'); $user = Session::get('user');
$staff = Staff::get($user['user_id']);
if($user['is_admin'] == 1){
if($user['username'] == 'admin' || $user['username'] == 'gonnadmin'){
$staff = [];
} else {
$staff = Staff::get(['name'=>$user['name']]);
}
} else {
$staff = Staff::get($user['user_id']);
}
$this->assign('payment_id',$payment_id); $this->assign('payment_id',$payment_id);
$this->assign('payee',$this->getGys($staff->email)); $this->assign('payee',$this->getGys($staff->email));
$this->assign('payOrg',$this->getFkInfo(2)); $this->assign('payOrg',$this->getFkInfo(2));
...@@ -503,8 +512,8 @@ class Payment extends Base ...@@ -503,8 +512,8 @@ class Payment extends Base
public function getGys($email) public function getGys($email)
{ {
$url = config('oafk.base_url').config('oafk.gys') . $this->apiKey(); $url = config('oafk.base_url').config('oafk.gys') . $this->apiKey();
$data = ['email' => $email]; $url .= '&email='.$email;
$res = httpPOST($url, $data); $res = curlGet($url);
$res = json_decode($res,true); $res = json_decode($res,true);
foreach ($res['data'] as $k => $v){ foreach ($res['data'] as $k => $v){
if(!empty($v['bank_info'])){ if(!empty($v['bank_info'])){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论