- add additional migration files
- add seeder for collections - coverage x_min, x_max, y_min, y_max - SitelinkController db-independent
This commit is contained in:
parent
4d22498e2d
commit
c082b4bc60
25 changed files with 463 additions and 86 deletions
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Frontend;
|
|||
use App\Models\Dataset;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use DateTime;
|
||||
|
||||
class SitelinkController extends Controller
|
||||
{
|
||||
|
@ -15,13 +16,20 @@ class SitelinkController extends Controller
|
|||
$select = DB::table('documents')
|
||||
->where('server_state', 'LIKE', "%" . $serverState . "%");
|
||||
|
||||
$select
|
||||
// ->select(DB::raw('EXTRACT(YEAR FROM server_date_published) as published_date'))
|
||||
// ->select(DB::raw("DATE_PART('year', server_date_published) as published_date"))
|
||||
->select(DB::raw("YEAR(server_date_published) AS published_date"))
|
||||
->distinct(true);
|
||||
|
||||
$this->years = $select->pluck('published_date');
|
||||
// $select
|
||||
// ->select(DB::raw('EXTRACT(YEAR FROM server_date_published) as published_date'))
|
||||
// // ->select(DB::raw("DATE_PART('year', server_date_published) as published_date"))
|
||||
// // ->select(DB::raw("YEAR(server_date_published) AS published_date"))
|
||||
// ->distinct(true);
|
||||
|
||||
$years = $select->pluck('server_date_published')->toArray();
|
||||
$this->years = array_map(function ($pdate) {
|
||||
$dateValue = strtotime($pdate);
|
||||
if ($dateValue != false) {
|
||||
$year = date("Y", $dateValue);
|
||||
return $year;
|
||||
}
|
||||
}, $years);
|
||||
$this->ids = array();
|
||||
return view('frontend.sitelink.index')->with(['years' => $this->years, 'documents' => $this->ids]);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class IndexController extends Controller
|
|||
|
||||
$keywordTypes = ['uncontrolled' => 'uncontrolled'];
|
||||
|
||||
$descriptionTypes = [ 'methods' => 'methods', 'series_information' => 'series_information', 'technical_info' => 'technical_info', 'translated' => 'translated', 'other' => 'other'];
|
||||
$descriptionTypes = ['methods' => 'methods', 'series_information' => 'series_information', 'technical_info' => 'technical_info', 'translated' => 'translated', 'other' => 'other'];
|
||||
|
||||
$page = Page::query()->where('page_slug', 'terms-and-conditions')->firstOrFail();
|
||||
|
||||
|
@ -250,19 +250,19 @@ class IndexController extends Controller
|
|||
'title_main.language' => 'required',
|
||||
'abstract_main.value' => 'required|min:4',
|
||||
'abstract_main.language' => 'required',
|
||||
'coverage.xmin' => [
|
||||
'coverage.x_min' => [
|
||||
'nullable',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
],
|
||||
'coverage.ymin' => [
|
||||
'coverage.y_min' => [
|
||||
'nullable',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
],
|
||||
'coverage.xmax' => [
|
||||
'coverage.x_max' => [
|
||||
'nullable',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
],
|
||||
'coverage.ymax' => [
|
||||
'coverage.y_max' => [
|
||||
'nullable',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
],
|
||||
|
|
|
@ -82,7 +82,7 @@ class PersonController extends Controller
|
|||
'email' => 'required|email|unique:persons,email,' . $id,
|
||||
'identifier_orcid' => 'nullable|min:19|max:50',
|
||||
'status' => 'required|boolean',
|
||||
'date_of_birth' => 'required|date'
|
||||
'date_of_birth' => 'nullable|date'
|
||||
]);
|
||||
$person = Person::findOrFail($id);
|
||||
$input = $request->all();
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class BookRequest extends Request
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'title' => 'required|min:5',
|
||||
'author' => 'required|min:4',
|
||||
'stock' => 'required|integer',
|
||||
'year' => 'required|integer|min:4'
|
||||
];
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ class CreatePersonRequest extends Request
|
|||
// ],
|
||||
'identifier_orcid' => 'nullable|min:19|max:50',
|
||||
'status' => 'required|boolean',
|
||||
'date_of_birth' => 'required|date'
|
||||
'date_of_birth' => 'nullable|date'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class EditPersonRequest extends Request
|
|||
// ],
|
||||
'identifier_orcid' => 'nullable|min:19|max:50',
|
||||
'status' => 'required|boolean',
|
||||
'date_of_birth' => 'required|date'
|
||||
'date_of_birth' => 'nullable|date'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class Coverage extends Model
|
|||
'time_min',
|
||||
'time_max',
|
||||
'time_absolut',
|
||||
'xmin', 'xmax', 'ymin', 'ymax'
|
||||
'x_min', 'x_max', 'y_min', 'y_max'
|
||||
];
|
||||
|
||||
public function dataset()
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue