if ($p['validity_unit'] == 'Period') then add Expired Date
This commit is contained in:
parent
37a5ee8566
commit
cfefd38a31
@ -31,6 +31,7 @@ class Package
|
|||||||
|
|
||||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
|
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
|
||||||
|
if ($p['validity_unit'] == 'Period') {
|
||||||
$f = ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one();
|
$f = ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one();
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||||
@ -39,6 +40,7 @@ class Package
|
|||||||
$f->field_value = 20;
|
$f->field_value = 20;
|
||||||
$f->save();
|
$f->save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($router_name == 'balance') {
|
if ($router_name == 'balance') {
|
||||||
// insert table transactions
|
// insert table transactions
|
||||||
@ -309,7 +311,6 @@ class Package
|
|||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ($b) {
|
if ($b) {
|
||||||
@ -488,7 +489,6 @@ class Package
|
|||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
run_hook("recharge_user_finish");
|
run_hook("recharge_user_finish");
|
||||||
Message::sendInvoice($c, $t);
|
Message::sendInvoice($c, $t);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user