...
|
...
|
@@ -273,7 +273,7 @@ class UserModel |
|
|
* @param int $udid 客户端唯一标识
|
|
|
* @param int $page 第几页,默认为1
|
|
|
* @param int $limit 限制多少条,默认100
|
|
|
* @return array处理之后的数据
|
|
|
* @return array 处理之后的数据
|
|
|
*/
|
|
|
public static function browserRecord($uid, $udid, $page, $limit)
|
|
|
{
|
...
|
...
|
@@ -281,9 +281,30 @@ class UserModel |
|
|
|
|
|
$records = UserData::browseRecord($uid, $udid, $page, $limit);
|
|
|
|
|
|
if (!$records) {
|
|
|
$result['walkwayUrl'] = '/product/new';
|
|
|
$result['noRecord'] = true;
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
// 处理数据
|
|
|
if (isset($records['data']['product_list']) && !empty($records['data']['product_list'])) {
|
|
|
$result = $records['data']['product_list'];
|
|
|
if (isset($records['data']['product_list'])) {
|
|
|
|
|
|
// 不能再查到结果了
|
|
|
if ($page == 1 && $records['data']['total'] === 0) {
|
|
|
$result['walkwayUrl'] = '/product/new';
|
|
|
$result['noRecord'] = true;
|
|
|
} else {
|
|
|
$data = $records['data']['product_list'];
|
|
|
foreach ($data as &$val) {
|
|
|
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
|
|
|
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
|
|
|
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
|
|
|
}
|
|
|
|
|
|
!empty($data) && $result['browseRecord'] = $data;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $result;
|
...
|
...
|
|