fix skit2
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -22,6 +23,7 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$harga_emas = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/')->json();
|
||||
|
||||
$hargaemasterdahulu = array();
|
||||
@@ -36,6 +38,29 @@ class HomeController extends Controller
|
||||
|
||||
}
|
||||
|
||||
return view('includes.home',compact('hargaemasterdahulu'));
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$total = 0.00;
|
||||
$sixmonths = 0;
|
||||
$bilangan = 0;
|
||||
foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$bilangan++;
|
||||
$total += $gadai['pinjaman'];
|
||||
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
$sixmonths++;
|
||||
}
|
||||
}
|
||||
|
||||
$bilanganlelong = 0;
|
||||
foreach($CustomerInfo['lelong'] as $index1=>$lelong)
|
||||
{
|
||||
$bilanganlelong += 1;
|
||||
}
|
||||
|
||||
return view('includes.home',compact('hargaemasterdahulu','bilangan','sixmonths','total','bilanganlelong'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user