Commit 1a4b5021 authored by hangjun83's avatar hangjun83

openapi 震坤行

parent 903ac684
...@@ -185,23 +185,22 @@ class RhawnOrdersService ...@@ -185,23 +185,22 @@ class RhawnOrdersService
$tempSku = []; $tempSku = [];
foreach($orderDetail['lines'] as $line){ foreach($orderDetail['lines'] as $line){
$tempSku[] = $line['zkhSku']; $tempSku[] = $line['zkhSku'];
} if(!empty($tempSku)) {
if(!empty($tempSku)){
//获取对应关系 //获取对应关系
$goods = $dbConnect->table('zkh_goods') $goods = $dbConnect->table('zkh_goods')
->whereIn('zg_sku',$tempSku) ->where('zg_sku', $line['zkhSku'])
->get()->toArray(); ->get()->toArray();
if(count($goods) > 0){ if (count($goods) > 0) {
$pIds = []; $pIds = [];
foreach($goods as $goodsInfo){ foreach ($goods as $goodsInfo) {
$pIds[] = $goodsInfo->zg_r_pid; $pIds[] = $goodsInfo->zg_r_pid;
} }
if(!empty($pIds)){ if (!empty($pIds)) {
$products = $dbConnect->table('products') $products = $dbConnect->table('products')
->whereIn('p_id',$pIds) ->whereIn('p_id', $pIds)
->get()->toArray(); ->get()->toArray();
if($products){ if ($products) {
foreach($products as $key => $product){ foreach ($products as $key => $product) {
$orderItemsArray = []; $orderItemsArray = [];
$orderItemsArray['so_id'] = $orderId; $orderItemsArray['so_id'] = $orderId;
$orderItemsArray['p_id'] = $product->p_id; $orderItemsArray['p_id'] = $product->p_id;
...@@ -222,6 +221,7 @@ class RhawnOrdersService ...@@ -222,6 +221,7 @@ class RhawnOrdersService
} }
} }
} }
}
if($data['express'] > 0){ if($data['express'] > 0){
$soitems = []; $soitems = [];
$soitems_count = count($products); $soitems_count = count($products);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment