1
This commit is contained in:
parent
336a2767a7
commit
1c93734ae0
@ -31,15 +31,7 @@ class FirstTopupController extends BaseAuthedController {
|
||||
}
|
||||
FirstTopup::adjustStatus($dbInfo);
|
||||
$complete = 1;
|
||||
for ($i = 1; $i <= 3; ++$i) {
|
||||
if ($dbInfo['status' . $i] != 2) {
|
||||
$complete = 0;
|
||||
}
|
||||
$status[$i] = $dbInfo['status' . $i];
|
||||
}
|
||||
if ($complete == 1 && myself()->_getV(TN_FIRST_TUPOP_STATUS, 0) == 0) {
|
||||
myself()->_setV(TN_FIRST_TUPOP_STATUS, 0, 1);
|
||||
}
|
||||
$this->fillStatus($dbInfo, $status, $complete);
|
||||
$this->_rspData(
|
||||
array(
|
||||
'complete' => $complete,
|
||||
@ -83,22 +75,14 @@ class FirstTopupController extends BaseAuthedController {
|
||||
for ($i = 0; $i < count($reward); $i++) {
|
||||
array_push($awardItems,
|
||||
array(
|
||||
$item['goods_id'],
|
||||
$item['goods_num']
|
||||
'item_id' => $item['goods_id'],
|
||||
'item_num' => $item['goods_num']
|
||||
));
|
||||
}
|
||||
myself()->_addItems($awardItems, $awardService, $propertyChgService);
|
||||
|
||||
$status = array(0, 0, 0);
|
||||
$complete = 1;
|
||||
for ($i = 1; $i <= 3; ++$i) {
|
||||
if ($dbInfo['status' . $i] != 2) {
|
||||
$complete = 0;
|
||||
}
|
||||
$status[$i] = $dbInfo['status' . $i];
|
||||
}
|
||||
if ($complete == 1 && myself()->_getV(TN_FIRST_TUPOP_STATUS, 0) == 0) {
|
||||
myself()->_setV(TN_FIRST_TUPOP_STATUS, 0, 1);
|
||||
}
|
||||
$this->fillStatus($dbInfo, $status, $complete);
|
||||
myself()->_rspData(
|
||||
array(
|
||||
'group' => $group,
|
||||
@ -109,4 +93,18 @@ class FirstTopupController extends BaseAuthedController {
|
||||
);
|
||||
}
|
||||
|
||||
private function fillStatus($dbInfo, &$status, &$complete)
|
||||
{
|
||||
$complete = 1;
|
||||
for ($i = 1; $i <= 3; ++$i) {
|
||||
if ($dbInfo['status' . $i] != 2) {
|
||||
$complete = 0;
|
||||
}
|
||||
$status[$i - 1] = $dbInfo['status' . $i];
|
||||
}
|
||||
if ($complete == 1 && myself()->_getV(TN_FIRST_TUPOP_STATUS, 0) == 0) {
|
||||
myself()->_setV(TN_FIRST_TUPOP_STATUS, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class FirstTopup extends BaseModel {
|
||||
$createDaySeconds = myself()->_getDaySeconds($dbInfo['createtime']);
|
||||
for ($i = 1; $i <= 3; ++$i) {
|
||||
if ($dbInfo['status' . $i] == 0) {
|
||||
$dbInfo['status' . $i] = $nowDaySeconds > $createDaySeconds + 3600 * 24 * $i ? 1 : 0;
|
||||
$dbInfo['status' . $i] = ($nowDaySeconds >= $createDaySeconds + 3600 * 24 * ($i - 1)) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user