<?php
namespace MpSmi\Controller;

use Think\Controller;

header("Content-Type:text/html;CharSet=UTF-8");
class RenewController extends BaseController
{
    //续费记录列表
	public function renewList()
    {
        $Model = M("stores_renew");
        $count = $Model->where(array("store_id"=>session("store_id")))->count();
        $Page = new \Think\Page($count, 12);//每页记录数
        $show = $Page->show();// 分页显示输出
        $list = $Model           
            ->where(array("store_id"=>session("store_id")))
            ->order("id desc")
            ->limit($Page->firstRow . ',' . $Page->listRows)
            ->select();
        $this->assign('page', $show);// 赋值分页输出
        $this->assign("list", $list);//定义变量并显示模板
        $this->display();
    }
    //续费记录删除
    public function renewDel(){
        $uid = I("id");
        if (!$uid) alertMsg("系统故障，无法接收 ID");
        $bool = M("stores_renew")->delete($uid);
        $this->redirect("renewList");die;
    }
    
}