code review by hf: do modify union duomai goods id param
Showing
1 changed file
with
4 additions
and
3 deletions
@@ -344,7 +344,7 @@ class UnionTrans | @@ -344,7 +344,7 @@ class UnionTrans | ||
344 | 344 | ||
345 | foreach ($orderDetail['order_goods'] as $val) { | 345 | foreach ($orderDetail['order_goods'] as $val) { |
346 | $goodsName .= str_replace(array("&", "<", ">", "'", '"', " ", "|"), array("&", "<", ">", """, "'", "%20", "%20"), $val['product_name']) . '|'; | 346 | $goodsName .= str_replace(array("&", "<", ">", "'", '"', " ", "|"), array("&", "<", ">", """, "'", "%20", "%20"), $val['product_name']) . '|'; |
347 | - $goodsIds .= self::getGoodsId($val['product_skn'], $val['color_name'], $val['product_sku']) . '|'; | 347 | + $goodsIds .= self::getGoodsId($val['product_skn'], $val['color_name'], $val['product_sku'], $val['goods_image']) . '|'; |
348 | $goodsPrice .= $val['goods_price'] . '|'; | 348 | $goodsPrice .= $val['goods_price'] . '|'; |
349 | $goodsTotalPrice .= $val['goods_amount'] . '|'; | 349 | $goodsTotalPrice .= $val['goods_amount'] . '|'; |
350 | $goodsNum .= $val['buy_number'] . '|'; | 350 | $goodsNum .= $val['buy_number'] . '|'; |
@@ -432,9 +432,10 @@ class UnionTrans | @@ -432,9 +432,10 @@ class UnionTrans | ||
432 | * @param int $skn 商品SKN | 432 | * @param int $skn 商品SKN |
433 | * @param string $color 颜色名称 | 433 | * @param string $color 颜色名称 |
434 | * @param int $sku 商品尺码唯一标识 | 434 | * @param int $sku 商品尺码唯一标识 |
435 | + * @param string $image 商品图片地址 | ||
435 | * @return int | 436 | * @return int |
436 | */ | 437 | */ |
437 | - public static function getGoodsId($skn, $color, $sku) | 438 | + public static function getGoodsId($skn, $color, $sku, $image) |
438 | { | 439 | { |
439 | $goodsId = $sku; | 440 | $goodsId = $sku; |
440 | 441 | ||
@@ -445,7 +446,7 @@ class UnionTrans | @@ -445,7 +446,7 @@ class UnionTrans | ||
445 | continue; | 446 | continue; |
446 | } | 447 | } |
447 | foreach ($value['goods_list'] as $goods) { | 448 | foreach ($value['goods_list'] as $goods) { |
448 | - if ($goods['color_name'] === $color) { | 449 | + if ($goods['color_name'] === $color && strpos($image, $goods['images_url']) !== false) { |
449 | $goodsId = $goods['goods_id']; | 450 | $goodsId = $goods['goods_id']; |
450 | break; | 451 | break; |
451 | } | 452 | } |
-
Please register or login to post a comment