feat: 修改支付通知逻辑以增加积分

This commit is contained in:
mkm 2024-06-18 11:45:09 +08:00
parent be035be2f5
commit 84d056bfaf

View File

@ -378,16 +378,18 @@ class PayNotifyLogic extends BaseLogic
if ($address) {
$arr1 = UserAddress::where(['village' => $address['village'], 'is_default' => 1])->column('uid');
if ($arr1) {
$village_uid = User::where('id', 'in', $arr1)->where('user_ship', 2)->value('id');
if ($village_uid) {
User::where('id', $village_uid)->inc('integral', $fees)->update();
$uid = User::where('id', 'in', $arr1)->where('user_ship', 2)->value('id');
if ($uid) {
User::where('id', $uid)->inc('integral', $fees)->update();
$village_uid=$uid;
}
}
$arr2 = UserAddress::where(['village' => $address['village'], 'brigade' => $address['brigade'], 'is_default' => 1])->column('uid');
if ($arr2) {
$brigade_uid = User::where('id', 'in', $arr1)->where('user_ship', 3)->value('id');
if ($brigade_uid) {
User::where('id', $brigade_uid)->inc('integral', $fees)->update();
$uid = User::where('id', 'in', $arr1)->where('user_ship', 3)->value('id');
if ($uid) {
User::where('id', $uid)->inc('integral', $fees)->update();
$brigade_uid=$uid;
}
}
}