From 6a506540455204f2d40e488853c9b6f215b87df1 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 18 Nov 2020 15:44:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1/?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=99=BB=E5=BD=95=E6=97=B6=E9=97=B4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 51 ++++++++++++++----- .../Controller/FinanceController.class.php | 47 ++++++++++++----- .../Controller/KuaijieController.class.php | 3 +- Application/Admin/Model/MemberModel.class.php | 2 +- .../Admin/View/Finance/gameStatistics.html | 24 ++++++--- Application/Common/Common/function.php | 3 +- Application/Common/Conf/config.php | 2 +- 7 files changed, 98 insertions(+), 34 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 3247934db..4ef21467d 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -8362,9 +8362,11 @@ class ExportController extends Controller array('inside_cash_count','内充支出'), array('all_cash_count','游戏内充值合计'), array('notice_fail_count','联运通知失败合计'), - array('agg_amount','聚合平台数据'), + array('agg_wm_amount','聚合万盟数据'), + array('agg_wm_failed_amount','聚合万盟通知失败'), array('test_amount','聚合平台测试订单'), - array('agg_failed_amount','聚合通知失败合计'), + array('agg_amount','聚合其他渠道数据'), + array('agg_failed_amount','聚合其他渠道通知失败订单'), ); $map = []; @@ -8451,33 +8453,56 @@ class ExportController extends Controller ]); $aggData = []; + $aggWmData = []; $aggFailData = []; + $aggWmFailData = []; $aggTotal = '0.00'; + $aggWmTotal = '0.00'; $aggFailTotal = '0.00'; + $aggWmFailTotal = '0.00'; if ($result['code'] == '0000') { - $aggData = $result['data']['records']; - $aggFailData = $result['data']['fail_records']; - $aggTotal = $result['data']['total']; - $aggFailTotal = $result['data']['fail_total']; + $aggData = $result['data']['records'] ?? []; + $aggWmData = $result['data']['wm_records'] ?? []; + $aggFailData = $result['data']['fail_records'] ?? []; + $aggWmFailData = $result['data']['wm_fail_records'] ?? []; + $aggTotal = $result['data']['total'] ?? '0.00'; + $aggWmTotal = $result['data']['wm_total'] ?? '0.00'; + $aggFailTotal = $result['data']['fail_total'] ?? '0.00'; + $aggWmFailTotal = $result['data']['wm_fail_total'] ?? '0.00'; } $exceptIds = getAggExceptIds($gameSets); foreach ($xlsData as $key => $value) { $aggAmount = '0.00'; + $aggWmAmount = '0.00'; $aggFailAmount = '0.00'; + $aggWmFailAmount = '0.00'; $testAmount = '0.00'; $deviceType = $value['sdk_version'] == 1 ? 'android' : 'ios'; - if ($value['unique_code'] && isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) { - $aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', ''); - $aggFailAmount = number_format($aggFailData[$value['unique_code']][$deviceType], 2, '.', ''); + if ($value['unique_code']) { + if (isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) { + $aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggWmData[$value['unique_code']]) && isset($aggWmData[$value['unique_code']][$deviceType])) { + $aggWmAmount = number_format($aggWmData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggFailData[$value['unique_code']]) && isset($aggFailData[$value['unique_code']][$deviceType])) { + $aggFailAmount = number_format($aggFailData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggWmFailData[$value['unique_code']]) && isset($aggWmFailData[$value['unique_code']][$deviceType])) { + $aggWmFailAmount = number_format($aggWmFailData[$value['unique_code']][$deviceType], 2, '.', ''); + } + } $xlsData[$key]['agg_amount'] = $aggAmount; + $xlsData[$key]['agg_wm_amount'] = $aggWmAmount; $xlsData[$key]['agg_failed_amount'] = $aggFailAmount; + $xlsData[$key]['agg_wm_failed_amount'] = $aggWmFailAmount; if (isset($gameSets[$value['game_id']]) && isAggGame($gameSets[$value['game_id']]['pay_notify_url'])) { $xlsData[$key]['cash_count'] = $value['cash_count'] = 0; - $xlsData[$key]['balance_coin_count'] =$value['balance_coin_count'] = 0; - $xlsData[$key]['inside_cash_count'] =$value['inside_cash_count'] = 0; + $xlsData[$key]['balance_coin_count'] = $value['balance_coin_count'] = 0; + $xlsData[$key]['inside_cash_count'] = $value['inside_cash_count'] = 0; $testAmount = $testList[$value['game_id']] ?? '0.00'; } @@ -8518,8 +8543,10 @@ class ExportController extends Controller 'inside_cash_count'=>$sumInside, 'all_cash_count'=>$sumAll, 'notice_fail_count'=>$sumNoticeFail, - 'agg_amount' => $aggTotal, + 'agg_wm_amount' => $aggWmTotal, + 'agg_wm_failed_amount' => $aggWmFailTotal, 'test_amount' => round(floatval($testAllAmount), 2), + 'agg_amount' => $aggTotal, 'agg_failed_amount' => $aggFailTotal, ] ]; diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 6245f8322..89d9016a0 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -788,26 +788,46 @@ class FinanceController extends ThinkController 'device_type' => I("sdk_type", 0), ]); $aggData = []; + $aggWmData = []; $aggFailData = []; + $aggWmFailData = []; $aggTotal = '0.00'; + $aggWmTotal = '0.00'; $aggFailTotal = '0.00'; + $aggWmFailTotal = '0.00'; if ($result['code'] == '0000') { - $aggData = $result['data']['records']; - $aggFailData = $result['data']['fail_records']; - $aggTotal = $result['data']['total']; - $aggFailTotal = $result['data']['fail_total']; + $aggData = $result['data']['records'] ?? []; + $aggWmData = $result['data']['wm_records'] ?? []; + $aggFailData = $result['data']['fail_records'] ?? []; + $aggWmFailData = $result['data']['wm_fail_records'] ?? []; + $aggTotal = $result['data']['total'] ?? '0.00'; + $aggWmTotal = $result['data']['wm_total'] ?? '0.00'; + $aggFailTotal = $result['data']['fail_total'] ?? '0.00'; + $aggWmFailTotal = $result['data']['wm_fail_total'] ?? '0.00'; } $endTime = time(); $exceptIds = getAggExceptIds($gameSets); foreach ($data as $key => $value) { $aggAmount = '0.00'; + $aggWmAmount = '0.00'; $aggFailAmount = '0.00'; + $aggWmFailAmount = '0.00'; $testAmount = '0.00'; $deviceType = $value['sdk_version'] == 1 ? 'android' : 'ios'; - if ($value['unique_code'] && isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) { - $aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', ''); - $aggFailAmount = number_format($aggFailData[$value['unique_code']][$deviceType], 2, '.', ''); + if ($value['unique_code']) { + if (isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) { + $aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggWmData[$value['unique_code']]) && isset($aggWmData[$value['unique_code']][$deviceType])) { + $aggWmAmount = number_format($aggWmData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggFailData[$value['unique_code']]) && isset($aggFailData[$value['unique_code']][$deviceType])) { + $aggFailAmount = number_format($aggFailData[$value['unique_code']][$deviceType], 2, '.', ''); + } + if (isset($aggWmFailData[$value['unique_code']]) && isset($aggWmFailData[$value['unique_code']][$deviceType])) { + $aggWmFailAmount = number_format($aggWmFailData[$value['unique_code']][$deviceType], 2, '.', ''); + } } if (isset($gameSets[$value['game_id']]) && isAggGame($gameSets[$value['game_id']]['pay_notify_url'])) { $data[$key]['cash_count'] = $value['cash_count'] = 0; @@ -816,8 +836,10 @@ class FinanceController extends ThinkController $testAmount = $testList[$value['game_id']] ?? '0.00'; } $data[$key]['all_cash_count'] = number_format($value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count'],2,'.',''); - $data[$key]['agg_amount'] = $value['unique_code'] ? $aggAmount : '0.00'; - $data[$key]['agg_failed_amount'] = $value['unique_code'] ? $aggFailAmount : '0.00'; + $data[$key]['agg_amount'] = $aggAmount; + $data[$key]['agg_wm_amount'] = $aggWmAmount; + $data[$key]['agg_failed_amount'] = $aggFailAmount; + $data[$key]['agg_wm_failed_amount'] = $aggWmFailAmount; $data[$key]['test_amount'] = $testAmount; } @@ -852,13 +874,14 @@ class FinanceController extends ThinkController $game_types = M("game_type", 'tab_')->field('id, type_name')->select(); - $aggRate = round($aggTotal/($sumAll + $aggTotal) * 100, 2) . '%'; - $allRate = round($sumAll/($sumAll + $aggTotal) * 100, 2) . '%'; - + $aggRate = round(($aggTotal + $aggWmTotal)/($sumAll + $aggTotal + $aggWmTotal) * 100, 2) . '%'; + $allRate = round($sumAll/($sumAll + $aggTotal + $aggWmTotal) * 100, 2) . '%'; $this->assign('testAllAmount', $testAllAmount); $this->assign('aggFailTotal', $aggFailTotal); + $this->assign('aggWmFailTotal', $aggWmFailTotal); $this->assign('aggRate', $aggRate); $this->assign('allRate', $allRate); + $this->assign('aggWmTotal', $aggWmTotal); $this->assign('aggTotal', $aggTotal); $this->assign('game_types', $game_types); $this->assign('sumCash', $sumCash); diff --git a/Application/Admin/Controller/KuaijieController.class.php b/Application/Admin/Controller/KuaijieController.class.php index 4e861d1a5..5dddfc87a 100644 --- a/Application/Admin/Controller/KuaijieController.class.php +++ b/Application/Admin/Controller/KuaijieController.class.php @@ -20,7 +20,8 @@ class KuaijieController extends AdminController { * 频道列表 * @author 麦当苗儿 */ - public function index($p=0){ + public function index($p=0) + { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index 52d3e1591..35bef2aa3 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -88,7 +88,7 @@ class MemberModel extends Model { //登录有效时间改为1小时 $expireTime = 3600; ini_set('session.gc_maxlifetime', $expireTime); - ini_set('session.cookie_lifetime', $expireTime); + ini_set('session.cookie_lifetime', 0); session('user_group_id',$groupId); session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); diff --git a/Application/Admin/View/Finance/gameStatistics.html b/Application/Admin/View/Finance/gameStatistics.html index 52697204c..e4eafb1eb 100644 --- a/Application/Admin/View/Finance/gameStatistics.html +++ b/Application/Admin/View/Finance/gameStatistics.html @@ -176,10 +176,11 @@
游戏内充值合计游戏现金金额+平台币直充支出+平台币内充支出
联运通知失败合计联运所有通知失败的合计金额
-
聚合平台数据包含聚合万盟平台数据,因为聚合平台数据是用接口获取并且涉及其他平台数据,所以只能添加总数据,无法判定平台币还是现金充值
+
聚合万盟数据聚合平台万盟渠道支付成功且通知成功的金额
+
聚合万盟通知失败聚合平台万盟渠道通知失败的订单合计金额
聚合平台测试订单聚合平台测试订单
-
聚合通知失败合计聚合所有通知失败的合计金额
- +
聚合其他渠道数据聚合平台其他渠道(不含万盟)支付成功通知成功订单合计
+
聚合其他渠道通知失败订单聚合平台其他渠道(不含万盟)
通知失败的订单合计金额
操作 @@ -232,7 +233,8 @@ 'game_id'=>$data['game_id'], 'game_name'=>$data['game_name'], 'partner_id'=>$_REQUEST['partner_id'] - ])}">{$data.agg_amount} + ])}">{$data.agg_wm_amount} + {$data.agg_failed_amount}0 {$data.test_amount} + {$data.agg_amount} {$data.agg_failed_amount}0 {$sumInside}0 {$sumAll}0 {$sumNoticeFail}0 - {$aggTotal} + {$aggWmTotal} + {$aggWmFailTotal}0 {$testAllAmount}0 + {$aggTotal} {$aggFailTotal}0 联运渠道数据:{$sumAll} 占比:{$allRate} 聚合渠道数据:{$aggTotal} 占比:{$aggRate}

+

联运渠道数据:{$sumAll} 占比:{$allRate} 聚合渠道数据:{$aggTotal + $aggWmTotal} 占比:{$aggRate}

diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 7e21fa50b..04b978be9 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -35,7 +35,8 @@ function is_login() session('user_group_id', null); return 0; } else { - session('user_auth_expire', time() + $expire); + $expiredTime = time() + $expire; + session('user_auth_expire', $expiredTime); } return session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0; } diff --git a/Application/Common/Conf/config.php b/Application/Common/Conf/config.php index 02bc95be5..90383c743 100644 --- a/Application/Common/Conf/config.php +++ b/Application/Common/Conf/config.php @@ -90,7 +90,7 @@ $config = array( // session 配置数组 支持type name id path expire domain 等参数 'SESSION_OPTIONS' => array( - 'expire' => 7200 + // 'expire' => 3600 ), ); $config = array_merge($config, $env); From dd7068e3aee509a19d4dc99eb34546884fa089b3 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 19 Nov 2020 10:48:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=94=B9=E7=94=A8redis=E5=AD=98=E5=82=A8se?= =?UTF-8?q?ssion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/MemberModel.class.php | 4 - Application/Common/Conf/config.php | 5 + ThinkPHP/Common/functions.php | 2 +- .../Think/Session/Driver/Redis.class.php | 120 ++++++++++++++++++ 4 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 ThinkPHP/Library/Think/Session/Driver/Redis.class.php diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index 35bef2aa3..cc4181628 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -85,10 +85,6 @@ class MemberModel extends Model { 'show_market_admin'=>$adminData['show_market_admin'], 'show_promote'=>$adminData['show_promote'], ); - //登录有效时间改为1小时 - $expireTime = 3600; - ini_set('session.gc_maxlifetime', $expireTime); - ini_set('session.cookie_lifetime', 0); session('user_group_id',$groupId); session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); diff --git a/Application/Common/Conf/config.php b/Application/Common/Conf/config.php index 90383c743..069b8da5d 100644 --- a/Application/Common/Conf/config.php +++ b/Application/Common/Conf/config.php @@ -91,7 +91,12 @@ $config = array( // session 配置数组 支持type name id path expire domain 等参数 'SESSION_OPTIONS' => array( // 'expire' => 3600 + 'type' => 'Redis', + 'prefix' => 'sess_', + 'path' => 'tcp://127.0.0.1:6379', + 'expire' => 60, ), + 'SESSION_REDIS_EXPIRE' => 3600, ); $config = array_merge($config, $env); return array_merge($config, $cache_config); diff --git a/ThinkPHP/Common/functions.php b/ThinkPHP/Common/functions.php index c0ec3d771..799da5b63 100644 --- a/ThinkPHP/Common/functions.php +++ b/ThinkPHP/Common/functions.php @@ -1245,7 +1245,7 @@ function session($name='',$value='') { if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']); if(isset($name['expire'])) { ini_set('session.gc_maxlifetime', $name['expire']); - ini_set('session.cookie_lifetime', $name['expire']); + ini_set('session.cookie_lifetime', 99999999); } if(isset($name['use_trans_sid'])) ini_set('session.use_trans_sid', $name['use_trans_sid']?1:0); if(isset($name['use_cookies'])) ini_set('session.use_cookies', $name['use_cookies']?1:0); diff --git a/ThinkPHP/Library/Think/Session/Driver/Redis.class.php b/ThinkPHP/Library/Think/Session/Driver/Redis.class.php new file mode 100644 index 000000000..e50e21a0f --- /dev/null +++ b/ThinkPHP/Library/Think/Session/Driver/Redis.class.php @@ -0,0 +1,120 @@ + '127.0.0.1', + 'port' => 6379, + 'password' => null, + 'select' => 1, + 'expire' => 3600, + 'timeout' => 0, + 'persistent' => true, + 'session_name' => 'session_', + ]; + + public function __construct($config = []) + { + $this->config['host'] = C("SESSION_REDIS_HOST") ? C("SESSION_REDIS_HOST") : $this->config['host']; + $this->config['port'] = C("SESSION_REDIS_POST") ? C("SESSION_REDIS_POST") : $this->config['port']; + $this->config['password'] = C("SESSION_REDIS_AUTH") ? C("SESSION_REDIS_AUTH") : $this->config['password']; + $this->config['select'] = C("SESSION_REDIS_SELECT") ? C("SESSION_REDIS_SELECT") : $this->config['select']; + $this->config['expire'] = C("SESSION_REDIS_EXPIRE") ? C("SESSION_REDIS_EXPIRE") : $this->config['expire']; + $this->config['session_name'] = C('SESSION_PREFIX') ? C('SESSION_PREFIX') : $this->config['session_name']; + $this->config['timeout'] = C('SESSION_CACHE_TIMEOUT') ? C('SESSION_CACHE_TIMEOUT') : $this->config['timeout']; + } + + /** + * 打开Session + * @access public + * @param string $savePath + * @param mixed $sessName + * @return bool + * @throws Exception + */ + public function open($savePath, $sessName) + { + // 检测php环境 + if (!extension_loaded('redis')) { + throw new Exception('not support:redis'); + } + $this->handler = new \Redis; + // 建立连接 + $func = $this->config['persistent'] ? 'pconnect' : 'connect'; + $this->handler->$func($this->config['host'], $this->config['port'], $this->config['timeout']); + if ('' != $this->config['password']) { + $this->handler->auth($this->config['password']); + } + if (0 != $this->config['select']) { + $this->handler->select($this->config['select']); + } + return true; + } + + /** + * 关闭Session + * @access public + */ + public function close() + { + $this->gc(ini_get('session.gc_maxlifetime')); + $this->handler->close(); + $this->handler = null; + return true; + } + + /** + * 读取Session + * @access public + * @param string $sessID + * @return string + */ + public function read($sessID) + { + return (string)$this->handler->get($this->config['session_name'] . $sessID); + } + + /** + * 写入Session + * @access public + * @param string $sessID + * @param String $sessData + * @return bool + */ + public function write($sessID, $sessData) + { + if ($this->config['expire'] > 0) { + return $this->handler->setex($this->config['session_name'] . $sessID, $this->config['expire'], $sessData); + } else { + return $this->handler->set($this->config['session_name'] . $sessID, $sessData); + } + } + + /** + * 删除Session + * @access public + * @param string $sessID + * @return bool + */ + public function destroy($sessID) + { + return $this->handler->delete($this->config['session_name'] . $sessID) > 0; + } + + /** + * Session 垃圾回收 + * @access public + * @param string $sessMaxLifeTime + * @return bool + */ + public function gc($sessMaxLifeTime) + { + return true; + } +} \ No newline at end of file From 773068b57c569b09e6d3eee84df5b6349c373492 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 19 Nov 2020 16:55:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestResourceController.class.php | 19 ------------------- Application/Common/Common/extend.php | 3 ++- Application/Common/Conf/config.php | 3 +-- .../Controller/CoinOrderController.class.php | 4 ++-- .../TestResourceController.class.php | 12 ++++++------ .../Controller/WithdrawController.class.php | 2 +- .../Sdk/Controller/Ipa365Controller.class.php | 2 +- 7 files changed, 13 insertions(+), 32 deletions(-) diff --git a/Application/Admin/Controller/TestResourceController.class.php b/Application/Admin/Controller/TestResourceController.class.php index e5ca7f4b1..f2bbe81af 100644 --- a/Application/Admin/Controller/TestResourceController.class.php +++ b/Application/Admin/Controller/TestResourceController.class.php @@ -736,24 +736,6 @@ class TestResourceController extends ThinkController M('test_resource','tab_')->rollback();//回滚 $this->error('数据有误'); } - - // $max_quota=$this->max_quota($support['game_id'],$support['server_name']);//最大申请额度 - // if(count($ids)>1){ - // $map_s['game_id']=$support['game_id']; - // $map_s['server_name']=$support['server_name']; - // $map_s['id'] =['in',$ids]; - // $count=M('support','tab_')->where($map_s)->count(); - // $max_quota = floor($max_quota/$count); - // } - // if(I('support_num') > $max_quota){ - // M('support','tab_')->rollback();//回滚 - // $this->ajaxReturn(['status'=>0,'msg'=>'扶持申请额度不足,最大额度:'.$max_quota]); - // } - -// if($support['promote_id'] !=$_SESSION['onethink_home']['promote_auth']['pid'] || empty($support) ){ -// M('test_resource','tab_')->rollback();//回滚 -// $this->error('申请失败'); -// } $data['game_id']=$support['game_id']; $data['game_name']=$support['game_name']; @@ -831,7 +813,6 @@ class TestResourceController extends ThinkController unset($_REQUEST['start']);unset($_REQUEST['end']); } -// $map['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid']; $data=M('test_resource','tab_')->where($map)->order('id desc')->page($page,$row)->select(); $count=M('test_resource','tab_')->field('id')->where($map)->select(); $count = count($count); diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index b5401ede7..415a862d5 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -2010,10 +2010,11 @@ function varify_url($url){ } return $status; } + //获取当前推广员id function get_pid() { - return $_SESSION['onethink_home']['promote_auth']['pid']; + return session('promote_auth.pid'); } // //计算数组个数用于模板 diff --git a/Application/Common/Conf/config.php b/Application/Common/Conf/config.php index 069b8da5d..eb62e4004 100644 --- a/Application/Common/Conf/config.php +++ b/Application/Common/Conf/config.php @@ -92,9 +92,8 @@ $config = array( 'SESSION_OPTIONS' => array( // 'expire' => 3600 'type' => 'Redis', - 'prefix' => 'sess_', 'path' => 'tcp://127.0.0.1:6379', - 'expire' => 60, + 'expire' => 3600, ), 'SESSION_REDIS_EXPIRE' => 3600, ); diff --git a/Application/Home/Controller/CoinOrderController.class.php b/Application/Home/Controller/CoinOrderController.class.php index f713d0af1..e6e5002a0 100644 --- a/Application/Home/Controller/CoinOrderController.class.php +++ b/Application/Home/Controller/CoinOrderController.class.php @@ -112,7 +112,7 @@ class CoinOrderController extends BaseController $data['pay_type'] = $pay_type; $data['order_number'] = $order_no; $data['promote_id'] = get_pid(); - $data['promote_account'] = $_SESSION['onethink_home']['promote_auth']['account']; + $data['promote_account'] = session('promote_auth.account'); $data['create_time'] = time(); $data['discount'] = "0"; if($pay_type==1){ // 在线转账 @@ -157,7 +157,7 @@ class CoinOrderController extends BaseController recordPromoteLogs('平台币管理','提交充值订单'); $this->ajaxReturn(['status'=>1,'info'=>'充值提交成功','pay_type'=>$pay_type,'trade_no'=>$order_no,'time'=>1000],"JSON"); }else{ - $account = $_SESSION['onethink_home']['promote_auth']['account']; + $account = session('promote_auth.account'); $bank_list = M("bank","tab_")->select(); $this->meta_title = "平台币充值"; $this->assign("account",$account); diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php index 85d228a81..d729bbbca 100644 --- a/Application/Home/Controller/TestResourceController.class.php +++ b/Application/Home/Controller/TestResourceController.class.php @@ -421,11 +421,11 @@ class TestResourceController extends BaseController $data['apply_resource']=I('apply_resource')[$i]; $data['apply_remark']=I('apply_remark')[$i]; - $data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account']; - $data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid']; + $data['apply_name'] = session('promote_auth.account'); + $data['apply_id'] = session('promote_auth.pid'); - $data['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid']; - $data['promote_account']=$_SESSION['onethink_home']['promote_auth']['account']; + $data['promote_id'] = session('promote_auth.pid'); + $data['promote_account'] = session('promote_auth.account'); $data['create_time']=time(); $data['apply_type']=0; @@ -603,8 +603,8 @@ class TestResourceController extends BaseController $data['apply_resource']=I('apply_resource'); $data['apply_remark']=I('apply_remark'); - $data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account']; - $data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid']; + $data['apply_name'] = session('promote_auth.account'); + $data['apply_id'] = session('promote_auth.pid'); $data['promote_id']=session("promote_auth.pid"); $data['promote_account']=session("promote_auth.account"); diff --git a/Application/Home/Controller/WithdrawController.class.php b/Application/Home/Controller/WithdrawController.class.php index 37aebdb44..9bf7fd033 100644 --- a/Application/Home/Controller/WithdrawController.class.php +++ b/Application/Home/Controller/WithdrawController.class.php @@ -175,7 +175,7 @@ class WithdrawController extends BaseController { $dbres = M("company_statement_pool","tab_")->field("id,verify_status,verify_log")->where("id = {$id}")->find(); $dbres['verify_log'] = json_decode($dbres['verify_log'],true); - $dbres['verify_log'][$op_pre.'_user']=$_SESSION['onethink_home']['promote_auth']['account']; + $dbres['verify_log'][$op_pre.'_user'] = session('promote_auth.account'); $dbres['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); $dbres['verify_log'] = json_encode($dbres['verify_log']); $dbres['verify_status']=$change_status; diff --git a/Application/Sdk/Controller/Ipa365Controller.class.php b/Application/Sdk/Controller/Ipa365Controller.class.php index c317d9cdf..2f37ccdf9 100644 --- a/Application/Sdk/Controller/Ipa365Controller.class.php +++ b/Application/Sdk/Controller/Ipa365Controller.class.php @@ -11,7 +11,7 @@ class Ipa365Controller extends BaseController{ public $userinfo; public function __construct() { - $this->userinfo = $_SESSION['onethink_home']['user_auth']; + $this->userinfo = session('user_auth'); parent::__construct(); } From 289783eecdca0d8ac732724ee87ebd1698c72c95 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 25 Nov 2020 15:50:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Conf/config.php | 1 + Application/Home/Conf/config.php | 1 + ThinkPHP/Common/functions.php | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Application/Admin/Conf/config.php b/Application/Admin/Conf/config.php index 4a7bc38bb..e45f7d8cc 100644 --- a/Application/Admin/Conf/config.php +++ b/Application/Admin/Conf/config.php @@ -103,6 +103,7 @@ return array( /* SESSION 和 COOKIE 配置 */ 'SESSION_PREFIX' => 'onethink_admin', //session前缀 + 'SESSION_COOKIE_PATH' => '/admin.php', 'COOKIE_PREFIX' => 'onethink_admin_', // Cookie前缀 避免冲突 'VAR_SESSION_ID' => 'session_id', //修复uploadify插件无法传递session_id的bug diff --git a/Application/Home/Conf/config.php b/Application/Home/Conf/config.php index 36b9fe1af..c172b22c4 100644 --- a/Application/Home/Conf/config.php +++ b/Application/Home/Conf/config.php @@ -70,6 +70,7 @@ return array( /* SESSION 和 COOKIE 配置 */ 'SESSION_PREFIX' => 'onethink_home', //session前缀 + 'SESSION_COOKIE_PATH' => '/index.php', 'COOKIE_PREFIX' => 'onethink_home_', // Cookie前缀 避免冲突 diff --git a/ThinkPHP/Common/functions.php b/ThinkPHP/Common/functions.php index 799da5b63..2b1bc4342 100644 --- a/ThinkPHP/Common/functions.php +++ b/ThinkPHP/Common/functions.php @@ -1243,6 +1243,9 @@ function session($name='',$value='') { if(isset($name['name'])) session_name($name['name']); if(isset($name['path'])) session_save_path($name['path']); if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']); + if (C('SESSION_COOKIE_PATH')) { + ini_set('session.cookie_path', C('SESSION_COOKIE_PATH')); + } if(isset($name['expire'])) { ini_set('session.gc_maxlifetime', $name['expire']); ini_set('session.cookie_lifetime', 99999999);