...
|
...
|
@@ -9,6 +9,7 @@ namespace Plugin; |
|
|
use Hood\Core\Security\AuthCode;
|
|
|
use Api\Yohobuy;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
|
|
|
class UnionTrans
|
|
|
{
|
...
|
...
|
@@ -343,7 +344,7 @@ class UnionTrans |
|
|
|
|
|
foreach ($orderDetail['order_goods'] as $val) {
|
|
|
$goodsName .= str_replace(array("&", "<", ">", "'", '"', " ", "|"), array("&", "<", ">", """, "'", "%20", "%20"), $val['product_name']) . '|';
|
|
|
$goodsIds .= $val['product_sku'] . '|';
|
|
|
$goodsIds .= self::getGoodsId($val['product_skn'], $val['color_name'], $val['product_sku']) . '|';
|
|
|
$goodsPrice .= $val['goods_price'] . '|';
|
|
|
$goodsTotalPrice .= $val['goods_amount'] . '|';
|
|
|
$goodsNum .= $val['buy_number'] . '|';
|
...
|
...
|
@@ -424,5 +425,36 @@ class UnionTrans |
|
|
// pass back as string. or simple xml object if you want!
|
|
|
return $xml->asXML();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取商品ID
|
|
|
*
|
|
|
* @param int $skn 商品SKN
|
|
|
* @param string $color 颜色名称
|
|
|
* @param int $sku 商品尺码唯一标识
|
|
|
* @return int
|
|
|
*/
|
|
|
public static function getGoodsId($skn, $color, $sku)
|
|
|
{
|
|
|
$goodsId = $sku;
|
|
|
|
|
|
$productData = SearchData::searchElasticByCondition(array('query' => $skn) );
|
|
|
if (!empty($productData['data']['product_list'])) {
|
|
|
foreach ($productData['data']['product_list'] as $value) {
|
|
|
if (empty($value['goods_list'])) {
|
|
|
continue;
|
|
|
}
|
|
|
foreach ($value['goods_list'] as $goods) {
|
|
|
if ($goods['color_name'] === $color) {
|
|
|
$goodsId = $goods['goods_id'];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$productData = array();
|
|
|
|
|
|
return $goodsId;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|