Authored by 张丽霞

猜你喜欢

... ... @@ -22,15 +22,21 @@ class RecomData
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param string $channel 1表示男, 2表示女
* @param string $uid 用户ID
* @param string $udid 设备号
* @param string $recPos 推荐位 100001表示男首,100002表示女首,1000009表示有货币
* @param int $page 分页第几页, 默认第1页
* @param int $limit 查询返回的最大限制数, 默认为50
* @return array
*/
public static function mayLike($gender, $channel, $page = 1, $limit = 50)
public static function mayLike($gender, $uid, $udid, $recPos, $channel, $page = 1, $limit = 50)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.last7day';
$param['method'] = 'app.search.newLast7day';
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['rec_pos'] = $recPos;
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
... ...
... ... @@ -40,10 +40,10 @@ module.exports = function(specificGender) {
} else if (lifestyleType) {
//有货币页面加载男生首页的数据
url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3' : '/product/recom/maylikelife';
url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3&rec_pos=100009' : '/product/recom/maylikelife';
} else {
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
'1,3' : '2,3',
'1,3&rec_pos=100001' : '2,3&rec_pos=100002',
url = '/product/recom/maylike?gender=' + gender;
}
... ...
... ... @@ -50,7 +50,6 @@
line-height: 1;
.sale-price {
display: block;
color: #d9134f;
margin-right: 8px;
}
... ...
... ... @@ -34,13 +34,16 @@ class RecomController extends AbstractAction
/* 取可能喜欢的数据 */
$recom = array();
$gender = $this->get('gender', '1,3');
$recPos = $this->get('rec_pos', '100001');
$uid = $this->getUid();
$udid = $this->getUdid();
// 女
if ($gender === '2,3') {
$recom = RecomData::mayLike('2,3', 2, $page);
$recom = RecomData::mayLike('2,3', $uid, $udid, $recPos, 2, $page);
}
// 男
else {
$recom = RecomData::mayLike('1,3', 1, $page);
$recom = RecomData::mayLike('1,3', $uid, $udid, $recPos, 1, $page);
}
/* 判断是否有内容返回 */
... ...