GetPrizeController.php
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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('删除成功');
}
}
}