Example #1
0
 function integral()
 {
     /*获取积分增减的记录日期时间段*/
     $this->historyTime = IFilter::string(IReq::get('history_time', 'post'));
     $defaultMonth = 3;
     //默认查找最近3个月内的记录
     $lastStamp = ITime::getTime(ITime::getNow('Y-m-d')) - 3600 * 24 * 30 * $defaultMonth;
     $lastTime = ITime::getDateTime('Y-m-d', $lastStamp);
     if ($this->historyTime != null && $this->historyTime != 'default') {
         $historyStamp = ITime::getDateTime('Y-m-d', $lastStamp - 3600 * 24 * 30 * $this->historyTime);
         $this->c_datetime = 'datetime >= "' . $historyStamp . '" and datetime < "' . $lastTime . '"';
     } else {
         $this->c_datetime = 'datetime >= "' . $lastTime . '"';
     }
     $memberObj = new IModel('member');
     $where = 'user_id = ' . $this->user['user_id'];
     $this->memberRow = $memberObj->getObj($where, 'point');
     $this->redirect('integral', false);
 }