Prize.php
1.6 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
namespace app\web\controller;
use think\Session;
use think\Cookie;
use think\Request;
use app\web\validate\User as UserValidate;
/**
* 抽奖管理
* Class prize
* @package app\web\controller
*/
class Prize extends BaseController
{
//登录页面
public function login()
{
$this->view->engine->layout(false);
return $this->fetch();
}
public function tologin(Request $request)
{
$data = $request->param();
$name="ybao";
$pwd="ybao888";
if($name != $data['name']){
$data=[
'code'=>100,
'msg'=>'用户名错误'
];
return json_encode($data);
}elseif($pwd != $data['pwd']){
$data=[
'code'=>100,
'msg'=>'密码错误'
];
return json_encode($data);
}else{
$data=[
'code'=>200,
'msg'=>'验证成功'
];
return json_encode($data);
}
}
//奖品列表
public function index()
{
$this->view->engine->layout(false);
return $this->fetch();
}
//用户列表
public function user()
{
$this->view->engine->layout(false);
return $this->fetch();
}
//用户列表
public function rule()
{
$this->view->engine->layout(false);
return $this->fetch();
}
//抽奖多渠道
public function division()
{
$this->view->engine->layout(false);
return $this->fetch();
}
}