...
|
...
|
@@ -322,7 +322,7 @@ class UserModel |
|
|
foreach ($data as &$val) {
|
|
|
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
|
|
|
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
|
|
|
$val['sales_price'] = (!empty($val['sales_price']) && !is_float($val['sales_price'])) ? $val['sales_price'] . '.00' : $val['sales_price'];
|
|
|
$val['sales_price'] = Helpers::transPrice($val['sales_price']);
|
|
|
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
|
|
|
}
|
|
|
!empty($data) && $result['browseRecord'] = $data;
|
...
|
...
|
@@ -381,9 +381,10 @@ class UserModel |
|
|
* @param int $uid 用户ID
|
|
|
* @param int $status 优惠券状态,0表示未使用,1表示已使用
|
|
|
* @param int $page 第几页
|
|
|
* @param boolean $onlyTotal 只返回总数
|
|
|
* @return array|mixed 处理之后的优惠券数据
|
|
|
*/
|
|
|
public static function getCouponData($uid, $status, $page)
|
|
|
public static function getCouponData($uid, $status, $page, $onlyTotal = false)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
...
|
...
|
@@ -400,6 +401,13 @@ class UserModel |
|
|
|
|
|
// 处理优惠券数据
|
|
|
if (isset($coupons['data'])) {
|
|
|
|
|
|
if ($onlyTotal) {
|
|
|
$result['count'] = $coupons['data']['total'];
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
// 不能再查到结果了
|
|
|
if ($page == 1 && $coupons['data']['total'] === 0) {
|
|
|
$result['walkwayUrl'] = '/product/new';
|
...
|
...
|
|