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();
|
||||
$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();
|
||||
if (!$f) {
|
||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||
@ -39,6 +40,7 @@ class Package
|
||||
$f->field_value = 20;
|
||||
$f->save();
|
||||
}
|
||||
}
|
||||
|
||||
if ($router_name == 'balance') {
|
||||
// insert table transactions
|
||||
@ -309,7 +311,6 @@ class Package
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if ($b) {
|
||||
@ -488,7 +489,6 @@ class Package
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
}
|
||||
|
||||
}
|
||||
run_hook("recharge_user_finish");
|
||||
Message::sendInvoice($c, $t);
|
||||
|
Loading…
x
Reference in New Issue
Block a user