|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
namespace App\Admin\Controllers\v3; |
|
|
namespace App\Admin\Controllers\v3; |
|
|
|
|
|
|
|
|
|
|
|
use App\Admin\Common\Auth; |
|
|
use App\Admin\Repositories\v3\Store; |
|
|
use App\Admin\Repositories\v3\Store; |
|
|
use App\Models\LanzuMmInfo; |
|
|
use App\Models\LanzuMmInfo; |
|
|
use Dcat\Admin\Admin; |
|
|
use Dcat\Admin\Admin; |
|
|
@ -34,6 +35,10 @@ class StoreController extends AdminController |
|
|
//如果登陆角色为市场经理,获取市场经理id
|
|
|
//如果登陆角色为市场经理,获取市场经理id
|
|
|
$mm = LanzuMmInfo::where(['admin_user_id' => $user->id])->first(); |
|
|
$mm = LanzuMmInfo::where(['admin_user_id' => $user->id])->first(); |
|
|
$builder = StoreModel::where(['mm_user_id' => $mm->user_id]); |
|
|
$builder = StoreModel::where(['mm_user_id' => $mm->user_id]); |
|
|
|
|
|
}elseif ($user->isRole('market_service')){ |
|
|
|
|
|
//如果登陆角色为市场服务站,获取市场id
|
|
|
|
|
|
$marketId = Auth::getMarket(); |
|
|
|
|
|
$builder = StoreModel::where('market_id',$marketId); |
|
|
} |
|
|
} |
|
|
return Grid::make($builder, function (Grid $grid) { |
|
|
return Grid::make($builder, function (Grid $grid) { |
|
|
// 查询市场
|
|
|
// 查询市场
|
|
|
@ -87,6 +92,11 @@ class StoreController extends AdminController |
|
|
$grid->paginate(10); |
|
|
$grid->paginate(10); |
|
|
|
|
|
|
|
|
// $grid->disableDeleteButton();
|
|
|
// $grid->disableDeleteButton();
|
|
|
|
|
|
if (Admin::user()->isRole('market_service')){ |
|
|
|
|
|
//如果是市场服务站角色,关闭编辑,删除按钮操作
|
|
|
|
|
|
$grid->disableDeleteButton(); |
|
|
|
|
|
$grid->disableEditButton(); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -153,10 +163,11 @@ class StoreController extends AdminController |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$show->panel()->tools(function ($tools) { |
|
|
$show->panel()->tools(function ($tools) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tools->disableDelete(); |
|
|
$tools->disableDelete(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
$show->disableEditButton(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -283,7 +294,7 @@ class StoreController extends AdminController |
|
|
if($form->isEditing()){ |
|
|
if($form->isEditing()){ |
|
|
$storeM->where([['id','<>',$id?$id:0]]); |
|
|
$storeM->where([['id','<>',$id?$id:0]]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$store = $storeM->first(); |
|
|
$store = $storeM->first(); |
|
|
if(!empty($store)){ |
|
|
if(!empty($store)){ |
|
|
return $form->error('管理员已经绑定了店铺'); |
|
|
return $form->error('管理员已经绑定了店铺'); |
|
|
@ -292,7 +303,7 @@ class StoreController extends AdminController |
|
|
}); |
|
|
}); |
|
|
$form->saved(function (Form $form){ |
|
|
$form->saved(function (Form $form){ |
|
|
$id = $form->getKey(); |
|
|
$id = $form->getKey(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$store = StoreModel::find($id); |
|
|
$store = StoreModel::find($id); |
|
|
|
|
|
|
|
|
// 添加商户钱包
|
|
|
// 添加商户钱包
|
|
|
|