fix issues lelong arrahnbid
This commit is contained in:
@@ -58,6 +58,7 @@ class HomeController extends Controller
|
||||
$bilanganlelong = 0;
|
||||
foreach($CustomerInfo['lelong'] as $index1=>$lelong)
|
||||
{
|
||||
$bilangan++;
|
||||
$bilanganlelong += 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\LelongBid;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -37,6 +38,16 @@ class InformationController extends Controller
|
||||
$pembiayaansemasa = $CustomerInfo['gadai'];
|
||||
}
|
||||
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lelong){
|
||||
$array_lelong = LelongBid::select('fasa','t_lelong')->where([['norujukan',$lelong['norujukan']],['hargajual','>',0]])->first()->toArray();
|
||||
$CustomerInfo['lelong'][$index] = collect($lelong)->merge($array_lelong)->toArray();
|
||||
}
|
||||
$pembiayaansemasa = collect($pembiayaansemasa)->merge($CustomerInfo['lelong']);
|
||||
}
|
||||
}
|
||||
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
||||
return response()->json($pembiayaansemasa,200);
|
||||
// return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa'));
|
||||
}
|
||||
@@ -71,9 +82,15 @@ class InformationController extends Controller
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$lelong = [];
|
||||
if(isset($CustomerInfo['lelong']))
|
||||
{
|
||||
$lelong += $CustomerInfo['lelong'];
|
||||
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lel){
|
||||
$array_lelong = LelongBid::select('fasa','t_lelong')->where([['norujukan',$lel['norujukan']],['hargajual','>',0]])->first()->toArray();
|
||||
$CustomerInfo['lelong'][$index] = collect($lel)->merge($array_lelong)->toArray();
|
||||
}
|
||||
$lelong = collect($lelong)->merge($CustomerInfo['lelong']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,3 +105,4 @@ class InformationController extends Controller
|
||||
return view('auth.termasyarat', compact('termasyarat'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LelongBid extends Model
|
||||
{
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $table = 'lelongbid';
|
||||
protected $connection = 'lelong';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'lelong_id',
|
||||
'caw_id',
|
||||
'kodcaw',
|
||||
'norujukan',
|
||||
't_lelong',
|
||||
'hargaasas',
|
||||
'hargajual',
|
||||
't_jual',
|
||||
'nopembeli',
|
||||
'jbg',
|
||||
'kadarupah',
|
||||
'upahsimpan',
|
||||
'ansuran',
|
||||
'nilaimarhun',
|
||||
'nmarhuns',
|
||||
'pinjaman',
|
||||
'bakiupah',
|
||||
'cajlain',
|
||||
'cajlelong',
|
||||
'baki',
|
||||
'berat',
|
||||
'marhun',
|
||||
'percent',
|
||||
'status_jual',
|
||||
'status_payment',
|
||||
'status_semak',
|
||||
'diserahkan_pada',
|
||||
'mora_upah',
|
||||
'fasa',
|
||||
'opencash',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public $timestamps = true;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,28 @@ return [
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'lelong' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST_LELONG', '127.0.0.1'),
|
||||
'port' => env('DB_PORT_LELONG', '3306'),
|
||||
'database' => env('DB_DATABASE_LELONG', 'lelong'),
|
||||
'username' => env('DB_USERNAME_LELONG', 'root'),
|
||||
'password' => env('DB_PASSWORD_LELONG', ''),
|
||||
'unix_socket' => env('DB_SOCKET_LELONG', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
|
||||
Reference in New Issue
Block a user