GetPrizeController.php 1.5 KB
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/9
 * Time: 16:05
 */
namespace app\admin\controller;
use api\common\model\CommonModel;
use app\admin\model\GetPrizeModel;
use cmf\controller\AdminBaseController;
use Think\Db;
use Think\Model;




class GetPrizeController extends AdminBaseController{
    //index方法
    public function index()
    {
        $param = $this->request->param();

        $getprizeModel=new GetPrizeModel();
        $lists=$getprizeModel->GetPrize($param);

        $this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
        $this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
        $this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
        $this->assign('list',$lists);
        return $this->fetch();
    }
    //核销
    public function hexiao()
    {
        $id = $this->request->param('id', 0, 'intval');
        $status=1;
        $create_time=time();
        $getprizeModel=new GetPrizeModel();
        $post=$getprizeModel->hexiao($id,$status,$create_time);
        if ($post){
            $this->success('核销成功','index');
        }
    }
    //获奖信息删除
    public function deleteGetPrize()
    {
        $id = $this->request->param('id', 0, 'intval');
        $getprizeModel=new GetPrizeModel();
        $result=$getprizeModel->deleteGetPrize($id);
        if ($result){
            return $this->success('删除成功');
        }
    }
}