Пример #1
0
 function isLevelAllowUse($pmtId, $mLvId)
 {
     echox('select pmt_id from sdb_pmt_member_lv where member_lv_id=' . intval($mLvId) . ' and pmt_id=' . intval($pmtId));
     if ($this->db->select('select pmt_id from sdb_pmt_member_lv where member_lv_id=' . intval($mLvId) . ' and pmt_id=' . intval($pmtId))) {
         return true;
     } else {
         return false;
     }
 }
Пример #2
0
 function coupon($nPage = 1)
 {
     $oCoupon = $this->system->loadModel('trading/coupon');
     $aData = $oCoupon->getMemberCoupon($this->member['member_id'], $nPage - 1);
     if ($aData['data']) {
         foreach ($aData['data'] as $k => $item) {
             if ($item['cpns_status'] == 1) {
                 if ($oCoupon->isLevelAllowUse($item['pmt_id'], $GLOBALS['runtime']['member_lv'])) {
                     $curTime = time();
                     if ($curTime >= $item['pmt_time_begin'] && $curTime < $item['pmt_time_end']) {
                         if ($item['memc_used_times'] < $this->system->getConf('coupon.mc.use_times')) {
                             if ($item['memc_enabled'] == 'true') {
                                 $aData['data'][$k]['memc_status'] = '可使用';
                             } else {
                                 $aData['data'][$k]['memc_status'] = '本优惠券已作废';
                             }
                         } else {
                             $aData['data'][$k]['memc_status'] = '本优惠券次数已用完';
                         }
                     } else {
                         $aData['data'][$k]['memc_status'] = '还未开始或已过期';
                     }
                 } else {
                     $aData['data'][$k]['memc_status'] = '本级别不准使用';
                 }
             } else {
                 $aData['data'][$k]['memc_status'] == '此种优惠券已取消';
             }
         }
     }
     echox($aData);
     $this->pagedata['coupons'] = $aData['data'];
     $this->pagedata['mc_use_times'] = $this->system->getConf('coupon.mc.use_times');
     $this->pagination($nPage, $aData['page'], 'coupon');
     $this->_output();
 }
Пример #3
0
 function delActivity()
 {
     echox($_POST);
     exit;
     $oPromotionActivity = $this->system->loadModel('trading/promotionActivity');
     $activityIds = $oPromotionActivity->finderResult($_POST['items']);
     if ($oPromotionActivity->delActivity($activityIds, $msg)) {
         $this->splash('success', 'index.php?ctl=sale/activity&act=index');
     } else {
         $this->splash('failed', 'index.php?ctl=sale/activity&act=index', $msg);
     }
 }
Пример #4
0
 function coupon($nPage = 1)
 {
     $oCoupon = $this->system->loadModel('trading/coupon');
     $aData = $oCoupon->getMemberCoupon($this->member['member_id'], $nPage - 1);
     if ($aData['data']) {
         foreach ($aData['data'] as $k => $item) {
             if ($item['cpns_status'] == 1) {
                 if ($oCoupon->isLevelAllowUse($item['pmt_id'], $GLOBALS['runtime']['member_lv'])) {
                     $curTime = time();
                     if ($curTime >= $item['pmt_time_begin'] && $curTime < $item['pmt_time_end']) {
                         if ($item['memc_used_times'] < $this->system->getConf('coupon.mc.use_times')) {
                             if ($item['memc_enabled'] == 'true') {
                                 $aData['data'][$k]['memc_status'] = 'Available';
                             } else {
                                 $aData['data'][$k]['memc_status'] = 'This coupon has been canceled';
                             }
                         } else {
                             $aData['data'][$k]['memc_status'] = 'Times has been exhausted';
                         }
                     } else {
                         $aData['data'][$k]['memc_status'] = 'Not begun or has expired';
                     }
                 } else {
                     $aData['data'][$k]['memc_status'] = 'Your level does not allow the use of';
                 }
             } else {
                 $aData['data'][$k]['memc_status'] == 'This coupon has been canceled';
             }
         }
     }
     echox($aData);
     $this->pagedata['coupons'] = $aData['data'];
     $this->pagedata['mc_use_times'] = $this->system->getConf('coupon.mc.use_times');
     $this->pagination($nPage, $aData['page'], 'coupon');
     $this->_output();
 }