修改分享后用户的使用的支付金额

This commit is contained in:
liu 2024-06-19 10:07:26 +08:00
parent 97a6102b20
commit b1e1e39164
2 changed files with 7 additions and 6 deletions

View File

@ -57,7 +57,7 @@ class CapitalFlowLogic extends BaseLogic
* @param $mark
* @return mixed
*/
public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0,)
public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0)
{
$model = new CapitalFlow();
$model->uid = $this->user['id'];

View File

@ -314,12 +314,13 @@ class PayNotifyLogic extends BaseLogic
// 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去
//用户下单该用户等级为1得时候才处理冻结金额
$user = User::where('id', $order['uid'])->find();
//纯在分销关系的时候要去判断分销出来的用户的采购款的额度
if ($order['spread_uid'] > 0 && $user['user_ship'] == 1) {
$oldUser = User::where('id',$order['spread_uid'])->value('purchase_funds');
if ($oldUser < $order['pay_price']) {
$order['pay_price'] = $oldUser;
if ($order['spread_uid'] > 0) {
$oldUser = User::where('id',$order['spread_uid'])->field('purchase_funds,user_ship')->find();
if ($oldUser && $oldUser['user_ship'] == 1){
if ($oldUser['purchase_funds'] < $order['pay_price']) {
$order['pay_price'] = $oldUser['purchase_funds'];
}
}
}elseif ($user['user_ship'] == 1){
$vipFrozenAmount = self::dealFrozenPrice($order['id']);