Commit f56ade7b by doszhang

dos

parent 7a34c82b
......@@ -5,11 +5,11 @@ use Model\AuthModel;
use Think\Controller;
use Tools\AdminController;
class InfoController extends AdminController
class PrizeController extends AdminController
{
public function index()
{
$sql = "select id,nickname,headimgurl,poster_url,headposter_url,headposter_times,poster_times from user where poster_url is not NULL or headposter_url is not NULL";
$sql = "select u.id,u.nickname,u.tel,p.prize_name,p.take_time from user as u, prize as p where u.id=p.user.id and p.is_get=1";
$list = M()->query($sql);
$this->assign('list', $list);
$this->display();
......
......@@ -18,10 +18,9 @@
<thead>
<tr>
<th>id</th>
<th>奖品名称</th>
<th>姓名</th>
<th>微信昵称</th>
<th>电话</th>
<th>地址</th>
<th>奖品名称</th>
<th>抽奖时间</th>
</tr>
</thead>
......@@ -29,10 +28,9 @@
{:foreach from=$list item=item}
<tr>
<td>{:$item['id']}</td>
<td>{:$item['prize_name']}</td>
<td>{:$item['name']}</td>
<td>{:$item['nickname']}</td>
<td>{:$item['tel']}</td>
<td>{:$item['address']}</td>
<td>{:$item['prize_name']}</td>
<td >{:$item.add_time|date_format:'%Y-%m-%d %H:%M:%S'}</td>
</tr>
{:/foreach}
......
......@@ -151,13 +151,13 @@ class IndexController extends Controller
{
session_start();
$v = rand(0, 1000000) / 1000000;
$today_ratio = 1;
$today_ratio = 0.9;
if ($v > $today_ratio) {
return false;
}
$now = time();
$req_type = array();
$type_list = array(3);
$type_list = array(1,2,3);
foreach ($type_list as $type) {
$c = M('prize')->where(array(
'prize_type' => $type,
......@@ -211,25 +211,25 @@ class IndexController extends Controller
}
}
public function defaultStatus() {
if($_GET['password'] != 'UUvjQ1AT9fNwYlmNGEe1TSqbin7tClIg')
{
header("HTTP/1.0 404 Not Found");
exit;
}
M('user')->where('1=1')->save(array(
'tel' => NULL,
'is_prize' => 0
));
// public function defaultStatus() {
// if($_GET['password'] != 'UUvjQ1AT9fNwYlmNGEe1TSqbin7tClIg')
// {
// header("HTTP/1.0 404 Not Found");
// exit;
// }
// M('user')->where('1=1')->save(array(
// 'tel' => NULL,
// 'is_prize' => 0
// ));
M('prize')->where('1=1')->save(array(
'take_time' => 0,
'user_id' => 0,
'is_get' => 0,
'last_ip' => ''
));
echo 'clear complete';
}
// M('prize')->where('1=1')->save(array(
// 'take_time' => 0,
// 'user_id' => 0,
// 'is_get' => 0,
// 'last_ip' => ''
// ));
// echo 'clear complete';
// }
public function cookie()
{
......
......@@ -34,9 +34,9 @@ class AdminController extends Controller {
],
[
'auth_id' =>'2',
'auth_name' =>'用户信息',
'auth_name' =>'中奖信息',
'auth_pid' =>'0',
'auth_c' =>'Info',
'auth_c' =>'Prize',
'auth_a' =>'index',
'auth_path' =>'1',
'auth_level' =>'1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment