Fix user switch for resellers and company name on order

This commit is contained in:
Deon George 2018-08-12 11:09:44 +10:00
parent 5373e6b246
commit b737375be5
3 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ class Account extends Model
public function getSwitchUrlAttribute()
{
return sprintf('<a href="/a/switch/start/%s"><i class="fa fa-external-link"></i></a>',$this->user_id);
return sprintf('<a href="/r/switch/start/%s"><i class="fa fa-external-link"></i></a>',$this->user_id);
}
private function _address()

View File

@ -87,8 +87,8 @@
<label for="order_email">Client Account</label>
<select class="form-control" id="order_email" name="order_email">
<option value="">&nbsp;</option>
@foreach ($user->all_clients()->sortBy('sur_first_name') as $o)
<option value="{{ $o->email }}" @if($o->email == old('order_email')) selected @endif>{{ $o->sur_first_name }}</option>
@foreach ($user->all_accounts()->sortBy('company') as $o)
<option value="{{ $o->user->email }}" @if($o->user->email == old('order_email')) selected @endif>{{ $o->company }}</option>
@endforeach
</select>
<span class="help-block">{{ $errors->first('order_email') }}</span>

View File

@ -21,7 +21,6 @@ Route::get('image/generic/{width}/{height}/{color}/{name?}','MediaController@ima
Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'prefix'=>'a'], function() {
Route::get('setup','AdminHomeController@setup');
Route::post('setup','AdminHomeController@setup_update');
Route::get('switch/start/{id}','\Leenooks\Controllers\AdminController@user_switch_start')->name('switch.user.stop');
//Route::get('accounting/connect', 'AccountingController@connect');
});
@ -33,6 +32,7 @@ Route::group(['middleware'=>['theme:adminlte-be','auth','role:reseller'],'prefix
Route::get('supplier/index', 'SuppliersController@index');
Route::get('supplier/create', 'SuppliersController@create');
Route::post('supplier/store', 'SuppliersController@store');
Route::get('switch/start/{id}','\Leenooks\Controllers\AdminController@user_switch_start')->name('switch.user.stop');
Route::get('home/{o}', 'UserHomeController@user');
});