原后台修改

This commit is contained in:
wanyongkang
2020-11-04 15:40:58 +08:00
parent b4e7f828d7
commit 0b433f8731
2 changed files with 70 additions and 57 deletions

View File

@@ -5,7 +5,7 @@
* @Author: kangkang
* @Date: 2020-10-03 18:23:43
* @LastEditors: kangkang
* @LastEditTime: 2020-11-02 15:15:16
* @LastEditTime: 2020-11-03 15:05:26
*/
$is_script = 1;
include __DIR__ . '/../index.php';
@@ -158,7 +158,7 @@ $list['qiangzi'] = $yesterday_data['qiangzi'] - $qiangzi_rule_result['cost'] + $
$list['xunlian'] = $yesterday_data['xunlian'] - $xunlian_rule_result['cost'] + $xunlian_rule_result['refund'] + ($buyi_data['xunlian'] ?? 0);
$tiantian_rule_result = tl_rule($tiantian, $tiantian_refund);
$laoying_rule_result = tl_rule($laoying, $laoying_refund);
$laoying_rule_result = tl_rule($laoying, $laoying_refund, true);
$list['tiantian'] = $yesterday_data['tiantian'] - $tiantian_rule_result['cost'] + $tiantian_rule_result['refund'] + ($buyi_data['tiantian'] ?? 0);
$list['laoying'] = $yesterday_data['laoying'] - $laoying_rule_result['cost'] + $laoying_rule_result['refund'] + ($buyi_data['laoying'] ?? 0);
@@ -166,7 +166,7 @@ $xianfeng_rule_result = xianfeng($xianfeng, $xianfeng_refund);
$list['xianfeng'] = $yesterday_data['xianfeng'] - $xianfeng_rule_result['cost'] + $xianfeng_rule_result['refund'] + ($buyi_data['xianfeng'] ?? 0);
$jinrui_rule_result = jinrui($jinrui, $jinrui_refund);
$list['jinrui'] = $yesterday_data['jinrui'] - $jinrui_rule_result['cost'] + $xianfeng_rule_result['refund'] + ($buyi_data['jinrui'] ?? 0);
$list['jinrui'] = $yesterday_data['jinrui'] - $jinrui_rule_result['cost'] + $jinrui_rule_result['refund'] + ($buyi_data['jinrui'] ?? 0);
$list['riqi'] = date('Y-m-d H:i:s');
@@ -228,7 +228,7 @@ function no_jike($product)
//强子,讯连规则
function qx_rule($product, $refunds, $product_type = true)
{
$tian = $product_type ? 10 : 12;
$tian = 12;
$cost = 0;
foreach ($product as $package) {
switch ($package['PackageName']) {
@@ -289,8 +289,9 @@ function qx_rule($product, $refunds, $product_type = true)
return $count;
}
//天天,老鹰退款规则
function tl_rule($product, $refunds)
function tl_rule($product, $refunds, $product_type = false)
{
$month = $product_type ? 40 : 30;
$cost = 0;
foreach ($product as $package) {
switch ($package['PackageName']) {
@@ -338,10 +339,10 @@ function tl_rule($product, $refunds)
}
break;
case '月卡':
if ((86400 * 30 - handle_time($info['RefundRestTime'])) < 1800) {
if ((86400 * $month - handle_time($info['RefundRestTime'])) < 1800) {
$refund += $info['ConnectCount'] * 60;
} else {
$refund += $info['ConnectCount'] * 60 - ceil((86400 * 30 - handle_time($info['RefundRestTime']))/86400) * $info['ConnectCount'] * 4;
$refund += $info['ConnectCount'] * 60 - ceil((86400 * $month - handle_time($info['RefundRestTime']))/86400) * $info['ConnectCount'] * 4;
}
break;
case '季卡':
@@ -464,7 +465,7 @@ function jinrui($product, $refunds)
}
$refund = 0;
foreach ($refunds as $info) {
$refund += handle_time($info['RefundRestTime']) / 86400 * 2 * $info['ConnectCount'];
$refund += intval(handle_time($info['RefundRestTime']) / 86400) * 2 * $info['ConnectCount'];
}
$count['cost'] = $cost;
$count['refund'] = $refund;