From c4a78b46c8b7cee68bf031cbd991d6a72f6527ba Mon Sep 17 00:00:00 2001 From: limu Date: Mon, 18 Dec 2023 16:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BB=BB=E5=8A=A1=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/command/dayValue.php | 42 ++++++++++++++++++ config/console.php | 2 + config/partner.php | 78 +++++++++++++++++----------------- crmeb/jobs/OrderPartnerJob.php | 7 ++- 4 files changed, 88 insertions(+), 41 deletions(-) create mode 100644 app/command/dayValue.php diff --git a/app/command/dayValue.php b/app/command/dayValue.php new file mode 100644 index 0000000..3a4f543 --- /dev/null +++ b/app/command/dayValue.php @@ -0,0 +1,42 @@ +setName('dayValue') + ->addArgument('dayValue', Argument::OPTIONAL, 'php think menu [1] / [2]') + ->setDescription('社区等级结算'); + } + + protected function execute(Input $input, Output $output) + { + + } + + +} diff --git a/config/console.php b/config/console.php index a85141c..5f51478 100644 --- a/config/console.php +++ b/config/console.php @@ -39,5 +39,7 @@ return [ 'change:hotTop' => 'app\command\changeHotTop', //各种积分转换 'brand' => 'app\command\brand', + //社区贡献值结算 + 'dayValue' => 'app\command\dayValue', ], ]; diff --git a/config/partner.php b/config/partner.php index 4c20e0d..92b3727 100644 --- a/config/partner.php +++ b/config/partner.php @@ -16,21 +16,20 @@ return [ // 社区等级配置 'community_level' => [ [ - 'alias' => '一星社区服务商 ', - 'level_name' => 'S1', - 'min_price' => '30000', + 'alias' => '七星社区服务商 ', + 'level_name' => 'S7', + 'min_price' => '100000000', 'pay_community' => '0.03', - ], - [ - 'alias' => '二星社区服务商 ', - 'level_name' => 'S2', - 'min_price' => '300000', + ], [ + 'alias' => '六星社区服务商 ', + 'level_name' => 'S6', + 'min_price' => '10000000', 'pay_community' => '0.03', ], [ - 'alias' => '三星社区服务商 ', - 'level_name' => 'S3', - 'min_price' => '100000', + 'alias' => '五星社区服务商 ', + 'level_name' => 'S5', + 'min_price' => '10000000', 'pay_community' => '0.03', ], [ @@ -38,46 +37,45 @@ return [ 'level_name' => 'S4', 'min_price' => '3000000', 'pay_community' => '0.03', - ], - [ - 'alias' => '五星社区服务商 ', - 'level_name' => 'S5', - 'min_price' => '10000000', + ], [ + 'alias' => '三星社区服务商 ', + 'level_name' => 'S3', + 'min_price' => '100000', 'pay_community' => '0.03', ], [ - 'alias' => '六星社区服务商 ', - 'level_name' => 'S6', - 'min_price' => '10000000', + 'alias' => '二星社区服务商 ', + 'level_name' => 'S2', + 'min_price' => '300000', 'pay_community' => '0.03', ], [ - 'alias' => '七星社区服务商 ', - 'level_name' => 'S7', - 'min_price' => '100000000', + 'alias' => '一星社区服务商 ', + 'level_name' => 'S1', + 'min_price' => '30000', 'pay_community' => '0.03', ], ], //品牌代理商等级配置 'brand_level' => [ [ - 'alias' => '品牌体验官', - 'level_name' => 'B1', - 'min_price' => '10000', + 'alias' => '全球品牌代言人', + 'level_name' => 'B7', + 'min_price' => '1000000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], [ - 'alias' => '品牌推荐官', - 'level_name' => 'B2', - 'min_price' => '30000', + 'alias' => '亚太区品牌代言人', + 'level_name' => 'B6', + 'min_price' => '500000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], [ - 'alias' => '品牌推广大使', - 'level_name' => 'B3', - 'min_price' => '50000', + 'alias' => '中国区品牌代言人', + 'level_name' => 'B5', + 'min_price' => '300000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], @@ -89,23 +87,23 @@ return [ 'promotion_community' => '0.1' ], [ - 'alias' => '中国区品牌代言人', - 'level_name' => 'B5', - 'min_price' => '300000', + 'alias' => '品牌推广大使', + 'level_name' => 'B3', + 'min_price' => '50000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], [ - 'alias' => '亚太区品牌代言人', - 'level_name' => 'B6', - 'min_price' => '500000', + 'alias' => '品牌推荐官', + 'level_name' => 'B2', + 'min_price' => '30000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], [ - 'alias' => '全球品牌代言人', - 'level_name' => 'B7', - 'min_price' => '1000000', + 'alias' => '品牌体验官', + 'level_name' => 'B1', + 'min_price' => '10000', 'pay_community' => '0.3', 'promotion_community' => '0.1' ], diff --git a/crmeb/jobs/OrderPartnerJob.php b/crmeb/jobs/OrderPartnerJob.php index 1050cf5..57ffe17 100644 --- a/crmeb/jobs/OrderPartnerJob.php +++ b/crmeb/jobs/OrderPartnerJob.php @@ -72,6 +72,7 @@ class OrderPartnerJob implements JobInterface $mian_flowing = bcadd($mian_flowing, $prodcut_temp[$v['product_id']]['product_price'], 2); $mian_rate = bcdiv($prodcut_temp[$v['product_id']]['product_price'], $data['pay_price'], 3); $mian_price = bcmul($data['commission_rate'], $mian_rate, 2); + $mian_flowing = bcadd($mian_flowing, $mian_price, 2); $mian_price = bcmul($mian_price, 0.667, 2); $total_price = bcadd($total_price, $mian_price, 2); } @@ -82,6 +83,7 @@ class OrderPartnerJob implements JobInterface $ping_flowing = bcadd($ping_flowing, $prodcut_temp[$v['product_id']]['product_price'], 2); $ping_rate = bcdiv($prodcut_temp[$v['product_id']]['product_price'], $data['pay_price'], 3); $ping_price = bcmul($data['commission_rate'], $ping_rate, 2); + $ping_flowing = bcadd($ping_flowing, $ping_price, 2); $ping_price = bcmul($ping_price, 0.667, 2); $total_price = bcadd($total_price, $ping_price, 2); } @@ -132,6 +134,8 @@ class OrderPartnerJob implements JobInterface 'street_id' => $address['street_id'] ?? '', 'created_time' => date('Y-m-d H:i:s'), 'baodan_liushui' => $bao_flowing, + 'miandan_liushui' => $mian_flowing, + 'ping_liushui' => $ping_flowing, ]; StoreOrderContribute::getDB()->insert($contribute_insert); //订单角色贡献值-30% @@ -275,7 +279,7 @@ class OrderPartnerJob implements JobInterface ->where('is_area', 0) ->where('status', 1) ->select()->toArray(); - $role_ids = array_column($common_roles, 'id', ); + $role_ids = array_column($common_roles, 'id'); $common_trade_data = array_column($common_roles, null,'id'); $user_list = User::getDB()->alias('u') ->leftJoin('UserPartner p', 'u.uid = p.uid') @@ -310,6 +314,7 @@ class OrderPartnerJob implements JobInterface //批量增加用户贡献值日志 ValueContributionLog::getDB()->insertAll($user_log_data); + //社区等级判断 echo 'ok'; } catch (\Exception $e) { Log::info('订单角色贡献值处理失败; error : ' . $e->getMessage());