update array data
This commit is contained in:
@ -39,7 +39,8 @@ class ViewAccount extends Model
|
||||
];
|
||||
|
||||
public function getSearchAccount($cif ,$arrAccount, $kodecabang, $startDate){
|
||||
|
||||
// dd($cif ,$arrAccount, $kodecabang, $startDate);
|
||||
// dd($cif ,$arrAccount, $kodecabang, $startDate);
|
||||
$today = Carbon::now();
|
||||
$currentYear = $today->format("Y");
|
||||
$pastYear = $today->subYear(3)->format('Y');
|
||||
@ -52,14 +53,14 @@ class ViewAccount extends Model
|
||||
|
||||
if($arrAccount == null){
|
||||
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNT")
|
||||
->select( 'CUSTOMER_NO', 'ACCOUNT_NUMBER','SHORT_NAME','BATCH_DATE','INACTIV_MARKER','SHORT_TITLE','CURRENCY','COMPANY_NAME','OPENING_DATE',DB::raw('MAX(WORKING_BALANCE) AS WORKING_BALANCE'),DB::raw('MAX(CATEGORY) AS CATEGORY'))
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||
->select('*')
|
||||
->where('CUSTOMER_NO',$cif)
|
||||
->where('COMPANY_NAME', 'like', "%" .$uppercaseKodeCabang."%")
|
||||
->where('INACTIV_MARKER', NULL)
|
||||
->where('BATCH_DATE', 'LIKE', "%" .$startDate."%")
|
||||
->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660'])
|
||||
->groupBy('CUSTOMER_NO','ACCOUNT_NUMBER','SHORT_NAME','BATCH_DATE','SHORT_TITLE','CURRENCY','COMPANY_NAME','OPENING_DATE','INACTIV_MARKER');
|
||||
->where('BATCH_DATE', $startDate)
|
||||
->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660']);
|
||||
// ->groupBy('CUSTOMER_NO','ACCOUNT_NUMBER','SHORT_NAME','BATCH_DATE','SHORT_TITLE','CURRENCY','COMPANY_NAME','OPENING_DATE','INACTIV_MARKER');
|
||||
}else{
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNT")
|
||||
->select('*')
|
||||
@ -75,26 +76,25 @@ class ViewAccount extends Model
|
||||
|
||||
|
||||
public function getAccount($cif ,$arrAccount, $kodecabang, $startDate){
|
||||
// dd($cif ,$arrAccount, $kodecabang, $startDate);
|
||||
$uppercaseKodeCabang = Str::upper($kodecabang);
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNT")
|
||||
->select( 'CUSTOMER_NO', 'ACCOUNT_NUMBER','SHORT_NAME','BATCH_DATE','INACTIV_MARKER','SHORT_TITLE','CURRENCY','COMPANY_NAME','OPENING_DATE',DB::raw('MAX(WORKING_BALANCE) AS WORKING_BALANCE'),DB::raw('MAX(CATEGORY) AS CATEGORY'))
|
||||
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||
->select('*')
|
||||
->where('CUSTOMER_NO',$cif)
|
||||
->where('COMPANY_NAME', 'like', "%" .$uppercaseKodeCabang."%")
|
||||
->where('INACTIV_MARKER', NULL)
|
||||
->where('BATCH_DATE', 'LIKE', "%" .$startDate."%")
|
||||
->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660','101'])
|
||||
->whereIn('ACCOUNT_NUMBER', $arrAccount)
|
||||
->groupBy('CUSTOMER_NO','ACCOUNT_NUMBER','SHORT_NAME','BATCH_DATE','SHORT_TITLE','CURRENCY','COMPANY_NAME','OPENING_DATE','INACTIV_MARKER');
|
||||
->where('BATCH_DATE', 'like', "%" .$startDate."%")
|
||||
//->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660'])
|
||||
->whereIn('ACCOUNT_NUMBER', $arrAccount);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getAAaccount($cust){
|
||||
public function getAAaccount($cust, $acc){
|
||||
$data = [];
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_AA_ARR")->select('ARRANGEMENT_ID','CATEGORY','CATEGORY_NAME','PRODUCT_LINE','PRODUCT','CUSTOMER','LINKED_APPL_ID','MATURITY_DATE')
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_AA_ACCOUNT")->select('*')
|
||||
// ->where('CUSTOMER', $cif)
|
||||
->where('CUSTOMER', $cust)
|
||||
->where('CATEGORY', 3);
|
||||
->where('LINKED_APPL_ID', $acc);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user