fixing query
This commit is contained in:
@ -169,37 +169,48 @@ class Account extends Model
|
|||||||
// return $data;
|
// return $data;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public function getDepo($cust, $acc, $dataCore)
|
// public function getDepo($cust, $acc, $dataCore)
|
||||||
{
|
// {
|
||||||
|
|
||||||
//DD($cust, $acc, $dataCore);
|
// //DD($cust, $acc, $dataCore);
|
||||||
|
|
||||||
|
// $timestamp = strtotime($dataCore);
|
||||||
|
// // Format the timestamp into a date format
|
||||||
|
// $date = date("m/d/Y", $timestamp);
|
||||||
|
// // dd( $date);
|
||||||
|
// $matYear = date("Y", $timestamp);
|
||||||
|
|
||||||
|
// $data = DB::connection("db2")->table("MIS.FACT_DPK AS DPK")
|
||||||
|
// ->selectRaw('DPK.NO_REK,
|
||||||
|
// DPK.SUKU_BUNGA,
|
||||||
|
// DPK.JUMLAH_NOMINAL,
|
||||||
|
// DPK.KODE_SUB_PRODUK,
|
||||||
|
// PER.DATE AS PERIOD,
|
||||||
|
// MAT.DATE AS JATUH_TEMPO,
|
||||||
|
// CUR.KODE_MATA_UANG,
|
||||||
|
// DPK.SK_STATUS_DEPOSITO')
|
||||||
|
// ->join('MIS.DIM_PERIOD AS PER', 'DPK.SK_PERIOD', '=', 'PER.SK_PERIOD')
|
||||||
|
// ->join('MIS.DIM_PERIOD AS MAT', 'DPK.SK_JATUH_TEMPO', '=', 'MAT.SK_PERIOD')
|
||||||
|
// ->join('MIS.DIM_MATA_UANG AS CUR', 'DPK.SK_MATA_UANG', '=', 'CUR.SK_MATA_UANG')
|
||||||
|
// // ->where('CUSTOMER_NO', $cif)
|
||||||
|
// // ->where('LIMIT_REF', null)
|
||||||
|
// ->where('PER.DATE', $date)
|
||||||
|
// //->whereYear('MAT.DATE', '>', $matYear)
|
||||||
|
// ->whereIn('DPK.NO_REK', $acc)
|
||||||
|
// //->whereIn('DPK.NO_REK', '<>',$arrExp)
|
||||||
|
// // ->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'CATEGORY', 'LIMIT_REF')
|
||||||
|
// // ->orderBy('CATEGORY', 'ASC')
|
||||||
|
// ->limit(100);
|
||||||
|
// return $data;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public function getDepo($cust, $acc, $dataCore){
|
||||||
$timestamp = strtotime($dataCore);
|
$timestamp = strtotime($dataCore);
|
||||||
// Format the timestamp into a date format
|
|
||||||
$date = date("m/d/Y", $timestamp);
|
$date = date("m/d/Y", $timestamp);
|
||||||
// dd( $date);
|
$data = [];
|
||||||
$matYear = date("Y", $timestamp);
|
$data = DB::connection("db2")->table("MIS.VW_AA_DEPO")->select('*')
|
||||||
|
->whereIn('NO_REK', $acc)
|
||||||
$data = DB::connection("db2")->table("MIS.FACT_DPK AS DPK")
|
->where('PERIOD', $date)
|
||||||
->selectRaw('DPK.NO_REK,
|
|
||||||
DPK.SUKU_BUNGA,
|
|
||||||
DPK.JUMLAH_NOMINAL,
|
|
||||||
DPK.KODE_SUB_PRODUK,
|
|
||||||
PER.DATE AS PERIOD,
|
|
||||||
MAT.DATE AS JATUH_TEMPO,
|
|
||||||
CUR.KODE_MATA_UANG,
|
|
||||||
DPK.SK_STATUS_DEPOSITO')
|
|
||||||
->join('MIS.DIM_PERIOD AS PER', 'DPK.SK_PERIOD', '=', 'PER.SK_PERIOD')
|
|
||||||
->join('MIS.DIM_PERIOD AS MAT', 'DPK.SK_JATUH_TEMPO', '=', 'MAT.SK_PERIOD')
|
|
||||||
->join('MIS.DIM_MATA_UANG AS CUR', 'DPK.SK_MATA_UANG', '=', 'CUR.SK_MATA_UANG')
|
|
||||||
// ->where('CUSTOMER_NO', $cif)
|
|
||||||
// ->where('LIMIT_REF', null)
|
|
||||||
->where('PER.DATE', $date)
|
|
||||||
//->whereYear('MAT.DATE', '>', $matYear)
|
|
||||||
->whereIn('DPK.NO_REK', $acc)
|
|
||||||
//->whereIn('DPK.NO_REK', '<>',$arrExp)
|
|
||||||
// ->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'CATEGORY', 'LIMIT_REF')
|
|
||||||
// ->orderBy('CATEGORY', 'ASC')
|
|
||||||
->limit(100);
|
->limit(100);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class KonfirmasiBankController extends Controller
|
|||||||
if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) {
|
if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) {
|
||||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||||
}
|
}
|
||||||
// dd($request);
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$no_req_surat = '';
|
$no_req_surat = '';
|
||||||
// Contoh tanggal saat ini
|
// Contoh tanggal saat ini
|
||||||
@ -448,6 +448,7 @@ class KonfirmasiBankController extends Controller
|
|||||||
$DataDepo = [];
|
$DataDepo = [];
|
||||||
$Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCoreDepo)->get();
|
$Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCoreDepo)->get();
|
||||||
|
|
||||||
|
|
||||||
foreach ($Deposito as $keyDep => $depo) {
|
foreach ($Deposito as $keyDep => $depo) {
|
||||||
|
|
||||||
$DataDepo[$keyDep]['ACCOUNT_NUMBER'] = $depo->NO_REK;
|
$DataDepo[$keyDep]['ACCOUNT_NUMBER'] = $depo->NO_REK;
|
||||||
|
Reference in New Issue
Block a user