|
@@ -149,7 +149,7 @@ class CalcPrice implements ICalc
|
|
|
|
|
|
}
|
|
|
elseif($this->mCalcType == self::CalcTypeInvitees) {
|
|
|
- $this->deduct_invitees();
|
|
|
+ $this->deduct_invitees($order_id);
|
|
|
}
|
|
|
else {
|
|
|
|
|
@@ -217,26 +217,29 @@ class CalcPrice implements ICalc
|
|
|
|
|
|
public function inviter_tips()
|
|
|
{
|
|
|
- if($this->mCalcType != self::CalcTypeInvitees) return '';
|
|
|
-
|
|
|
- $left_invitees = $this->mInvitees - $this->mMemberInfo->used_invitees();
|
|
|
-
|
|
|
- $cur = [];
|
|
|
- $next = [];
|
|
|
- foreach (self::STEP_PRICE_ITEMS as $item)
|
|
|
+ if($this->mCalcType == self::CalcTypeNormal || $this->mCalcType != self::CalcTypeInvitees)
|
|
|
{
|
|
|
- $num = $item['num'];
|
|
|
- if($left_invitees >= $num) {
|
|
|
- $cur = $item;
|
|
|
- } else {
|
|
|
- $next = $item;
|
|
|
+ $left_invitees = $this->mInvitees - $this->mMemberInfo->used_invitees();
|
|
|
+
|
|
|
+ $cur = [];
|
|
|
+ $next = [];
|
|
|
+ foreach (self::STEP_PRICE_ITEMS as $item)
|
|
|
+ {
|
|
|
+ $num = $item['num'];
|
|
|
+ if($left_invitees >= $num) {
|
|
|
+ $cur = $item;
|
|
|
+ } else {
|
|
|
+ $next = $item;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- $count = $next['num'] - $left_invitees;
|
|
|
- $discount = $next['discount'] * 100;
|
|
|
- $tip = "再邀请{$count}人,可享受{$discount}折扣";
|
|
|
+ $count = $next['num'] - $left_invitees;
|
|
|
+ $discount = $next['discount'] * 100;
|
|
|
+ $tip = "再邀请{$count}人,即可享受{$discount}折扣";
|
|
|
|
|
|
- return $tip;
|
|
|
+ return $tip;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function calc_vgoods_price($goods_info)
|