Merge branch 'release-1.0.0' of 47.111.118.107:wmtx/platform into release-1.0.0

master
chenzhi 5 years ago
commit 0a006bbcc2

@ -1770,4 +1770,27 @@ function data2csv(&$data,$title,$fields){
fclose($fp); //每生成一个文件关闭
die();
}
//所有支付方式
function all_pay_way_other($type=false)
{
if($type){
$pay_way[0]=array('key'=>0,'value'=>"平台币");
}
$pay_way[1]=array('key'=>-1,'value'=>"绑币");
$pay_way[2]=array('key'=>1,'value'=>"支付宝");
$pay_way[3]=array('key'=>2,'value'=>"微信");
$pay_way[7]=array('key'=>7,'value'=>'金猪');
$pay_way[9]=array('key'=>9,'value'=>"双乾支付-支付宝");
$pay_way[10]=array('key'=>10,'value'=>"双乾支付-银联");
// $pay_way[3]=array('key'=>3,'value'=>'微信APP');
// $pay_way[4]=array('key'=>4,'value'=>'威富通');
/* $pay_way[4]=array('key'=>5,'value'=>'聚宝云'); */
// $pay_way[5]=array('key'=>6,'value'=>'汇付宝');
/* $pay_way[6]=array('key'=>7,'value'=>"苹果支付");
*/
$pay_way[15]=array('key'=>15,'value'=>'双乾支付-快捷');
return $pay_way;
}
?>

@ -65,6 +65,7 @@ class PayChannelController extends ThinkController
//平台币充值金额计算
$coinMap['pay_source'] = 2;
$coinMap['extend'] = array('eq','');
$coinMap['tab_deposit.pay_way'] = array('egt',1);
// setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
@ -74,12 +75,11 @@ class PayChannelController extends ThinkController
->group("game_id")
->select();
unset($coinMap['game_id']);
// unset($coinMap['game_id']);
//平台币充值
$coinSum = M('deposit','tab_')
->where($coinMap)
->sum('tab_deposit.pay_amount');
// var_dump($coinSum);die();
$data = array_merge($data,$coinData);
$data = $this->unique_multi_array($data,'game_id');
@ -177,7 +177,7 @@ class PayChannelController extends ThinkController
// setPowerPromoteIds($spreadMap,'promote_id');
//推广后台
$spreadData = M("coin_pay_order","tab_")
->field("0 as game_name,sum(real_amount) as pay_amount,0 as platform_coin,id as test_coin")
->field("0 as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,id as test_coin")
->where($spreadMap)
->find();
$spreadData['pay_amount'] = $spreadData['pay_amount']?$spreadData['pay_amount']:0;
@ -250,11 +250,18 @@ class PayChannelController extends ThinkController
}
//汇总数据
$sumData['pay_amount'] = $sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount'];
$sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'] +
$offcialData['pay_amount'] + $spreadData['pay_amount'];
$sumData['test_coin'] = $sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin'];
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
if ($_REQUEST['game_id']) {
$sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'];
$sumData['test_coin'] = $sumData['test_coin']+$sumData['test_platform_coin'];
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
} else {
$sumData['pay_amount'] = $sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount'];
$sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'] +
$offcialData['pay_amount'] + $spreadData['pay_amount'];
$sumData['test_coin'] = $sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin'];
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
$coinSum = $coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost;
}
if($_REQUEST['export'] == 1) {
@ -276,8 +283,8 @@ class PayChannelController extends ThinkController
$payTypeDataExport['pay_amount'] .= $key.''.$value." ";
}
}
$payTypeDataExport['pay_amount'] .= "平台币直充金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)".
($coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost);
$payTypeDataExport['pay_amount'] .= "平台币直充金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)".
($coinSum);
$channelDataExport['game_name'] = '支付渠道';
foreach($channelData as $key => $value) {
@ -288,6 +295,12 @@ class PayChannelController extends ThinkController
unset($sumData['test_platform_coin']);
if ($_REQUEST['game_id']) {
unset($superSignData);
unset($offcialData);
unset($spreadData);
}
db2csv(array_merge(array_merge(array_merge(array_merge(
array_merge(array_merge(
array_merge($data,[0=>$superSignData]),[0=>$offcialData])),[0=>$spreadData],[0=>$sumData])),[0=>$payTypeDataExport]),[0=>$channelDataExport]),'支付渠道统计导出',$title);
@ -296,8 +309,9 @@ class PayChannelController extends ThinkController
$this->meta_title = "支付渠道统计";
$size = $row;//每页显示的记录数
$data = array_slice($data, ($arraypage - 1) * $size, $size);
//平台币直充金额,下面列表
$this->assign('coinSum',$coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost);
$this->assign('coinSum',$coinSum);
$this->assign('sumData',$sumData);
$this->assign('channelData',$channelData);
@ -374,6 +388,26 @@ class PayChannelController extends ThinkController
->where($map)
->group('pay_way')
->select(false);
if ($_REQUEST['game_id']) {
if ($map['pay_way']) {
$map['tab_deposit.pay_way'] = $map['pay_way'];
unset($map['pay_way']);
}
if ($map['create_time']) {
$map['tab_deposit.create_time'] = $map['create_time'];
unset($map['create_time']);
}
$map['tab_deposit.pay_source'] = 2;
$map['tab_pay_info.extend'] = '';
$depositData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
->field('sum(pay_amount) as pay_amount,tab_deposit.pay_way as pay_way')
->where($map)
->group('tab_deposit.pay_way')
->select(false);
// var_dump($depositData);die();
}
$bindMap['pay_status'] = 1;
$bindMap['pay_way'] = array('egt',1);
@ -390,8 +424,14 @@ class PayChannelController extends ThinkController
->where($bindMap)
->select(false);
if(!$_REQUEST['game_id']) {
$sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData}";
} else {
$sql = "{$channelData} UNION ALL {$depositData}";
}
//将语句整合起来查询
$channelData = "select sum(pay_amount) as pay_amount,pay_way from ({$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData})t group by pay_way;";
$channelData = "select sum(pay_amount) as pay_amount,pay_way from ({$sql})t group by pay_way;";
// var_dump($channelData);die();
$channelData = M()->query($channelData);
@ -482,7 +522,7 @@ class PayChannelController extends ThinkController
// setPowerPromoteIds($spreadMap,'promote_id');
// $spreadMap['pay_way'] = array('egt',1);
$coin_pay_order = M('coin_pay_order','tab_')
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way")
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount,real_amount as cost,pay_way")
->where($spreadMap)
->select(false);

@ -78,21 +78,21 @@
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
</select>
</div>
<!-- <div class="input-list search_item input-list-gamenoticestatus">-->
<!-- <select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">-->
<!-- <option value="">请选择推广员等级</option>-->
<!-- <option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>-->
<!-- <option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>-->
<!-- <option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>-->
<!-- <option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>-->
<!-- </select>-->
<!-- - -->
<!-- </div>-->
<!-- <div class="input-list search_item input-list-gamenoticestatus">-->
<!-- <select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">-->
<!-- <option value="">请选择推广员</option>-->
<!-- </select>-->
<!-- </div>-->
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">

File diff suppressed because it is too large Load Diff

@ -176,36 +176,38 @@
</td>
</tr>
</volist>
<tr>
<td><span>超级签</span></td>
<td ><span><if condition="$superSignData.pay_amount neq ''">{$superSignData['pay_amount']}<else/>0</if></span></td>
<td>0</td>
<td><span><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$superSignData.test_coin neq ''">{$superSignData.test_coin}<else/>0</if></a></span></td>
<td><if condition="$superSignData.pay_amount neq ''">{$superSignData['sum']}<else/>0</if></td>
<td>
<a href="{:U('SuperStatistical/index',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
<tr>
<td><span>官网</span></td>
<td >0</td>
<td>{$offcialData['pay_amount']}</td>
<td><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$offcialData.test_coin neq ''">{$offcialData.test_coin}<else/>0</if></a></td>
<td><if condition="$offcialData.pay_amount neq ''">{$offcialData['sum']}<else/>0</if></td>
<td>
<a href="{:U('PayChannel/gameDetail',array_merge(array('id'=>21,'model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
<tr>
<td><span>推广后台</span></td>
<td ><span>0</span></td>
<td>{$spreadData['pay_amount']}</td>
<td>0</td>
<td><if condition="$spreadData['pay_amount'] neq ''">{$spreadData['sum']}<else/>0</if></td>
<td>
<a href="{:U('PayChannel/gameDetail',array_merge(array('id'=>21,'model'=>'coin_pay_order','game_name'=>'推广后台'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
<if condition="$_GET['game_id'] eq ''">
<tr>
<td><span>超级签</span></td>
<td ><span><if condition="$superSignData.pay_amount neq ''">{$superSignData['pay_amount']}<else/>0</if></span></td>
<td>0</td>
<td><span><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$superSignData.test_coin neq ''">{$superSignData.test_coin}<else/>0</if></a></span></td>
<td><if condition="$superSignData.pay_amount neq ''">{$superSignData['sum']}<else/>0</if></td>
<td>
<a href="{:U('SuperStatistical/index',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
<tr>
<td><span>官网</span></td>
<td >0</td>
<td>{$offcialData['pay_amount']}</td>
<td><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$offcialData.test_coin neq ''">{$offcialData.test_coin}<else/>0</if></a></td>
<td><if condition="$offcialData.pay_amount neq ''">{$offcialData['sum']}<else/>0</if></td>
<td>
<a href="{:U('PayChannel/gameDetail',array_merge(array('id'=>21,'model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
<tr>
<td><span>推广后台</span></td>
<td ><span>0</span></td>
<td>{$spreadData['pay_amount']}</td>
<td>0</td>
<td><if condition="$spreadData['pay_amount'] neq ''">{$spreadData['sum']}<else/>0</if></td>
<td>
<a href="{:U('PayChannel/gameDetail',array_merge(array('id'=>21,'model'=>'coin_pay_order','game_name'=>'推广后台'),I('get.'),['p'=>1]))}" >订单查看</a>
</td>
</tr>
</if>
<tr>
<td><span>汇总</span></td>
<td ><span><if condition="$sumData.pay_amount neq ''">{$sumData['pay_amount']}<else/>0</if></span></td>
@ -225,7 +227,7 @@
{$key}{$payTypeData} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</if>
</volist>
平台币直充金额<span style="color: red">(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0</if>
平台币直充金额<span style="color: red">(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0</if>
</td>
</tr>
<tr>

@ -83,7 +83,7 @@
<div class="input-list input-list-spend search_label_rehab">
<select id="pay_way_id" name="pay_way" class="select_gallery" style="width:120px;">
<option value="">充值方式</option>
<volist name=":all_pay_way(1)" id="vo">
<volist name=":all_pay_way_other(1)" id="vo">
<option value="{$vo.key}">{$vo.value}</option>
</volist>
</select>

@ -35,10 +35,12 @@
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<a class="sch-btn" href="{:U('PayChannel/index')}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
</div>
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="开始时间"/>

@ -97,11 +97,11 @@
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="pay_way" style="color:#444" class="select_gallery" id="promote_id">
<select id='pay_way' name="pay_way" style="color:#444" class="select_gallery" >
<option value="">支付方式</option>
<option value="0" <?php if (isset($_GET['pay_way']) && $_GET['pay_way'] == 0):?>selected<?php endif;?>>未知</option>
<option value="1" <?php if ($_GET['pay_way'] == 1):?>selected<?php endif;?>>支付宝</option>
<option value="2" <?php if ($_GET['pay_way'] == '2'):?>selected<?php endif;?>>微信</option>
<volist name=":all_pay_way(1)" id="vo">
<option value="{$vo.key}" <?php echo isset($_GET['pay_way']) && $_GET['pay_way'] == $vo['key'] ?'selected':''; ?> >{$vo.value}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">

@ -3238,10 +3238,15 @@ class DownloadController extends BaseController {
$roles = M()->alias('record')
->table($subQuery)
->select();
$total = M('spend','tab_')->alias('uc')
->field("$fieldS,$fieldToday as recharge_cost_today")
$total = M('spend', 'tab_')->alias('uc')
->field($fieldS)
->where($map)
->find();
$map['uc.pay_time'] = $spendMap['today.pay_time'];
$total['recharge_cost_today'] = M('spend', 'tab_')->alias('uc')
->field('sum(uc.pay_amount) as recharge_cost_today')
->where($map)
->find()['recharge_cost_today'];
$total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' :$total['recharge_cost_today'];
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers

@ -1873,9 +1873,14 @@ class QueryController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
$total = M('spend', 'tab_')->alias('s')
->field("$fieldS, $fieldToday as recharge_cost_today")
->field($fieldS)
->where($map)
->find();
$map['s.pay_time'] = $spendMap['today.pay_time'];
$total['recharge_cost_today'] = M('spend', 'tab_')->alias('s')
->field('sum(s.pay_amount) as recharge_cost_today')
->where($map)
->find()['recharge_cost_today'];
$total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' : $total['recharge_cost_today'];
if (!empty($records)) {

@ -5,7 +5,7 @@
<meta itemprop="image" content="{$game['icon']}"/>
<meta name="description" itemprop="description" content="{$game['features']}"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="{:get_cover(C('CH_SET_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<script src="__JS__/jquery-1.11.3.min.js"></script>
@ -280,7 +280,7 @@
<?php else:?>
<div class="blue-btn" onclick="layer.msg('该游戏已关闭下载');">¥10至尊下载</div>
<div class="blue-btn stabilization" onclick="layer.msg('该游戏已关闭下载');">beta版下载</div>
<div class="blue-btn" onclick="layer.msg('该游戏已关闭下载');">beta版下载</div>
<div class="gray-btn down-link" onclick="layer.msg('该游戏已关闭下载');return false;" down-link="{$downloadUrl}">普通下载</div>
<?php endif;?>
</div>
@ -467,7 +467,7 @@
<div class="register-forget">
<div>
<div style="color:#292929;font-size: 0.22rem;">注册即表示同意</div>
<span>《用户协议》</span>
<span><a href="/mobile.php?s=/News/protocol.html">《用户协议》</a></span>
</div>
<div class="phoneCut">
<img src="__IMG__/20191225/qiehuan.png" alt="">
@ -501,7 +501,7 @@
<div class="register-forget">
<div>
<div style="color:#292929;font-size: 0.22rem;">注册即表示同意</div>
<span>《用户协议》</span>
<span><a href="/mobile.php?s=/News/protocol.html">《用户协议》</a></span>
</div>
<div class="commonCut">
<img src="__IMG__/20191225/qiehuan.png" alt="">
@ -520,12 +520,12 @@
<div class="mounting-text">
<div class="title-one">
第一步下载苹果官方TestFlight
<a href="https://apps.apple.com/cn/app/testflight/id899247664"><img src="__IMG__/20191225/biaoshi.png" alt=""></a>
<img src="__IMG__/20191225/biaoshi.png" alt="">
</div>
<div class="one-contain">
首次安装必须<span>打开应用</span>,并点击<span>“继续”</span>按钮后,才可进行第二步操作
</div>
<a href="#" class="mounting-btn">点击安装TestFlight平台</a>
<a href="https://itunes.apple.com/cn/app/testflight/id899247664?mt=8" target="_blank" class="mounting-btn">点击安装TestFlight平台</a>
<div class="title-two">第二步:点击下方按钮安装游戏</div>
<a id="beta-url" href="#" class="mounting-btn">点击安装游戏</a>
</div>
@ -534,9 +534,11 @@
</body>
</html>
<script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script>
<script src="__STATIC__/js.cookie.min.js"></script>
<script>
var gameId = parseInt("{$game.id}");
var promoteId = parseInt("{$promoteId}");
var isLogin = Cookies.get('is_landing_login') == undefined ? false : true;
var PhoneObj = {
i:60,
codeflag: true,
@ -611,7 +613,11 @@ var PhoneObj = {
$(function(){
$(".stabilization").click(function(){
event.stopPropagation();
$(".login").show();
if (isLogin) {
showMounting()
} else {
$(".login").show();
}
$(".window").hide();
});
$(".login .register-heard>a").click(function(){
@ -723,6 +729,7 @@ var PhoneObj = {
},
success: function (result) {
if (result.code == '0000') {
setLoginStatus()
$(".phone").hide();
showMounting()
} else {
@ -732,6 +739,13 @@ var PhoneObj = {
})
})
function setLoginStatus()
{
var expireTime = new Date(new Date().getTime() + 10 * 60 * 1000);
Cookies.set('is_landing_login', 1, { expires: expireTime })
isLogin = true;
}
function showMounting()
{
$('.mounting').show();
@ -776,6 +790,7 @@ var PhoneObj = {
cache: false,
success: function (result) {
if (result.code == '0000') {
setLoginStatus()
$('.login').hide();
showMounting()
} else {
@ -822,6 +837,7 @@ var PhoneObj = {
},
success: function (result) {
if (result.code == '0000') {
setLoginStatus()
$(".common").hide();
showMounting()
} else {

@ -56,7 +56,7 @@ class CommonController extends BaseController {
$this->respondError($resMsg);
}
// $_SESSION['user_id'] = $userId;
$_SESSION['user_id'] = $userId;
$user = M('user', 'tab_')->where(['id' => $userId])->find();
if (!$user['promote_id'] && $promote) {
M('user', 'tab_')->where(['id' => $userId])->save([
@ -114,7 +114,8 @@ class CommonController extends BaseController {
//添加自动登录
$userApi = new MemberApi();
$userId = $userApi->login($params['account'], $params['password'],1);
$userId = $userApi->login($params['account'], $params['password'], 1);
$_SESSION['user_id'] = $userId;
$this->respondSuccess('添加成功');
}
@ -157,7 +158,8 @@ class CommonController extends BaseController {
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($account, $password, 1);
$userId = $userApi->login($account, $password, 1);
$_SESSION['user_id'] = $userId;
$this->respondSuccess('注册成功');
}

@ -0,0 +1,2 @@
/*! js-cookie v3.0.0-beta.3 | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,r=e.Cookies=t();r.noConflict=function(){return e.Cookies=n,r}}())}(this,function(){"use strict";var e={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}return function n(r,o){function i(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=t({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),n=r.write(n,e),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=e+"="+n+c}}return Object.create({set:i,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=e.read(c[0]);if(o[f]=r.read(u,f),t===f)break}catch(e){}}return t?o[t]:o}},remove:function(e,n){i(e,"",t({},n,{expires:-1}))},withAttributes:function(e){return n(this.converter,t({},this.attributes,e))},withConverter:function(e){return n(t({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}(e,{path:"/"})});
Loading…
Cancel
Save