Kaynağa Gözat

手持收货只限GM货主

eric2h 3 yıl önce
ebeveyn
işleme
930463d644
1 değiştirilmiş dosya ile 13 ekleme ve 2 silme
  1. 13 2
      routes/web.php

+ 13 - 2
routes/web.php

@@ -606,10 +606,21 @@ Route::group(['middleware' => 'auth'], function ($route) {
         /** 手持入库 */
         Route::group(['prefix' => 'handInStorage'], function () {
             Route::get('receive', function () {
-                return view('store.handInStorage.receive');
+                /** @var \App\Services\UserService  $userService */
+                $userService=app(\App\Services\UserService::class);
+                $ownerIds=$userService->getUserUnderOwnerIdArr();
+                $isGm=\App\Owner::query()->where("code","GM")->first()['id'];
+                if (in_array($isGm,$ownerIds)){
+                    return view('store.handInStorage.receive');
+                }
             });//收货页面
             Route::get('putaway', function () {
-                return view('store.handInStorage.putaway');
+                $userService=app(\App\Services\UserService::class);
+                $ownerIds=$userService->getUserUnderOwnerIdArr();
+                $isGm=\App\Owner::query()->where("code","GM")->first()['id'];
+                if (in_array($isGm,$ownerIds)){
+                    return view('store.handInStorage.putaway');
+                }
             });//上架页面
             Route::get('inventoryInfo', function () {
                 return view('store.handInStorage.inventoryInfo');