feat: 根据订单价格调整会员积分计算逻辑
This commit is contained in:
parent
37f0de8c37
commit
0dd6f94171
@ -20,7 +20,26 @@ class UserSignLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function dealRechargeFrozen($user, $order, $user_ship = 0)
|
public static function dealRechargeFrozen($user, $order, $user_ship = 0)
|
||||||
{
|
{
|
||||||
$total_vip = bcmul($order['price'], 0.1, 2);
|
switch ($order['price']) {
|
||||||
|
case ($order['price'] >= 1000 && $order['price'] < 2000):
|
||||||
|
$total_vip = bcmul($order['price'], 0.25, 2);
|
||||||
|
break;
|
||||||
|
case ($order['price'] >= 2000 && $order['price'] < 5000):
|
||||||
|
$total_vip = bcmul($order['price'], 0.28, 2);
|
||||||
|
break;
|
||||||
|
case ($order['price'] >= 5000 && $order['price'] < 10000):
|
||||||
|
$total_vip = bcmul($order['price'], 0.31, 2);
|
||||||
|
break;
|
||||||
|
case ($order['price'] >= 10000):
|
||||||
|
$total_vip = bcmul($order['price'], 0.35, 2);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$total_vip = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if($total_vip==0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$count = UserSign::where('uid', $order->uid)->count();
|
$count = UserSign::where('uid', $order->uid)->count();
|
||||||
if ($count == 0 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) {
|
if ($count == 0 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) {
|
||||||
//首充
|
//首充
|
||||||
|
Loading…
x
Reference in New Issue
Block a user