1
This commit is contained in:
parent
5d5d52989d
commit
9a72c7d49a
@ -140,5 +140,6 @@ function getShareConfig($share_table, $share_id)
|
||||
$share_id = (int)$share_id;
|
||||
return array_key_exists($share_id, $share_table) ? $share_table[$share_id] : null;
|
||||
}
|
||||
|
||||
checkMysqlConfig();
|
||||
checkRedisConfig();
|
||||
|
@ -245,12 +245,17 @@ class ShareController{
|
||||
if (count($rows) == 0) {
|
||||
$share_meta_table = require('../res/share@share.php');
|
||||
for ($i = 1; $i <= count($share_meta_table); $i++) {
|
||||
$id = $i;
|
||||
$share_meta = getShareConfig($share_meta_table, $id);
|
||||
if ($share_meta == NULL) {
|
||||
$id = -10000;
|
||||
}
|
||||
$ret = $conn->execScript('INSERT INTO share_achievement(accountid, ach_id, status, create_time, modify_time) ' .
|
||||
' VALUES(:account_id, :ach_id, :status, :create_time, :modify_time) ' .
|
||||
' ON DUPLICATE KEY UPDATE accountid=:account_id, ach_id=:ach_id, status=:status, modify_time=:modify_time;',
|
||||
array(
|
||||
':account_id' => $account_id,
|
||||
':ach_id' => $i,
|
||||
':ach_id' => $id,
|
||||
':status' => 0,
|
||||
':create_time' => time(),
|
||||
':modify_time' => time()
|
||||
@ -259,14 +264,18 @@ class ShareController{
|
||||
die();
|
||||
return;
|
||||
}
|
||||
$sh = $this->getShare($id);
|
||||
$array = $this->getExplode($sh['rewards']);
|
||||
array_push($info_list, array(
|
||||
'achivement_id' => $i,
|
||||
'status' => 0
|
||||
'achivement_id' => $id,
|
||||
'status' => 0,
|
||||
'item_id' => $array[0][0],
|
||||
'num' => $array[0][1],
|
||||
));
|
||||
}
|
||||
} else {
|
||||
foreach ($rows as $row) {
|
||||
$sh = $this->getShare($ach_id);
|
||||
$sh = $this->getShare($row['ach_id']);
|
||||
$array = $this->getExplode($sh['rewards']);
|
||||
array_push($info_list, array(
|
||||
'achivement_id' => $row['ach_id'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user