susee
This commit is contained in:
parent
3e44568c30
commit
3d83a81a2b
@ -22,6 +22,8 @@ use App\Models\Member_model;
|
||||
|
||||
use App\Models\Transaction_model;
|
||||
|
||||
use App\Models\Rule_model;
|
||||
|
||||
|
||||
|
||||
class Sendmail_controller extends BaseController
|
||||
@ -54,6 +56,8 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
$this->TransactionModel = new Transaction_model();
|
||||
|
||||
$this->RuleModel = new Rule_model();
|
||||
|
||||
helper(['form', 'url']);
|
||||
|
||||
|
||||
@ -303,17 +307,17 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
|
||||
|
||||
$TransactionData = $this->TransactionModel->where('member_id', session()->get('logged_user'))->orderBy('created_at', 'DESC')->first();
|
||||
// $TransactionData = $this->TransactionModel->where('member_id', session()->get('logged_user'))->orderBy('created_at', 'DESC')->first();
|
||||
|
||||
$Transaction_id = $TransactionData['transaction_id'];
|
||||
// $Transaction_id = $TransactionData['transaction_id'];
|
||||
|
||||
$timestamp = strtotime($TransactionData['created_at']);
|
||||
// $timestamp = strtotime($TransactionData['created_at']);
|
||||
|
||||
$Transaction_date = date('l, F j, Y', $timestamp);
|
||||
// $Transaction_date = date('l, F j, Y', $timestamp);
|
||||
|
||||
$amount = json_decode($TransactionData['transaction'] , true)['payment']['amount_money']['amount'];
|
||||
// $amount = json_decode($TransactionData['transaction'] , true)['payment']['amount_money']['amount'];
|
||||
|
||||
$payment_method = json_decode($TransactionData['transaction'] , true)['payment']['source_type'];
|
||||
// $payment_method = json_decode($TransactionData['transaction'] , true)['payment']['source_type'];
|
||||
|
||||
|
||||
|
||||
@ -325,17 +329,41 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
$email->setCC($temp_data[0]['to']);
|
||||
|
||||
if ($temp_data) {
|
||||
$data['TransactionData'] = $this->TransactionModel->where('order_id', $code )->where('member_id', session()->get('logged_user'))->find();
|
||||
$memberCredits = $this->creditsModel->where('order_id', $code )
|
||||
->where('member_id', session()->get('logged_user'))
|
||||
->select('package_name')
|
||||
->select('cost')
|
||||
->selectSum('credit_points', 'credit_points')
|
||||
->selectSum('cost', 'costSum')
|
||||
->selectCount('package_name', 'pack_count')
|
||||
->groupBy('package_name')->findAll();
|
||||
$Subtotal = 0;
|
||||
foreach ($memberCredits as $key => $ele) {
|
||||
$Subtotal = $Subtotal + $ele['costSum'];
|
||||
}
|
||||
$data['memberCredits'] =$memberCredits;
|
||||
$data['order_id'] = $code;
|
||||
$timestamp = strtotime($data['TransactionData'][0]['created_at']);
|
||||
$data['formattedDate'] = date('l, F j, Y', $timestamp);
|
||||
$data['Subtotal'] = $Subtotal;
|
||||
$data['gst'] = $this->RuleModel->select('value')->where('rule_key', 3 )->get()->getRow()->value;
|
||||
$data['pst'] = $this->RuleModel->select('value')->where('rule_key', 4 )->get()->getRow()->value;
|
||||
$data['card_brand'] = json_decode($data['TransactionData'][0]['transaction'] , true)['payment']['card_details']['card']['card_brand'];
|
||||
$data['last_4'] = json_decode($data['TransactionData'][0]['transaction'] , true)['payment']['card_details']['card']['last_4'];
|
||||
$data['html'] = view('success_mail',$data);
|
||||
|
||||
$data['html'] = str_replace("%name%",session()->get('logged_user_name'),$temp_data[0]['html']);
|
||||
// if ($temp_data) {
|
||||
|
||||
$data['html'] = str_replace("%id%",$Transaction_id,$temp_data[0]['html']);
|
||||
// $data['html'] = str_replace("%name%",session()->get('logged_user_name'),$temp_data[0]['html']);
|
||||
|
||||
$data['html'] = str_replace("%method%",$payment_method,$temp_data[0]['html']);
|
||||
// $data['html'] = str_replace("%id%",$Transaction_id,$temp_data[0]['html']);
|
||||
|
||||
$data['html'] = str_replace("%date%", $Transaction_date,$temp_data[0]['html']);
|
||||
// $data['html'] = str_replace("%method%",$payment_method,$temp_data[0]['html']);
|
||||
|
||||
$data['html'] = str_replace("%amount%",$amount,$temp_data[0]['html']);
|
||||
// $data['html'] = str_replace("%date%", $Transaction_date,$temp_data[0]['html']);
|
||||
|
||||
// $data['html'] = str_replace("%amount%",$amount,$temp_data[0]['html']);
|
||||
|
||||
|
||||
|
||||
@ -343,7 +371,7 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
$message = view('verification_mail_temp',$data);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
if ($temp_data[0]['is_active'] == 1)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user