1
This commit is contained in:
parent
9b481b8c86
commit
7e81167c4d
@ -225,5 +225,12 @@ function getRankRewardConfig($ran_table, $ran_id)
|
||||
$ran_id = (int)$ran_id;
|
||||
return array_key_exists($ran_id, $ran_table) ? $ran_table[$ran_id] : null;
|
||||
}
|
||||
|
||||
function getEquipUpgradeConfig($equipUp_table, $equipUp_id)
|
||||
{
|
||||
$equipUp_id = (int)$equipUp_id;
|
||||
return array_key_exists($equipUp_id, $equipUp_table) ? $equipUp_table[$equipUp_id] : null;
|
||||
}
|
||||
|
||||
checkMysqlConfig();
|
||||
checkRedisConfig();
|
||||
|
@ -73,6 +73,17 @@ class RoleController{
|
||||
return $d;
|
||||
}
|
||||
|
||||
protected function getEquipUp($equipUp_id)
|
||||
{
|
||||
$g_conf_equipUp_cluster = require('../res/equipUpgrade@equipUpgrade.php');
|
||||
$equipUp_conf = getEquipUpgradeConfig($g_conf_equipUp_cluster, $equipUp_id);
|
||||
$e = array(
|
||||
'id' => $equipUp_conf['id'],
|
||||
'coin_num' => $equipUp_conf['coin_num'],
|
||||
);
|
||||
return $e;
|
||||
}
|
||||
|
||||
protected function getExplode($string)
|
||||
{
|
||||
$delim = "|";
|
||||
@ -1021,6 +1032,14 @@ class RoleController{
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
$rowEquip = $conn->execQueryOne('SELECT id FROM equip WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
if (!$rowEquip) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个装备');
|
||||
return;
|
||||
}
|
||||
|
||||
$coin_times = $rowUser['coin_times'];
|
||||
$p1 = $this->getParameter(DAILYCOIN_TIMES);
|
||||
@ -1029,11 +1048,19 @@ class RoleController{
|
||||
$val = $p2['param_value'];
|
||||
$p3 = $this->getParameter(DAILYCOIN_NUM);
|
||||
$num = $p3['param_value'];
|
||||
|
||||
$e = $this->getEquipUp($rowEquip['id']);
|
||||
if (!$e) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个装备');
|
||||
return;
|
||||
}
|
||||
$coin_num = $e['coin_num'];
|
||||
|
||||
if ($coin_times >= $max_times) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 2, '今日次数达到上限');
|
||||
return;
|
||||
}
|
||||
$coin_num = round($num * pow($val, $coin_times));
|
||||
//$coin_num = round($num * pow($val, $coin_times));
|
||||
//error_log($coin_num);
|
||||
$ret = $conn->execScript('UPDATE user SET coin_times=:coin_times, coin_num=:coin_num, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
|
Loading…
x
Reference in New Issue
Block a user