Authored by 郭成尧

'用户中心为你优选'

... ... @@ -3,6 +3,7 @@
namespace Home;
use Home\UserModel;
use LibModels\Web\Home\UserData;
use LibModels\Web\Product\BrandData;
use WebPlugin\Helpers;
use WebPlugin\HelperHome;
... ... @@ -75,6 +76,25 @@ class IndexModel
}
/**
* @param $channel
* @param $uid
* @param $udid
* @param $recPos
* @param $limit
* @return array
*/
public static function preferenceData($channel, $uid, $udid, $recPos, $limit)
{
$response = UserData::newPreference($channel, $uid, $udid, $recPos, $limit);
if ($response['code'] === 200) {
return HelperHome::formatNew($response['data']['product_list']);
} else {
return array();
}
}
/**
* 底部banner
* @param string $code
* @return mixed
... ...
... ... @@ -34,6 +34,10 @@ class IndexController extends WebAction
$leftNav = UserModel::getCenterLeftNav('', $uid);
$data = IndexModel::homeData();
$udid = $uid . $this->getUdid();
// 为你优选 tar add 160701
$data['recommend'] = IndexModel::preferenceData($channel, $uid, $udid, '100004', 30);
//取消订单原因列表
$resons = OrderData::closeReasons();
$cancelReason = isset($resons['data']) ? $resons['data'] : '';
... ... @@ -57,7 +61,7 @@ class IndexController extends WebAction
'newArrival' => $data['new']
)
),
'recommend' => $data['new'], //待处理
'recommend' => $data['recommend'], //待处理
'banner' => IndexModel::getFooterBanner(),
'helpUsUrl' => ''
);
... ...