Authored by Rock Zhang

修复优惠券使用的bug

... ... @@ -7,10 +7,10 @@
</div>
{{/coupons}}
{{#if noRecord}}
<div class="no-record">
<div class="icon"></div>
<span>暂无优惠券</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
{{# noRecord}}
<div class="null">
<i></i>
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/if}}
\ No newline at end of file
{{/ noRecord}}
\ No newline at end of file
... ...
... ... @@ -383,14 +383,17 @@ class UserModel
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$result['coupons'] = $coupons['data']['info'];
$couponArr = array();
isset($coupons['data']['info']) && $couponArr = $coupons['data']['info'];
foreach ($result['coupons'] as &$val) {
foreach ($couponArr as &$val) {
// 处理已使用的优惠券
if ($status == 1) {
$val['used'] = true;
}
}
!empty($couponArr) && $result['coupons'] = $couponArr;
}
}
... ...