|
|
@@ -3,17 +3,16 @@
|
|
|
namespace bizHd\custom\classes;
|
|
|
|
|
|
use biz\wx\classes\WxMessageClass;
|
|
|
-use bizGhs\shop\classes\TotalDebtChangeClass;
|
|
|
use bizHd\balance\classes\BalanceChangeClass;
|
|
|
+use bizHd\balance\classes\BalanceGiveChangeClass;
|
|
|
+use bizHd\balance\classes\BalancePayChangeClass;
|
|
|
use bizHd\member\classes\MemberChangeClass;
|
|
|
use bizHd\member\classes\MemberWealClass;
|
|
|
+use bizHd\order\classes\OrderClass;
|
|
|
use bizHd\order\classes\SettleClass;
|
|
|
-use bizHd\shop\classes\MainClass;
|
|
|
use bizHd\shop\classes\ShopClass;
|
|
|
-use bizMall\user\classes\UserClass;
|
|
|
use common\components\dict;
|
|
|
use common\components\imgUtil;
|
|
|
-use common\components\noticeUtil;
|
|
|
use common\components\stringUtil;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
@@ -85,7 +84,98 @@ class CustomClass extends BaseClass
|
|
|
'mainId' => $mainId,
|
|
|
'remark' => '',
|
|
|
];
|
|
|
- return BalanceChangeClass::add($change, true);
|
|
|
+ BalanceChangeClass::add($change, true);
|
|
|
+ $order->balance = $actPrice;
|
|
|
+ $order->save();
|
|
|
+
|
|
|
+ // 多处需要同步修改 balance_pay_give
|
|
|
+ if ($hd->balancePay >= $actPrice) {
|
|
|
+ $payAmount = $actPrice;
|
|
|
+ $mustUseGiveAmount = 0;
|
|
|
+ } else {
|
|
|
+ $payAmount = $hd->balancePay;
|
|
|
+ $mustUseGiveAmount = bcsub($actPrice, $payAmount, 2);
|
|
|
+ if ($mustUseGiveAmount > $hd->balanceGive) {
|
|
|
+ util::fail('赠送余额异常,不够扣');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /************************* 充值余额 *****************************/
|
|
|
+ $customBalancePay = bcsub($custom->balancePay, $payAmount, 2);
|
|
|
+ $custom->balancePay = $customBalancePay;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalancePay = bcsub($hd->balancePay, $payAmount, 2);
|
|
|
+ $hd->balancePay = $hdBalancePay;
|
|
|
+ $hd->save();
|
|
|
+ $payChange = [
|
|
|
+ 'hdId' => $hdId,
|
|
|
+ 'hdName' => $hdName,
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'onlinePay' => 1,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $payAmount,
|
|
|
+ 'balance' => $customBalancePay,
|
|
|
+ 'io' => 0,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $shopId,
|
|
|
+ 'mainId' => $mainId,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalancePayChangeClass::add($payChange, true);
|
|
|
+ $order->payBalance = $payAmount;
|
|
|
+ $order->save();
|
|
|
+
|
|
|
+ /***************************** 赠送余额 ******************************/
|
|
|
+ //应用掉的赠送金额
|
|
|
+ if ($mustUseGiveAmount > 0) {
|
|
|
+ $customBalanceGive = bcsub($custom->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ if ($customBalanceGive < 0) {
|
|
|
+ util::fail('余额异常哈!请联系管理员,编号' . $hdId . ' ' . $custom->balanceGive);
|
|
|
+ }
|
|
|
+ $custom->balanceGive = $customBalanceGive;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalanceGive = bcsub($hd->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ $hd->balanceGive = $hdBalanceGive;
|
|
|
+ $hd->save();
|
|
|
+ if (floatval($customBalanceGive) != floatval($hdBalanceGive)) {
|
|
|
+ util::fail('余额有问题呢!请联系管理员,编号' . $hdId);
|
|
|
+ }
|
|
|
+ $giveChange = [
|
|
|
+ 'hdId' => $hdId,
|
|
|
+ 'hdName' => $hdName,
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'onlinePay' => 1,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $mustUseGiveAmount,
|
|
|
+ 'balance' => $customBalanceGive,
|
|
|
+ 'io' => 0,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $shopId,
|
|
|
+ 'mainId' => $mainId,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalanceGiveChangeClass::add($giveChange, true);
|
|
|
+ $order->giveBalance = $mustUseGiveAmount;
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
+
|
|
|
+ $addBalance = bcadd($hd->balancePay, $hd->balanceGive, 2);
|
|
|
+ if (floatval($addBalance) != floatval($custom->balance)) {
|
|
|
+ util::fail('账户余额有问题!请检查,编号' . $customId);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//会员等级变化,包括手动修改、自动降会员和充值升会员等 ssh 20250324
|
|
|
@@ -151,7 +241,9 @@ class CustomClass extends BaseClass
|
|
|
}
|
|
|
|
|
|
//客户采购欠款金额增加,如果有余额时,要进行欠款销账 ssh 20250715
|
|
|
- public static function cgDebtAmountAdd($custom, $order)
|
|
|
+ //todo 这边开欠款单时,如果还有余额,会产生结账动作,结账动作也可以用赠送余额来结账,所以要分出赠送余额的占比
|
|
|
+ //todo 结账消余额,不是下单时消余额,不涉及售后时余额回滚问题,所以不需要设置 xhOrder 的 giveBalance payBalance balance等值
|
|
|
+ public static function skCgDebtAmountAdd($custom, $order)
|
|
|
{
|
|
|
$clearAmount = 0;
|
|
|
$amount = $order->remainDebtPrice ?? 0;
|
|
|
@@ -167,14 +259,17 @@ class CustomClass extends BaseClass
|
|
|
$hdId = $custom->hdId ?? 0;
|
|
|
$hd = HdClass::getLockById($hdId);
|
|
|
if (empty($hd)) {
|
|
|
- util::fail('花店信息缺失,编号6331');
|
|
|
+ util::fail('花店信息缺失,编号6325');
|
|
|
}
|
|
|
$hdName = $hd->name ?? '';
|
|
|
+ //结账时用了多少赠送的余额
|
|
|
+ $settleUseGiveAmount = 0;
|
|
|
if ($custom->balance > 0) {
|
|
|
- if ($amount >= $custom->balance) {
|
|
|
+ if ($amount > $custom->balance) {
|
|
|
$clearAmount = $custom->balance;
|
|
|
+ $settleUseGiveAmount = $custom->balanceGive;
|
|
|
} else {
|
|
|
- $clearAmount = $amount;
|
|
|
+ util::fail('余额充足,请用余额支付');
|
|
|
}
|
|
|
}
|
|
|
if ($clearAmount > 0) {
|
|
|
@@ -186,26 +281,28 @@ class CustomClass extends BaseClass
|
|
|
$settleAmount = $ret['totalClearAmount'] ?? 0;
|
|
|
$settleNo = $set->orderSn ?? '';
|
|
|
$settleId = $set->id;
|
|
|
+ $newSettle = $ret['settle'];
|
|
|
+ //结账时用了多少赠送的余额
|
|
|
+ $newSettle->giveBalance = bcadd($newSettle->giveBalance, $settleUseGiveAmount, 2);
|
|
|
+ $newSettle->save();
|
|
|
}
|
|
|
|
|
|
+ /************************ 总余额 *********************************/
|
|
|
$customBalance = bcsub($custom->balance, $amount, 2);
|
|
|
$custom->balance = $customBalance;
|
|
|
if ($custom->balance < 0) {
|
|
|
$custom->isDebt = 1;
|
|
|
}
|
|
|
$custom->save();
|
|
|
-
|
|
|
$hdBalance = bcsub($hd->balance, $amount, 2);
|
|
|
$hd->balance = $hdBalance;
|
|
|
if ($hd->balance < 0) {
|
|
|
$hd->debt = 2;
|
|
|
}
|
|
|
$hd->save();
|
|
|
-
|
|
|
if (floatval($customBalance) != floatval($hdBalance)) {
|
|
|
util::fail('余额有错,请联系管理员,编号' . $hdId);
|
|
|
}
|
|
|
-
|
|
|
$relateId = $order->id ?? 0;
|
|
|
$customId = $custom->id ?? 0;
|
|
|
$orderSn = $order->orderSn ?? '';
|
|
|
@@ -239,40 +336,190 @@ class CustomClass extends BaseClass
|
|
|
'remark' => '',
|
|
|
];
|
|
|
BalanceChangeClass::add($change, true);
|
|
|
+
|
|
|
+ $mustUseGiveAmount = 0;
|
|
|
+ // 多处需要同步修改 balance_pay_give
|
|
|
+ if ($hd->balancePay >= $amount) {
|
|
|
+ util::fail('请用余额支付哈');
|
|
|
+ } else {
|
|
|
+ // todo 如果【充值金额】小于订单欠款金额,则用全部【充值金额】消单,同时必须用上【赠送金额】,够抵,则【充值金额】还是正数,不够抵,则是负数
|
|
|
+ if ($hd->balanceGive <= 0) {
|
|
|
+ //没有【赠送金额】,则用【充值金额】来消全部的欠款金额,不够则变成负数
|
|
|
+ $payAmount = $amount;
|
|
|
+ } else {
|
|
|
+ //这个是【总余额】,包括【充值金额】和【赠送金额】
|
|
|
+ $currentAdd = bcadd($hd->balancePay, $hd->balanceGive, 2);
|
|
|
+ if ($currentAdd >= $amount) {
|
|
|
+ util::fail('请使用余额支付哦');
|
|
|
+ } else {
|
|
|
+ //【总余额】不够抵欠款金额,先用掉全部的【赠送金额】,其他的全部算在【充值金额】名下,因为充值金额也不够扣,会出现负数
|
|
|
+ $mustUseGiveAmount = $hd->balanceGive;
|
|
|
+ $payAmount = bcsub($amount, $mustUseGiveAmount, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /************************* 充值余额 *****************************/
|
|
|
+ $customBalancePay = bcsub($custom->balancePay, $payAmount, 2);
|
|
|
+ $custom->balancePay = $customBalancePay;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalancePay = bcsub($hd->balancePay, $payAmount, 2);
|
|
|
+ $hd->balancePay = $hdBalancePay;
|
|
|
+ $hd->save();
|
|
|
+ if (floatval($customBalancePay) != floatval($hdBalancePay)) {
|
|
|
+ util::fail('余额有错呢,请联系管理员,编号' . $hdId);
|
|
|
+ }
|
|
|
+ $relateId = $order->id ?? 0;
|
|
|
+ $customId = $custom->id ?? 0;
|
|
|
+ $orderSn = $order->orderSn ?? '';
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
+ $event = '购买花材,单号:' . $orderSn;
|
|
|
+ $customName = $custom->name ?? '';
|
|
|
+ $onlinePay = 1;
|
|
|
+ $side = 0;
|
|
|
+ $payWay = 0;
|
|
|
+ $payChange = [
|
|
|
+ 'hdId' => $hdId,
|
|
|
+ 'hdName' => $hdName,
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'onlinePay' => $onlinePay,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $payAmount,
|
|
|
+ 'balance' => $customBalancePay,
|
|
|
+ 'io' => 0,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $shopId,
|
|
|
+ 'mainId' => $order->mainId,
|
|
|
+ 'settleId' => $settleId,
|
|
|
+ 'settleNo' => $settleNo,
|
|
|
+ 'settleAmount' => $settleAmount,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalancePayChangeClass::add($payChange, true);
|
|
|
+
|
|
|
+ /***************************** 赠送余额 ******************************/
|
|
|
+ //应用掉的赠送金额
|
|
|
+ if ($mustUseGiveAmount > 0) {
|
|
|
+ $customBalanceGive = bcsub($custom->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ if ($customBalanceGive < 0) {
|
|
|
+ util::fail('余额异常哈,请联系管理员,编号' . $hdId . ' ' . $custom->balanceGive);
|
|
|
+ }
|
|
|
+ $custom->balanceGive = $customBalanceGive;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalanceGive = bcsub($hd->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ $hd->balanceGive = $hdBalanceGive;
|
|
|
+ $hd->save();
|
|
|
+ if (floatval($customBalanceGive) != floatval($hdBalanceGive)) {
|
|
|
+ util::fail('余额有问题呢,请联系管理员,编号' . $hdId);
|
|
|
+ }
|
|
|
+ $relateId = $order->id ?? 0;
|
|
|
+ $customId = $custom->id ?? 0;
|
|
|
+ $orderSn = $order->orderSn ?? '';
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
+ $event = '购买花材,单号:' . $orderSn;
|
|
|
+ $customName = $custom->name ?? '';
|
|
|
+ $onlinePay = 1;
|
|
|
+ $side = 0;
|
|
|
+ $payWay = 0;
|
|
|
+ $giveChange = [
|
|
|
+ 'hdId' => $hdId,
|
|
|
+ 'hdName' => $hdName,
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'onlinePay' => $onlinePay,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $mustUseGiveAmount,
|
|
|
+ 'balance' => $customBalanceGive,
|
|
|
+ 'io' => 0,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $shopId,
|
|
|
+ 'mainId' => $order->mainId,
|
|
|
+ 'settleId' => $settleId,
|
|
|
+ 'settleNo' => $settleNo,
|
|
|
+ 'settleAmount' => $settleAmount,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalanceGiveChangeClass::add($giveChange, true);
|
|
|
+ }
|
|
|
+ $addBalance = bcadd($hd->balancePay, $hd->balanceGive, 2);
|
|
|
+ if (floatval($addBalance) != floatval($custom->balance)) {
|
|
|
+ util::fail('账户余额有问题,请检查,编号' . $customId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//欠款和余额支付的售后 ssh 20250803
|
|
|
- public static function refundDebtAmountReduce($custom, $amount, $refund)
|
|
|
+ public static function skRefundDebtAmountReduce($custom, $amount, $refund, $payWay)
|
|
|
{
|
|
|
$hdId = $custom->hdId ?? 0;
|
|
|
$hd = HdClass::getLockById($hdId);
|
|
|
if (empty($hd)) {
|
|
|
- util::fail('花店信息缺失,编号520');
|
|
|
+ util::fail('花店信息缺失,编号5362');
|
|
|
}
|
|
|
-
|
|
|
$customBalance = bcadd($custom->balance, $amount, 2);
|
|
|
$custom->balance = $customBalance;
|
|
|
if ($custom->balance < 0) {
|
|
|
$custom->isDebt = 1;
|
|
|
}
|
|
|
$custom->save();
|
|
|
-
|
|
|
$hdBalance = bcadd($hd->balance, $amount, 2);
|
|
|
$hd->balance = $hdBalance;
|
|
|
if ($hd->balance < 0) {
|
|
|
$hd->debt = 2;
|
|
|
}
|
|
|
$hd->save();
|
|
|
-
|
|
|
if (floatval($customBalance) !== floatval($hdBalance)) {
|
|
|
util::fail('余额错误,请联系管理员,编号' . $hdId);
|
|
|
}
|
|
|
-
|
|
|
$relateId = $refund->id ?? 0;
|
|
|
$customId = $custom->id ?? 0;
|
|
|
$refundSn = $refund->refundSn ?? '';
|
|
|
$orderSn = $refund->orderSn ?? '';
|
|
|
$orderId = $refund->orderId ?? 0;
|
|
|
+ $order = OrderClass::getLockById($orderId);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有找到订单哈!');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 多处需要同步修改 balance_pay_give
|
|
|
+ $mustUseGiveAmount = 0;
|
|
|
+ $buyAmount = 0;
|
|
|
+ if ($payWay == 3) {
|
|
|
+ //如果是欠款单售后,没有退款到赠送余额的情况
|
|
|
+ $buyAmount = $amount;
|
|
|
+ } elseif ($payWay == 2) {
|
|
|
+ //这个是总消费余额中充值余额部分
|
|
|
+ $payBalance = $order->payBalance ?? 0;
|
|
|
+ //这个是累计已经退还的余额
|
|
|
+ $balanceTk = $order->balanceTk ?? 0;
|
|
|
+ $currentBalanceTk = bcadd($balanceTk, $amount, 2);
|
|
|
+ //当前累计退还的余额如果超过了充值余额的话,说明要退还赠送的余额了
|
|
|
+ if ($currentBalanceTk > $payBalance) {
|
|
|
+ $pastAmount = bcsub($currentBalanceTk, $payBalance, 2);
|
|
|
+ if ($pastAmount > $amount) {
|
|
|
+ $mustUseGiveAmount = $amount;
|
|
|
+ } else {
|
|
|
+ $buyAmount = bcsub($amount, $pastAmount, 2);
|
|
|
+ $mustUseGiveAmount = bcsub($amount, $buyAmount, 2);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //累计退还的余额,还没超过充值余额,还是退充值余额部分
|
|
|
+ $buyAmount = $amount;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ util::fail('无效的支付方式!编号69880');
|
|
|
+ }
|
|
|
+
|
|
|
$staffId = $refund->shopAdminId ?? 0;
|
|
|
$staffName = $refund->shopAdminName ?? '';
|
|
|
$capitalType = dict::getDict('capitalType', 'hdRefund', 'id');
|
|
|
@@ -303,6 +550,83 @@ class CustomClass extends BaseClass
|
|
|
'remark' => '',
|
|
|
];
|
|
|
BalanceChangeClass::add($change, true);
|
|
|
+ $order->balanceTk = bcadd($order->balanceTk, $amount, 2);
|
|
|
+ if ($order->balanceTk < 0) {
|
|
|
+ util::fail('不能小于0,编号88672');
|
|
|
+ }
|
|
|
+ $order->save();
|
|
|
+
|
|
|
+ if ($buyAmount > 0) {
|
|
|
+ $customBalancePay = bcadd($custom->balancePay, $buyAmount, 2);
|
|
|
+ $custom->balancePay = $customBalancePay;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalancePay = bcadd($hd->balancePay, $buyAmount, 2);
|
|
|
+ $hd->balancePay = $hdBalancePay;
|
|
|
+ $hd->save();
|
|
|
+ $payChange = [
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'relateSn' => $refundSn,
|
|
|
+ 'onlinePay' => $onlinePay,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $buyAmount,
|
|
|
+ 'balance' => $hdBalancePay,
|
|
|
+ 'io' => 1,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $refund->shopId,
|
|
|
+ 'mainId' => $refund->mainId,
|
|
|
+ 'refundOrderId' => $orderId,
|
|
|
+ 'refundOrderSn' => $orderSn,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalancePayChangeClass::add($payChange, true);
|
|
|
+ $order->payBalanceTk = bcadd($order->payBalanceTk, $buyAmount, 2);
|
|
|
+ if ($order->payBalanceTk < 0) {
|
|
|
+ util::fail('不能小于0,编号88673');
|
|
|
+ }
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($mustUseGiveAmount > 0) {
|
|
|
+ $customBalanceGive = bcadd($custom->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ $custom->balanceGive = $customBalanceGive;
|
|
|
+ $custom->save();
|
|
|
+ $hdBalanceGive = bcadd($hd->balanceGive, $mustUseGiveAmount, 2);
|
|
|
+ $hd->balanceGive = $hdBalanceGive;
|
|
|
+ $hd->save();
|
|
|
+ $giveChange = [
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'relateId' => $relateId,
|
|
|
+ 'relateSn' => $refundSn,
|
|
|
+ 'onlinePay' => $onlinePay,
|
|
|
+ 'capitalType' => $capitalType,
|
|
|
+ 'amount' => $mustUseGiveAmount,
|
|
|
+ 'balance' => $hdBalanceGive,
|
|
|
+ 'io' => 1,
|
|
|
+ 'side' => $side,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'shopId' => $refund->shopId,
|
|
|
+ 'mainId' => $refund->mainId,
|
|
|
+ 'refundOrderId' => $orderId,
|
|
|
+ 'refundOrderSn' => $orderSn,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BalanceGiveChangeClass::add($giveChange, true);
|
|
|
+ $order->giveBalanceTk = bcadd($order->giveBalanceTk, $mustUseGiveAmount, 2);
|
|
|
+ if ($order->giveBalanceTk < 0) {
|
|
|
+ util::fail('不能小于0,编号88675');
|
|
|
+ }
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//添加客户 ssh 2021.2.28
|