1
This commit is contained in:
parent
d14a89c122
commit
3c4bc6852a
42
webapp/controller/TempController.class.php
Normal file
42
webapp/controller/TempController.class.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require 'classes/Quest.php';
|
||||||
|
require 'classes/AddReward.php';
|
||||||
|
|
||||||
|
class TempController{
|
||||||
|
|
||||||
|
protected function getRedMysql()
|
||||||
|
{
|
||||||
|
$mysql_conf = getMysqlConfig(crc32(''));
|
||||||
|
$conn = new phpcommon\Mysql(array(
|
||||||
|
'host' => $mysql_conf['host'],
|
||||||
|
'port' => $mysql_conf['port'],
|
||||||
|
'user' => $mysql_conf['user'],
|
||||||
|
'passwd' => $mysql_conf['passwd'],
|
||||||
|
'dbname' => 'gamedb2001_' . 1
|
||||||
|
));
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRedSum()
|
||||||
|
{
|
||||||
|
$type = $_REQUEST['type'];
|
||||||
|
$red_conn = $this->getRedMysql();
|
||||||
|
$row = $red_conn->execQueryOne('SELECT * FROM redpack ' .
|
||||||
|
' WHERE red_type=:red_type;',
|
||||||
|
//AND red_date=:red_date;',
|
||||||
|
array(
|
||||||
|
':red_type' => $type,
|
||||||
|
//':red_date' => phpcommon\getdayseconds(time())
|
||||||
|
));
|
||||||
|
var_dump($row);
|
||||||
|
echo json_encode(array(
|
||||||
|
'errcode' => 0,
|
||||||
|
'errmsg' => '',
|
||||||
|
'sum' => $row['red_sum']
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
Loading…
x
Reference in New Issue
Block a user