67 lines
1.9 KiB
PHP
67 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Spatie\Permission\Models\Role;
|
|
use Spatie\Permission\Models\Permission;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
use App\Models\Lelong;
|
|
use App\Models\CawanganLelong;
|
|
use Carbon\Carbon;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
/**
|
|
* Show the application dashboard.
|
|
*
|
|
* @return \Illuminate\Contracts\Support\Renderable
|
|
*/
|
|
public function index()
|
|
{
|
|
// $user = Auth::user();
|
|
// $user->assignRole('admin');
|
|
$dateTime = date('Y-m-d');
|
|
$arrayinfo = [];
|
|
|
|
$lelong = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
|
|
->select('lelong.fasa','cawangan_lelong.lelong_id','lelong.tarikh_lelong','lelong.masatamat_lelong','lelong.harga_emas_asas','lelong.jbg','lelong.cajlelong','lelong.sts_lelong')
|
|
->where('tarikh_lelong', $dateTime)
|
|
->groupBy('lelong_id')
|
|
->get()
|
|
->toArray();
|
|
|
|
foreach($lelong as $info)
|
|
{
|
|
|
|
$detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
|
->select('batchlel','lelong_id','cawangan_lelong.caw_id','cawangan.caw_name','cawangan.caw_code','status_online','cawangan_lelong.masamula_lelong','cawangan_lelong.masatamat_lelong')
|
|
->where('lelong_id',$info['lelong_id'])
|
|
->get()
|
|
->toArray();
|
|
array_push($arrayinfo,['info'=>$info, 'detailsinfo'=>$detailsinfo]);
|
|
|
|
|
|
}//dd($detailsinfo);
|
|
return view('home',compact('lelong', 'arrayinfo'));
|
|
}
|
|
|
|
public function about()
|
|
{
|
|
// $user = Auth::user();
|
|
// $user->assignRole('admin');
|
|
return view('about');
|
|
}
|
|
}
|