Commit f56ade7b by doszhang

dos

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