This commit is contained in:
aozhiwei 2020-08-18 21:46:22 +08:00
parent 43904b111c
commit cd2eb8948e

View File

@ -534,48 +534,50 @@ class SignController{
));
$order = 0;
$lastid = 0;
foreach ($rowShare as $rs) {
if ($rs['status'] == 1) {
$order++;
}
$lastid = $rs['ach_id'];
}
if ($order >= count($rowShare)) {
//更新新的邀请列表
$s = $this->getShare($lastid);
if (!$s) {
die();
}
$share_meta_table = require('../res/share@share.php');
$type = $s['type'] + 1;
if ($lastid >= count($share_meta_table)) {
$type = $s['type'];
}
$count = 0;
for ($i = 1; $i <= count($share_meta_table); $i++) {
$s1 = $this->getShare($i);
if (!$s1 || $s1['type'] != $type) {
continue;
if (count($rowShare) != 0) {
foreach ($rowShare as $rs) {
if ($rs['status'] == 1) {
$order++;
}
$id = $i;
$updateid = $rowShare[$count]['ach_id'];
$count++;
$share_ret = $conn->execScript('UPDATE share_achievement SET ach_id=:ach_id, status=0, modify_time=:modify_time ' .
' WHERE accountid=:accountid AND ach_id=:id;',
$lastid = $rs['ach_id'];
}
if ($order >= count($rowShare)) {
//更新新的邀请列表
$s = $this->getShare($lastid);
if (!$s) {
die();
}
$share_meta_table = require('../res/share@share.php');
$type = $s['type'] + 1;
if ($lastid >= count($share_meta_table)) {
$type = $s['type'];
}
$count = 0;
for ($i = 1; $i <= count($share_meta_table); $i++) {
$s1 = $this->getShare($i);
if (!$s1 || $s1['type'] != $type) {
continue;
}
$id = $i;
$updateid = $rowShare[$count]['ach_id'];
$count++;
$share_ret = $conn->execScript('UPDATE share_achievement SET ach_id=:ach_id, status=0, modify_time=:modify_time ' .
' WHERE accountid=:accountid AND ach_id=:id;',
array(
':accountid' => $account_id,
':modify_time' => time(),
':ach_id' => $id,
':id' => $updateid
));
}
} else {
$share_ret = $conn->execScript('UPDATE share_achievement SET status=0, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':modify_time' => time(),
':ach_id' => $id,
':id' => $updateid
));
}
} else {
$share_ret = $conn->execScript('UPDATE share_achievement SET status=0, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':modify_time' => time(),
));
}
}