1
This commit is contained in:
parent
336a2767a7
commit
1c93734ae0
@ -31,15 +31,7 @@ class FirstTopupController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
FirstTopup::adjustStatus($dbInfo);
|
FirstTopup::adjustStatus($dbInfo);
|
||||||
$complete = 1;
|
$complete = 1;
|
||||||
for ($i = 1; $i <= 3; ++$i) {
|
$this->fillStatus($dbInfo, $status, $complete);
|
||||||
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->_rspData(
|
$this->_rspData(
|
||||||
array(
|
array(
|
||||||
'complete' => $complete,
|
'complete' => $complete,
|
||||||
@ -83,22 +75,14 @@ class FirstTopupController extends BaseAuthedController {
|
|||||||
for ($i = 0; $i < count($reward); $i++) {
|
for ($i = 0; $i < count($reward); $i++) {
|
||||||
array_push($awardItems,
|
array_push($awardItems,
|
||||||
array(
|
array(
|
||||||
$item['goods_id'],
|
'item_id' => $item['goods_id'],
|
||||||
$item['goods_num']
|
'item_num' => $item['goods_num']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
myself()->_addItems($awardItems, $awardService, $propertyChgService);
|
myself()->_addItems($awardItems, $awardService, $propertyChgService);
|
||||||
|
$status = array(0, 0, 0);
|
||||||
$complete = 1;
|
$complete = 1;
|
||||||
for ($i = 1; $i <= 3; ++$i) {
|
$this->fillStatus($dbInfo, $status, $complete);
|
||||||
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);
|
|
||||||
}
|
|
||||||
myself()->_rspData(
|
myself()->_rspData(
|
||||||
array(
|
array(
|
||||||
'group' => $group,
|
'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']);
|
$createDaySeconds = myself()->_getDaySeconds($dbInfo['createtime']);
|
||||||
for ($i = 1; $i <= 3; ++$i) {
|
for ($i = 1; $i <= 3; ++$i) {
|
||||||
if ($dbInfo['status' . $i] == 0) {
|
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