Merge branch 'master' of ssh://gl.arguments.ru:2224/ak/anpdf

This commit is contained in:
arlemp@selectel.ru
2023-01-12 14:43:15 +03:00

View File

@@ -86,7 +86,7 @@ function resultpay_kuri(){
if (isset($result['event'])) {
$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);
if (!isset($find_order['buy_id'])) {
@@ -97,6 +97,13 @@ function resultpay_kuri(){
if ($result['event'] == "payment.succeeded"){
$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 = "
UPDATE
@@ -104,7 +111,8 @@ function resultpay_kuri(){
SET
`buy_status` = '1',
`buy_active` = '1',
`date` = '$currdate'
`date` = '$currdate',
`date_end` = '$date_end'
WHERE
`buy_id` = '{$find_order['buy_id']}'";