This commit is contained in:
aozhiwei 2021-01-21 11:18:19 +08:00
parent 7b9f9300a0
commit 1e9fa161f2

View File

@ -5,6 +5,7 @@ require 'classes/AddReward.php';
class ActivityController{ class ActivityController{
private $actTableCache = null;
protected function getMysql($account_id) protected function getMysql($account_id)
{ {
$mysql_conf = getMysqlConfig(crc32($account_id)); $mysql_conf = getMysqlConfig(crc32($account_id));
@ -87,8 +88,10 @@ class ActivityController{
protected function getLottery($lot_id) protected function getLottery($lot_id)
{ {
$g_conf_lot_cluster = require('../res/lottery@lottery.php'); if ($this->actTableCache == null) {
$lot_conf = getLotteryConfig($g_conf_lot_cluster, $lot_id); $this->actTableCache = require('../res/lottery@lottery.php');
}
$lot_conf = getLotteryConfig($this->actTableCache, $lot_id);
$l = array( $l = array(
'id' => $lot_conf['id'], 'id' => $lot_conf['id'],
'item_id' => $lot_conf['item_id'], 'item_id' => $lot_conf['item_id'],
@ -350,23 +353,7 @@ class ActivityController{
)); ));
} }
} }
for ($i1 = 0; $i1 < count($lot_array); $i1++) { $key = $lot_array[0]['key'];
$l = $this->getLottery($lot_array[$i1]['key']);
$weight_sum += $l['jilv'];
}
$random = Rand(0, 100);
if ($random >= 50) {
$key = $lot_array[0]['key'];
} else {
$key = $lot_array[1]['key'];
}
} else if ($row['free_times'] + $row['video_times'] + 1 == 6) {
foreach ($user_db['draw_list'] as $draw) {
if (isset($draw['status']) && $draw['status'] != 0) {
continue;
}
$key = $draw['key'] + 1;
}
} else { } else {
foreach ($user_db['draw_list'] as $draw) { foreach ($user_db['draw_list'] as $draw) {
if (isset($draw['status']) && $draw['status'] != 0) { if (isset($draw['status']) && $draw['status'] != 0) {