|
@@ -20,9 +20,26 @@ class My extends Core
|
|
|
|
|
|
$this->data['coupon_num'] = Dever::db('shop/user_coupon')->total(array('uid' => $this->uid, 'status' => 1));
|
|
|
|
|
|
- $this->data['card_num'] = Dever::db('card/code')->total(array('dh_uid' => $this->uid));
|
|
|
- if ($this->data['card_num'] > 0) {
|
|
|
-
|
|
|
+ $card = Dever::db('card/code')->getData(array('dh_uid' => $this->uid));
|
|
|
+
|
|
|
+ $this->data['card_num'] = 0;
|
|
|
+ if ($card) {
|
|
|
+ foreach ($card as $k => $v) {
|
|
|
+ $v['info'] = Dever::db('card/info')->find($v['card_id']);
|
|
|
+ if (!$v['info']) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ($v['info']['end_dh_day'] && $v['info']['end_dh_day'] > 0) {
|
|
|
+ $v['eddate'] = ($v['bdate'] ? $v['bdate'] : $v['cdate']) + ($v['info']['end_dh_day'] * 86400);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isset($v['eddate']) && $v['eddate'] && $v['eddate'] > 0) {
|
|
|
+ if ($v['eddate'] <= $time) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $this->data['card_num']++;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$this->data['score'] = Dever::load('score/lib/core')->getUserScore($this->uid);
|