add +1 year in subscript anpay.php
This commit is contained in:
@@ -86,7 +86,7 @@ function resultpay_kuri(){
|
|||||||
if (isset($result['event'])) {
|
if (isset($result['event'])) {
|
||||||
|
|
||||||
$shop_id = $result['object']['id'];
|
$shop_id = $result['object']['id'];
|
||||||
$find_sql = "SELECT `buy_id`, `delivery_id`, `number_id` FROM `anbuy` WHERE `shop_id` = '$shop_id' LIMIT 1";
|
$find_sql = "SELECT `buy_id`, `delivery_id`, `number_id`, `date_end` FROM `anbuy` WHERE `shop_id` = '$shop_id' LIMIT 1";
|
||||||
$find_order = db_get($find_sql);
|
$find_order = db_get($find_sql);
|
||||||
|
|
||||||
if (!isset($find_order['buy_id'])) {
|
if (!isset($find_order['buy_id'])) {
|
||||||
@@ -97,6 +97,13 @@ function resultpay_kuri(){
|
|||||||
if ($result['event'] == "payment.succeeded"){
|
if ($result['event'] == "payment.succeeded"){
|
||||||
|
|
||||||
$currdate = date('Y-m-d H:i:s');
|
$currdate = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
if ($find_order['number_id'] == 486){
|
||||||
|
$date_end = date("Y-m-d H:i:s", strtotime("+1 year"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$date_end = $find_order['date_end'];
|
||||||
|
}
|
||||||
|
|
||||||
$supd = "
|
$supd = "
|
||||||
UPDATE
|
UPDATE
|
||||||
@@ -104,7 +111,8 @@ function resultpay_kuri(){
|
|||||||
SET
|
SET
|
||||||
`buy_status` = '1',
|
`buy_status` = '1',
|
||||||
`buy_active` = '1',
|
`buy_active` = '1',
|
||||||
`date` = '$currdate'
|
`date` = '$currdate',
|
||||||
|
`date_end` = '$date_end'
|
||||||
WHERE
|
WHERE
|
||||||
`buy_id` = '{$find_order['buy_id']}'";
|
`buy_id` = '{$find_order['buy_id']}'";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user