Authored by hf

code review by hf: do modify union duomai goods id param

... ... @@ -344,7 +344,7 @@ class UnionTrans
foreach ($orderDetail['order_goods'] as $val) {
$goodsName .= str_replace(array("&", "<", ">", "'", '"', " ", "|"), array("&amp;", "&lt;", "&gt;", "&quot;", "&apos;", "%20", "%20"), $val['product_name']) . '|';
$goodsIds .= self::getGoodsId($val['product_skn'], $val['color_name'], $val['product_sku']) . '|';
$goodsIds .= self::getGoodsId($val['product_skn'], $val['color_name'], $val['product_sku'], $val['goods_image']) . '|';
$goodsPrice .= $val['goods_price'] . '|';
$goodsTotalPrice .= $val['goods_amount'] . '|';
$goodsNum .= $val['buy_number'] . '|';
... ... @@ -432,9 +432,10 @@ class UnionTrans
* @param int $skn 商品SKN
* @param string $color 颜色名称
* @param int $sku 商品尺码唯一标识
* @param string $image 商品图片地址
* @return int
*/
public static function getGoodsId($skn, $color, $sku)
public static function getGoodsId($skn, $color, $sku, $image)
{
$goodsId = $sku;
... ... @@ -445,7 +446,7 @@ class UnionTrans
continue;
}
foreach ($value['goods_list'] as $goods) {
if ($goods['color_name'] === $color) {
if ($goods['color_name'] === $color && strpos($image, $goods['images_url']) !== false) {
$goodsId = $goods['goods_id'];
break;
}
... ...