Authored by hf

code review by hf: do modify home page download link and do add newyear game coupon huodong

... ... @@ -138,4 +138,20 @@ class DetailData
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 商品信息
*
* @param int $productSkn 商品SKN号
* @return array
*/
public static function product($productSkn)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.intro';
$param['product_skn'] = $productSkn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -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("&amp;", "&lt;", "&gt;", "&quot;", "&apos;", "%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;
}
}
... ...
... ... @@ -28,8 +28,8 @@
<div class="coupon-top">
<img src="{{imgUrl}}/cuxiao/img/newyear/160105/top-bg.png" alt="">
<a class="go-check" href="{{myCouponUrl}}"></a>
<a class="app-btn app1" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445"></a>
<a class="app-btn app2" href="http://www.yohoshow.com/about/index/yohobuyqr"></a>
<a class="app-btn app1" href="{{appUrl_1}}"></a>
<a class="app-btn app2" href="{{appUrl_2}}"></a>
</div>
<div class="coupon-bottom">
<div class="coupon-banner">
... ...
... ... @@ -63,6 +63,8 @@ class NewyearController extends HuodongAction
'bannerUrl_3' => 'http://m.yohobuy.com/kids?openby:yohobuy={"action":"go.home","params":{"channel":"3"}}',
'bannerUrl_4' => 'http://m.yohobuy.com/lifestyle?openby:yohobuy={"action":"go.home","params":{"channel":"4"}}',
'playAgain' => 'http://feature.yoho.cn/2016lishifeng/index.html',
'appUrl_1' => 'http://www.yohoshow.com/about/index/yohobuyqr',
'appUrl_2' => 'http://www.yohoshow.com/about/index/yohoboysqr',
));
}
... ...