Authored by 张丽霞

猜你喜欢

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