find(); if ($find) { $merchant = SystemStore::where('id', $find['store_id'])->field('name,phone')->find(); $mer_user_info = SystemStoreStaff::where('store_id', $find['store_id'])->where('is_admin',1)->field('staff_name,phone')->find(); $user = User::where('id', $find['uid'])->field('nickname,mobile')->find(); $find['system_store_name'] = $merchant['name']; $find['pay_type_name'] = PayEnum::getPaySceneDesc($find['pay_type']); $find['system_store_phone'] = $merchant['phone']; $find['staff_name'] = $mer_user_info['staff_name']; $find['staff_phone'] = $mer_user_info['phone']; $find['nickname'] = $user['nickname']??''; $find['user_mobile'] = $user['mobile']??''; $find['info'] = StoreOrderCartInfo::where('oid', $find['id'])->field('store_id,product_id,cart_num,cart_info')->select()->each(function ($item) { $goods = StoreBranchProduct::where(['store_id'=>$item['store_id'],'product_id'=>$item['product_id']])->field('store_name,unit')->find(); $item['unit_name'] = StoreProductUnit::where('id', $goods['unit'])->value('name'); $item['store_name'] = $goods['store_name']; $item['total_price'] = $item['cart_info']['total_price']; $item['price'] = $item['cart_info']['price']; return $item; }); PushService::push('store_merchant_'.$find['store_id'], $find['store_id'], ['type'=>'platform_print','msg'=>'打印队列','data'=>$find]); Log::info('打印推送结束'.$id); } } public function onConsumeFailure(\Throwable $exception, $package) { Log::error('打印队列推送失败。order_id:'. $package['data']['id'].',msg:'.$exception->getMessage()); return $package; } }