diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 8e204b1f6..91a87fc2a 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -627,6 +627,18 @@ class PayNotifyLogic extends BaseLogic $village_uid = User::where('id', 'in', $arr1)->where('user_ship', 2)->value('id') ?? 0; } } + }else{ + $address = UserAddress::where(['uid' => $order['spread_uid'], 'is_default' => 1])->find(); + 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') ?? 0; + } + $arr2 = UserAddress::where(['village' => $address['village'], 'brigade' => $address['brigade'], 'is_default' => 1])->column('uid'); + if ($arr2) { + $brigade_uid = User::where('id', 'in', $arr2)->where('user_ship', 3)->value('id') ?? 0; + } + } } } else { //查询用户对应的村长和队长