feat: 修改PayNotifyLogic以增加用户积分

This commit is contained in:
mkm 2024-06-18 09:56:32 +08:00
parent 92c20a1570
commit 5768afd77a

View File

@ -311,14 +311,16 @@ class PayNotifyLogic extends BaseLogic
//商户应该获得的钱 每个商品的price-ot_price 利润
// if (isset($order->profit) && $order->profit > 0) {
if($order['uid']>0){
$user_number=bcmul($order['pay_price'], '0.01', 2);
$sing = [
'uid' => $order['uid'],
'order_id' => $order['order_id'],
'title' => '购买商品获得兑换券',
'store_id' => $order['store_id'],
'number' => bcmul($order['pay_price'], '0.01', 2),
'number' =>$user_number,
];
$user_sing->save($sing);
User::where('id', $order['uid'])->inc('integral', $user_number)->update();
}
//平台手续费