Commit d422ad10 by doszhang

dos

parent fe301978
...@@ -125,14 +125,11 @@ class IndexController extends Controller ...@@ -125,14 +125,11 @@ class IndexController extends Controller
if (empty($req_type)) { if (empty($req_type)) {
return false; return false;
} }
$p = M('prize'); $prize = M('prize')->where(array(
$prize = $p->where(array(
'is_get' => 0, 'is_get' => 0,
'user_id' => 0, 'user_id' => 0,
'type' => array('in', $req_type), 'type' => array('in', $req_type),
))->order('rand()')->limit(1)->find(); ))->order('rand()')->limit(1)->find();
print_r($p->getLastsql());die();
if (!$prize) { if (!$prize) {
return false; return false;
} }
...@@ -162,25 +159,25 @@ class IndexController extends Controller ...@@ -162,25 +159,25 @@ class IndexController extends Controller
SignedCookie::set_cookie($this->cookie_uid_key, 'oVsrlt0zUWMLvMx2-KPGVmY2I-Xc', C('cookie_sign'), 86400 * 60); SignedCookie::set_cookie($this->cookie_uid_key, 'oVsrlt0zUWMLvMx2-KPGVmY2I-Xc', C('cookie_sign'), 86400 * 60);
} }
// public function addprize() { public function addprize() {
// for($i = 0;$i < 1000;$i++) for($i = 0;$i < 1000;$i++)
// { {
// M('prize')->add(array( M('prize')->add(array(
// 'type' => 3, 'type' => 3,
// 'prize_name' => '1元全网手机话费' 'prize_name' => '1元全网手机话费'
// )); ));
// if($i < 500) { if($i < 500) {
// M('prize')->add(array( M('prize')->add(array(
// 'type' => 2, 'type' => 2,
// 'prize_name' => '2元全网手机话费' 'prize_name' => '2元全网手机话费'
// )); ));
// } if($i < 25) { } if($i < 25) {
// M('prize')->add(array( M('prize')->add(array(
// 'type' => 3, 'type' => 1,
// 'prize_name' => '优酷VIP视频月卡' 'prize_name' => '优酷VIP视频月卡'
// )); ));
// } }
// } }
// } }
} }
\ No newline at end of file
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