isEmpty()){ // dump('店铺1'); //判断是否存在规格-获取重量 $specs = $sku::getSpecsIdByShopId($shops->shop_id, $item['tradeOrderPrintVos'][0]['skuId']); if(!$specs->isEmpty()) { // dump('店铺2'); //根据规格重量获取,加收价格 $weight = $productConfig::getWeight($specs->spec_id); $status = 3; if($weight){ // dump('店铺3'); $other_price = JuShuiTanService::getRemoteAreaFee($item['tradeOrderPrintVos'][0]['companyName'], $weight, $item['receiverProvince'], $item['receiverCity']); // 保温加收价格 $getPackSpecsFee=JuShuiTanService::getPackSpecsFee($sku,$item['shopId'], $item['tradeOrderPrintVos'][0]['skuId'],$item['receiverProvince']); $pack_specs=strval($getPackSpecsFee['surcharge_money']); $other_price=(string)$other_price; $other_price=strval($other_price); $other_price=bcadd($other_price,$pack_specs, 2); //获取包装箱 $box = $customerSpec::getBoxId($shops->customer_id, $specs->variety_id, $specs->spec_id); // $shopDelivery::create([ // 'customer_id' => $shops->customer_id, // 'shop_id' => $shops->id, // 'plat_id' => $shops->platform, // 'variety_id' => $specs->variety_id, // 'spec_id' => $specs->spec_id, // 'spec_name' => $specs->spec_name, // 'box_id' => $box->id??0, // 'box_name' => $box->box_name??'', // 'variety_name' => $box->variety_name, // 'num' => $item['tradeOrderPrintVos'][0]['total'], // 'weigh' => $weight, // 'price' => $box->price??0, // 'total_price' => bcmul($box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2), // 'company_name' => $item['tradeOrderPrintVos'][0]['companyName'], // 'waybill_no' => $item['waybillNo'], // 'region' => $item['receiverProvince'].' '.$item['receiverCity'], // 'other_price' => $other_price, // 'ship_date' => substr($item['consignTime'], 0, 10), // ]); $shopDelivery=[ 'customer_id' => $shops->customer_id, 'shop_id' => $shops->id, 'plat_id' => $shops->platform, 'variety_id' => $specs->variety_id, 'spec_id' => $specs->spec_id, 'spec_name' => $specs->spec_name, 'box_id' => $box->id??0, 'box_name' => $box->box_name??'', 'variety_name' => $box->variety_name, 'num' => $item['tradeOrderPrintVos'][0]['total'], 'weigh' => $weight, 'price' => $box->price??0, 'total_price' => bcmul((string)$box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2), 'company_name' => $item['tradeOrderPrintVos'][0]['companyName'], 'waybill_no' => $item['waybillNo'], 'region' => $item['receiverProvince'].' '.$item['receiverCity'], 'other_price' => $other_price, 'ship_date' => substr($item['consignTime'], 0, 10), ]; } }else{ $status = 2; } } // return $status; $data=[ 'shopDelivery'=>$shopDelivery, 'status'=>$status ]; return $data; } }