diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index c70250f..315fbd5 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -1058,6 +1058,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository $rate = bcmul($merchantCart['merchantCategory']['commission_rate'], 100, 4); } $user_address = isset($address) ? ($address['province'] . $address['city'] . $address['district'] . $address['street'] . $address['detail']) : ''; + //整理订单数据 $_order = [ 'cartInfo' => $merchantCart, @@ -1093,7 +1094,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository 'coupon_price' => bcadd($merchantCart['order']['coupon_price'], $merchantCart['order']['platform_coupon_price'], 2), 'platform_coupon_price' => $merchantCart['order']['platform_coupon_price'], 'pay_type' => $pay_type, - 'user_address_id' => $user_address['address_id'] ?? 0, + 'user_address_id' => $address['address_id'] ?? 0, ]; $allUseCoupon = array_merge($allUseCoupon, $merchantCart['order']['useCouponIds']); $orderList[] = $_order; diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index a847aa9..949b02e 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -745,7 +745,7 @@ class StoreOrderRepository extends BaseRepository $storeOrderStatusRepository->{$func}($orderStatus); }); //推送到贡献值结算队列 - Queue::push(OrderPartnerJob::class, compact('order')); + Queue::push(OrderPartnerJob::class, $order->toArray()); event('order.take', compact('order')); diff --git a/crmeb/jobs/OrderPartnerJob.php b/crmeb/jobs/OrderPartnerJob.php index 57ffe17..da90160 100644 --- a/crmeb/jobs/OrderPartnerJob.php +++ b/crmeb/jobs/OrderPartnerJob.php @@ -32,8 +32,9 @@ use app\common\repositories\user\UserAddressRepository; class OrderPartnerJob implements JobInterface { - public function fire($job,$data) + public function fire($job, $data) { + file_put_contents('/tmp/debug_partner', '开始处理贡献值订单:'.var_export($data, 1), 8); try { //初始化贡献值 $bao_price = $mian_price = $ping_price = $total_price = 0; @@ -201,7 +202,7 @@ class OrderPartnerJob implements JobInterface ->select()->toArray(); $role_ids = array_column($trade_roles, 'id'); - $trade_trade_data = array_column($trade_roles,null, 'id'); + $trade_trade_data = array_column($trade_roles, null, 'id'); $user_list = User::getDB()->alias('u') ->leftJoin('UserPartner p', 'u.uid = p.uid') ->whereIn('p.partner_id', $role_ids) @@ -244,8 +245,8 @@ class OrderPartnerJob implements JobInterface ->whereIn('area_id', $area_ids) ->select()->toArray(); - $role_ids = array_column($area_roles, 'id'); - $trade_trade_data = array_column($area_roles, null,'id'); + $role_ids = array_column($area_roles, 'id'); + $trade_trade_data = array_column($area_roles, null, 'id'); $user_list = User::getDB()->alias('u') ->leftJoin('UserPartner p', 'u.uid = p.uid') ->whereIn('p.partner_id', $role_ids) @@ -280,7 +281,7 @@ class OrderPartnerJob implements JobInterface ->where('status', 1) ->select()->toArray(); $role_ids = array_column($common_roles, 'id'); - $common_trade_data = array_column($common_roles, null,'id'); + $common_trade_data = array_column($common_roles, null, 'id'); $user_list = User::getDB()->alias('u') ->leftJoin('UserPartner p', 'u.uid = p.uid') ->field('u.*,p.partner_id') @@ -288,7 +289,7 @@ class OrderPartnerJob implements JobInterface ->where('u.uid', '<>', $data['uid']) ->select(); - if(!empty($user_list)){ + if (!empty($user_list)) { $user_list = $user_list->toArray(); $user_count = count($user_list); foreach ($user_list as $cuk => $cuv) {