add new page konfirmasi bank
This commit is contained in:
@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
class ViewAccount extends Model
|
||||
@ -35,6 +36,32 @@ class ViewAccount extends Model
|
||||
'MATURITY_DATE'"
|
||||
];
|
||||
|
||||
public function getSearchAccount($cif , $kodecabang, $periode){
|
||||
// $store = DB::connection('oracle');
|
||||
$currentDate = Carbon::now();
|
||||
$formattedDate = $currentDate->format('Y');
|
||||
|
||||
$data = [];
|
||||
|
||||
if ($cif != null && $kodecabang == null && $periode == null) {
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||
->where('CUSTOMER_NO',$cif)
|
||||
->where('BATCH_DATE','LIKE','%'.$formattedDate.'%');
|
||||
} elseif ($cif != null && $kodecabang != null && $periode == null) {
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||
->where('CUSTOMER_NO',$cif)
|
||||
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
|
||||
->where('BATCH_DATE','LIKE','%'.$formattedDate.'%');
|
||||
}else {
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||
->where('CUSTOMER_NO',$cif)
|
||||
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
|
||||
->where('BATCH_DATE','LIKE','%'.$periode.'%');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getAccount($cus_no,$account,$kodecabang,$periode){
|
||||
$data = [];
|
||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")->select('*')->where('CUSTOMER_NO',$cus_no)->whereIn('ACCOUNT_NUMBER',$account)->get();
|
||||
|
Reference in New Issue
Block a user