function infoAction() { $model = new sevenListModel(); $map['openid'] = $_GET['id']; $map['ORDER'] = 'addtime asc'; $info = $model->select('*', $map); $this->assign('total', count($info)); $this->assign('info', $info); $this->display(); }
function getList() { $date = array(); //获取当前用户记录 $model = new sevenListModel(); $map['openid'] = $_SESSION['openid']; $map['ORDER'] = 'addtime ASC'; $list = $model->select('*', $map); $data['total'] = count($list); //获取签到开始时间 $set = $model->table('seven_set')->get('*', array('id' => 1)); $start = $set['start'] ? $set['start'] : strtotime(date('Ymd')); foreach ($list as $v) { $src[$v['addtime']] = $v; } for ($i = 0; $i < 7; $i++) { $d = $start + $i * 86400; $date[$d] = $src[$d]; } $data['date'] = $date; return $data; }