2.5.1更新

This commit is contained in:
2021-07-16 23:22:22 +08:00
parent 6309728f42
commit 14e57cf160
9 changed files with 66 additions and 63 deletions

View File

@ -28,14 +28,14 @@ class Settlements extends Base
$totalMoney = $order->realTotalMoney;//产品额
if(2 != $order->goodsType){//助微吧商品不给购户券值
// 购户的所得分配
// 1,购户获得预获产品券为产品额的100% buyerPreProductInProductScale
// 1,购户获得购物股为产品额的100% buyerPreProductInProductScale
// 2,购户获得预获优惠券为优惠款的50% buyerPreCoupousInSaleScale
// 3,获得预获产品券为被扣手续费的100% buyerPreProductInHandlingFeeScale
// 4,获得预获产品券为被扣税费的100% buyerPreProductInTaxFeeScale
// 5,获得预获产品券为被扣手续费的100% buyerPreProductInProductHandlingFeeScale
// 6,获得预获产品券为被扣税费的100% buyerPreProductInProductTaxFeeScale
// 3,获得购物股为被扣手续费的100% buyerPreProductInHandlingFeeScale
// 4,获得购物股为被扣税费的100% buyerPreProductInTaxFeeScale
// 5,获得购物股为被扣手续费的100% buyerPreProductInProductHandlingFeeScale
// 6,获得购物股为被扣税费的100% buyerPreProductInProductTaxFeeScale
// 购户获得预获产品券最高占产品额比例?%
// 购户获得购物股最高占产品额比例?%
// $buyerPreProductNum = round(($totalMoney + $order->deliverMoney),5);//1
$buyerPreProductNum = round(($discountMoney * (dataConf('couponPercentCanUsetGet')*0.01)),5);//1
$buyerMaxCouponsNum = round(($totalMoney)* (dataConf('buyerPreProductInProductScale')*0.01),5);//1
@ -58,7 +58,7 @@ class Settlements extends Base
// 商户的所得分配
// 1,商户获得预获产品券占优惠款比例 100% sellerPreProductInProductScale
// 1,商户获得购物股占优惠款比例 100% sellerPreProductInProductScale
// 2,商户获得预获优惠券占优惠款比例 100% sellerPreCoupousInSaleScale
// 3,优惠款-产品-优惠券-旺旺券,大于0是商户需付公司的钱,小于0是公司需付给商户的钱,即旺旺券
// $discountMoney-$order->productNum-$order->couponsNum-$order->wangNum-$order->moneyNum
@ -66,7 +66,7 @@ class Settlements extends Base
$sellerPreCoupousNum = round($discountMoney * (dataConf('sellerPreCoupousInSaleScale')*0.01),5);//2
if($sellerPreProductNum >= 0.01 || $sellerPreCoupousNum>=0.01){
if(3 != $order->goodsType){
// step 3 平台送商户:10000×0.4=4000“预获产品券
// step 3 平台送商户:10000×0.4=4000“购物股
// 10000×0.4=4000“预获优惠券”
Model('common/UserVouchers')->insertVouchersNotice($shops['userId'], $orderId, $calBaseNum, $calBaseNum,
'订单【'.$order->orderNo.'】商户售物所得',1);
@ -80,8 +80,8 @@ class Settlements extends Base
}else{
$toCalBaseNum = $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100);
}
// step 4 平台送商户的推荐人:当消费超过限制值时10000×0.4×0.5×0.5=1000“预获产品券”。
// 当消费低于限制值时10000×0.4×0.5×0.2=400“预获产品券”。
// step 4 平台送商户的推荐人:当消费超过限制值时10000×0.4×0.5×0.5=1000“购物股”。
// 当消费低于限制值时10000×0.4×0.5×0.2=400“购物股”。
$uUserId = UserTrees::getUpperId($shops["userId"]);
if($uUserId == null || $uUserId == 0){$uUserId = 1;}
$data = Db::query('SELECT sum(`goodsMoney`) as `total` FROM `hyh_orders` WHERE DATE_FORMAT(`createTime`,"%Y%m%d")=DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 day),"%Y%m%d") and `userId`="'.$uUserId.'"');
@ -100,10 +100,10 @@ class Settlements extends Base
$someCalBaseNum/sizeof($childes), 0,
'订单【'.$order['orderNo'].'】被商户推荐人推荐所得',1);
}
// step 6 平台送自己的推荐人:当消费超过限制值时10000×0.4×0.5×0.5=1000“预获产品券”;
// 当消费低于限制值时10000×0.4×0.5×0.2=400“预获产品券”。
// step 6 平台送自己的推荐人:当消费超过限制值时10000×0.4×0.5×0.5=1000“购物股”;
// 当消费低于限制值时10000×0.4×0.5×0.2=400“购物股”。
// 推荐人的推荐所得是指:推荐人推荐的购户购物后的推荐所得,和推荐人推荐的商户售物后的推荐所得
// 购户均衡获得预获产品券是推荐人的推荐所得的? %
// 购户均衡获得购物股是推荐人的推荐所得的? %
$uUserId = UserTrees::getUpperId($order['userId']);
if($uUserId == null || $uUserId == 0){$uUserId = 1;}
$data = Db::query('SELECT sum(`goodsMoney`) as `total` FROM `hyh_orders` WHERE DATE_FORMAT(`createTime`,"%Y%m%d")=DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 day),"%Y%m%d") and `userId`="'.$uUserId.'"');
@ -115,11 +115,11 @@ class Settlements extends Base
}
Model('common/UserVouchers')->insertVouchersNotice($uUserId, $orderId,$someCalBaseNum,
0,'订单【'.$order['orderNo'].'】推荐购户所得',1);
// step 7 平台送自己的被推荐人:10000×0.4×0.5×0.5÷5=200“预获产品券”。
// step 7 平台送自己的被推荐人:10000×0.4×0.5×0.5÷5=200“购物股”。
$childes = DB::table("hyh_user_trees")->where(["pid"=>$order['userId']])->field("uid")->select();
foreach ($childes as $child){
// 推荐人的推荐所得是指:推荐人推荐的购户购物后的推荐所得,和推荐人推荐的商户售物后的推荐所得
// 购户均衡获得预获产品券是推荐人的推荐所得的? %
// 购户均衡获得购物股是推荐人的推荐所得的? %
// balanceTjrGet
$toCalBaseNum *= ((float)dataConf('balanceTjrGet')/100);
Model('common/UserVouchers')->insertVouchersNotice($child['uid'], $orderId,
@ -205,9 +205,9 @@ class Settlements extends Base
}
//推荐人所得
// 1,推荐人获得预获产品券时限上日有消费≥10元为优惠款的50%。
// 1,推荐人获得购物股时限上日有消费≥10元为优惠款的50%。
// refPreProductYdGTMoney refPreProductYesInSaleScale
// 2,推荐人获得预获产品券时限上日有消费<10元为优惠款的25% refPreProductNoInSaleScale
// 2,推荐人获得购物股时限上日有消费<10元为优惠款的25% refPreProductNoInSaleScale
// 20200114 -- 说用不上,注释
// $m->setTable('user_trees');
// $pid = $m->getField(['uid'=>$shops['userId']],'pid');