diff --git a/enum/product/Product.php b/enum/product/Product.php index de9e5fb..4bdeb5a 100644 --- a/enum/product/Product.php +++ b/enum/product/Product.php @@ -31,6 +31,7 @@ class Product 16 => '实惠IP', 17 => '西瓜IP', 18 => '蘑菇IP', + 18 => '火狐IP', ]; public static $qiangzi = 1; @@ -51,9 +52,10 @@ class Product public static $shihui = 16; public static $xigua = 17; public static $mogu = 18; + public static $huohu = 19; - //强子、讯连 - public static $qx = [1, 2]; + //强子、讯连、火狐 + public static $qx = [1, 2, 19]; //天天老鹰先锋 金瑞 蘑菇 public static $tlxj = [4, 5, 6, 14,18]; diff --git a/script/finance_check_script.php b/script/finance_check_script.php index b5a6085..43837b9 100644 --- a/script/finance_check_script.php +++ b/script/finance_check_script.php @@ -54,7 +54,7 @@ ProductId, PackageName, $data = $product_order_model->field($fields)->where(array_merge($where2, ['OrderState' => ['in', $product_order_enum::$PayComplete]]))->where($where1)->group(['ProductId', 'PackageName'])->fetchAll(); -$qiangzi = $xunlian = $jinqiao = $jinrui = $laoying = $xianfeng = $wujin = $xingxing = $wanmei = $wuxian = $jike = $tiantian = $gongxiang = $shihui = $xigua = $mogu = []; +$qiangzi = $xunlian = $jinqiao = $jinrui = $laoying = $xianfeng = $wujin = $xingxing = $wanmei = $wuxian = $jike = $tiantian = $gongxiang = $shihui = $xigua = $mogu = $huohu = []; foreach ($data as $product) { switch ($product['ProductId']) { @@ -106,6 +106,9 @@ foreach ($data as $product) { case $product_enum::$mogu: $mogu[] = $product; break; + case $product_enum::$huohu: + $huohu[] = $product; + break; } } @@ -114,6 +117,7 @@ $qx_where = array_merge($where2, ['ProductId' => ['in', $product_enum::$qx], 'Or $refund_qx_info = $product_order_model->field('ProductId,PackageName,RefundRestTime')->where($qx_where)->where($where1)->fetchAll(); $qiangzi_refund = []; $xunlian_refund = []; +$huohu_refund = []; foreach ($refund_qx_info as $info) { switch ($info['ProductId']) { case $product_enum::$qiangzi: @@ -122,6 +126,9 @@ foreach ($refund_qx_info as $info) { case $product_enum::$xunlian: $xunlian_refund[] = $info; break; + case $product_enum::$huohu: + $huohu_refund[] = $info; + break; } } @@ -165,8 +172,10 @@ $list['gongxiang'] = $yesterday_data['gongxiang'] - no_jike($gongxiang) + ($buyi $qiangzi_rule_result = qx_rule($qiangzi, $qiangzi_refund, false); $xunlian_rule_result = xunlian($xunlian, $xunlian_refund); +$huohu_rule_result = huohu($huohu, $huohu_refund); $list['qiangzi'] = $yesterday_data['qiangzi'] - $qiangzi_rule_result['cost'] + $qiangzi_rule_result['refund'] + ($buyi_data['qiangzi'] ?? 0); $list['xunlian'] = $yesterday_data['xunlian'] - $xunlian_rule_result['cost'] + $xunlian_rule_result['refund'] + ($buyi_data['xunlian'] ?? 0); +$list['huohu'] = $yesterday_data['huohu'] - $huohu_rule_result['cost'] + $huohu_rule_result['refund'] + ($buyi_data['huou'] ?? 0); $tiantian_rule_result = tl_rule($tiantian, $tiantian_refund); $laoying_rule_result = laoying($laoying, $laoying_refund, true); @@ -392,6 +401,51 @@ function xunlian($product, $refunds, $product_type = true) $count['refund'] = $refund; return $count; } +function huohu($product, $refunds, $product_type = true) +{ + $cost = 0; + foreach ($product as $package) { + switch ($package['PackageName']) { + case '天卡': + $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 10; + + break; + case '周卡': + $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 45; + + break; + case '月卡': + $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 120; + + break; + case '季卡': + $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 330; + + break; + // case '月卡(活动)': + // $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 200; + + // break; + // case '季卡(活动)': + // $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 600; + + // break; + // case '双月卡(活动)': + // $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 400; + + // break; + case '年卡': + $cost += ($package['NewBuyCount'] + $package['AgainBuyCount']) * 1200; + + break; + } + } + $refund = 0; + + $count['cost'] = $cost; + $count['refund'] = $refund; + return $count; +} //天天,老鹰退款规则 function tl_rule($product, $refunds, $product_type = false) {