Skip to content
Snippets Groups Projects
Commit 1c79c4a4 authored by Muhamad Visat's avatar Muhamad Visat
Browse files

join vendor user with users

parent 3473a350
Branches
No related merge requests found
Pipeline #1844 skipped
...@@ -19,10 +19,14 @@ class VendorUserController extends Controller ...@@ -19,10 +19,14 @@ class VendorUserController extends Controller
public function viewProfile($username) { public function viewProfile($username) {
$editable = Auth::check() ? Auth::user()['username'] === $username : false; $editable = Auth::check() ? Auth::user()['username'] === $username : false;
$user = User::where('username', $username)->first(); $userId = Auth::user()['id'];
$user = VendorUser::
join('users', 'VendorUser.userID', '=', 'users.id')->
where('userID', $userId)->
first();
$objects = ObjectSell:: $objects = ObjectSell::
join('ObjectType', 'ObjectSell.objectTypeID', '=', 'ObjectType.objectTypeID')-> join('ObjectType', 'ObjectSell.objectTypeID', '=', 'ObjectType.objectTypeID')->
where('vendorDBID', '=', $user->id)-> where('vendorDBID', '=', $user->vendorDBID)->
select('ObjectSell.*', 'ObjectType.objectTypeName')-> select('ObjectSell.*', 'ObjectType.objectTypeName')->
get(); get();
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<small class="m-l-sm text-info"><a href="#">{{ $user->email }}</a></small> <small class="m-l-sm text-info"><a href="#">{{ $user->email }}</a></small>
</div> </div>
<div class=""> <div class="">
<span class="text12 m-b-md text-grey"><i class="text-white fa fa-map-marker text14 m-r-xs"></i> [MOCK UP]Pasar Baru, Bandung</span> <span class="text12 m-b-md text-grey"><i class="text-white fa fa-map-marker text14 m-r-xs"></i> {{ $user->vendingPlace }}</span>
</div> </div>
<p class="m-b m-t-sm"> <p class="m-b m-t-sm">
<a href class="m-r-sm text-white btn-icon"><i class="text16 fa fa-twitter"></i></a> <a href class="m-r-sm text-white btn-icon"><i class="text16 fa fa-twitter"></i></a>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<small class="text-10 text-grey">Pembeli</small> <small class="text-10 text-grey">Pembeli</small>
</a> </a>
<a href class="inline padder-v padder-md"> <a href class="inline padder-v padder-md">
<span class="h3 block font-bold m-b-xs">47</span> <span class="h3 block font-bold m-b-xs">{{ count($objects) }}</span>
<small class="text-10 text-grey">Barang Dagangan</small> <small class="text-10 text-grey">Barang Dagangan</small>
</a> </a>
<a href class="inline padder-v padder-md"> <a href class="inline padder-v padder-md">
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment