Anpassung

Dienstplan als Endlosdatei für Appanbindung
This commit is contained in:
ppa. Marco Glietsch 2021-12-10 13:21:03 +01:00
parent ce55c66371
commit c948934ca4

View File

@ -291,9 +291,12 @@ class ServiceController extends PostController
$model = $this->newModel()
->select('posts.*', 'tags3.name as serviceType', 'posts.type')
->isPublished()
->where('posts.type', $this->modelType)
->where(DB::raw('year(datetime)'), $year)
->join('post_tag as post_tag1', function($join){
->where('posts.type', $this->modelType);
if(strtolower($year) != "app")
{
$model = $model->where(DB::raw('year(datetime)'), $year);
}
$model = $model->join('post_tag as post_tag1', function($join){
$join->on('posts.id', 'post_tag1.post_id');
})
->join('tags as tags1', function($join) use($department){
@ -327,12 +330,12 @@ class ServiceController extends PostController
{
$department = TagHelper::getTagNameByType($model[0], 'abteilung');
$instance = TagHelper::getTagNameByType($model[0], 'instanz');
$year = Carbon::parse($model[0]->datetime)->format('Y');
$year2 = Carbon::parse($model[0]->datetime)->format('Y');
$model = $this->getNextService($model, $department, $instance, $year);
}
$this->prepareModel2($model);
$model->type = $this->modelType;
$model->year = $year;
$model->year = $year2;
$model->department = $department;
$model->instance = $instance;
$model->isMainPost = true;