diff --git a/app/Http/Controllers/API/ContractController.php b/app/Http/Controllers/API/ContractController.php index b739dcbf..e95e870b 100644 --- a/app/Http/Controllers/API/ContractController.php +++ b/app/Http/Controllers/API/ContractController.php @@ -48,8 +48,9 @@ public function resolutionBasis(Request $request){ $resolution['department_id'] = $entry['Department_ID']; $resolution['resolution_id'] = $entry['Resolution_ID']; $resolution['resolutionbasis'] = $entry['ResolutionBasis']; + $resolution['foreign_id'] = $entry['ID']; - $res = Resolutionbasis::where('contract_id', $resolution['contract_id'])->first(); + $res = Resolutionbasis::where('foreign_id', $resolution['foreign_id'])->first(); if($res == null){ Resolutionbasis::create($resolution); } diff --git a/app/Http/Controllers/Admin/DocumentCrudController.php b/app/Http/Controllers/Admin/DocumentCrudController.php index 94eef172..32df0bbb 100755 --- a/app/Http/Controllers/Admin/DocumentCrudController.php +++ b/app/Http/Controllers/Admin/DocumentCrudController.php @@ -74,11 +74,19 @@ public function setup() ], function() { return Country::all()->pluck('name', 'id')->toArray(); }, function($values) { - //$values = is_array($values)?$values:array($values); - foreach (json_decode($values) as $key => $value) { - $this->crud->query = $this->crud->query->whereHas('countries', function ($query) use ($value) { - $query->where('country_id', $value); - }); + if(!is_array($values)){ + foreach (json_decode($values) as $key => $value) { + $this->crud->query = $this->crud->query->whereHas('countries', function ($query) use ($value) { + $query->where('country_id', $value); + }); + } + } + else{ + foreach ($values as $key => $value) { + $this->crud->query = $this->crud->query->whereHas('countries', function ($query) use ($value) { + $query->where('country_id', $value); + }); + } } }); } diff --git a/database/migrations/2022_11_24_102558_add_foreign_to_resolutionbasis_table.php b/database/migrations/2022_11_24_102558_add_foreign_to_resolutionbasis_table.php new file mode 100644 index 00000000..3273d10a --- /dev/null +++ b/database/migrations/2022_11_24_102558_add_foreign_to_resolutionbasis_table.php @@ -0,0 +1,32 @@ +bigInteger('foreign_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('resolutionbasis', function (Blueprint $table) { + // + }); + } +}; diff --git a/resources/views/vendor/backpack/base/dashboard.blade.php b/resources/views/vendor/backpack/base/dashboard.blade.php index 7b8f3d6a..efe15d5b 100644 --- a/resources/views/vendor/backpack/base/dashboard.blade.php +++ b/resources/views/vendor/backpack/base/dashboard.blade.php @@ -139,7 +139,7 @@
-
{{ App\Models\Application::where('accepted_by', null)->orWhere('accepted_by', '')->where('state', 'applied')->count() }} @lang('app.dashboard.new')
+
{{ App\Models\Application::where('state', 'new')->orWhere('state', 'New')->count() }} @lang('app.dashboard.new')
@lang('app.dashboard.new_applications')