|
|
|
@ -3,6 +3,8 @@ |
|
|
|
namespace App\Admin\Controllers\v3; |
|
|
|
|
|
|
|
use App\Admin\Repositories\v3\Store; |
|
|
|
use App\Models\LanzuMmInfo; |
|
|
|
use Dcat\Admin\Admin; |
|
|
|
use Dcat\Admin\Form; |
|
|
|
use Dcat\Admin\Grid; |
|
|
|
use Dcat\Admin\Show; |
|
|
|
@ -26,7 +28,14 @@ class StoreController extends AdminController |
|
|
|
*/ |
|
|
|
protected function grid() |
|
|
|
{ |
|
|
|
return Grid::make(new Store(), function (Grid $grid) { |
|
|
|
$user = Admin::user(); |
|
|
|
$builder = new Store(); |
|
|
|
if ($user->isRole('lanzu_mm')) { |
|
|
|
//如果登陆角色为市场经理,获取市场经理id
|
|
|
|
$mm = LanzuMmInfo::where(['admin_user_id' => $user->id])->first(); |
|
|
|
$builder = StoreModel::where(['mm_user_id' => $mm->user_id]); |
|
|
|
} |
|
|
|
return Grid::make($builder, function (Grid $grid) { |
|
|
|
$grid->model()->orderBy('id','desc'); |
|
|
|
$grid->id->sortable(); |
|
|
|
$grid->logo_url->image('',50); |
|
|
|
|