IQ Reisebausteine bis Gruppe
This commit is contained in:
parent
6880c7e989
commit
9baa1a6233
43 changed files with 2206 additions and 24 deletions
|
|
@ -46,7 +46,7 @@ class ContentSiteRepository extends BaseRepository {
|
|||
$site_field = false;
|
||||
// $site_field = IQContentSiteField::getSiteFieldOrNew($contentSite->id, $model_field->id);
|
||||
//new
|
||||
if(!$site_field->id){
|
||||
/*if(!$site_field->id){
|
||||
$site_field->site_id = $contentSite->id;
|
||||
$site_field->model_field_id = $model_field->id;
|
||||
$site_field->field = $model_field->field;
|
||||
|
|
@ -57,7 +57,7 @@ class ContentSiteRepository extends BaseRepository {
|
|||
|
||||
}else{
|
||||
|
||||
}
|
||||
}*/
|
||||
$ret[] = $site_field;
|
||||
}
|
||||
|
||||
|
|
|
|||
89
app/Repositories/IQ/TravelRepository.php
Normal file
89
app/Repositories/IQ/TravelRepository.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories\IQ;
|
||||
|
||||
use App\Models\IQTravelGroup;
|
||||
use App\Models\IQTravelGroupItem;
|
||||
use App\Models\IQTravelItem;
|
||||
use App\Models\IQTravelItemPlace;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class TravelRepository extends BaseRepository {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function updateTravelGroup($id, $data)
|
||||
{
|
||||
|
||||
if($id == "new"){
|
||||
$this->model = IQTravelGroup::create($data);
|
||||
}
|
||||
else{
|
||||
$this->model = IQTravelGroup::findOrFail($id);
|
||||
$this->model->fill($data);
|
||||
$this->model->save();
|
||||
}
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateTravelGroupItem($id, $data)
|
||||
{
|
||||
$data['pos'] = $data['pos'] ? intval($data['pos']) : 0;
|
||||
$data['i_q_travel_group_id'] = $data['iq_travel_group_id'];
|
||||
|
||||
if($data['iq_travel_group_item_id'] == "new"){
|
||||
$this->model = IQTravelGroupItem::create($data);
|
||||
}
|
||||
else{
|
||||
$this->model = IQTravelGroupItem::findOrFail($data['iq_travel_group_item_id']);
|
||||
$this->model->fill($data);
|
||||
$this->model->save();
|
||||
}
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function updateTravelItem($id, $data)
|
||||
{
|
||||
$data['draft_type_id'] = $data['draft_type_id'] ? $data['draft_type_id'] : null;
|
||||
$data['travel_country_id'] = $data['travel_country_id'] ? $data['travel_country_id'] : null;
|
||||
|
||||
if($id == "new"){
|
||||
$this->model = IQTravelItem::create($data);
|
||||
}
|
||||
else{
|
||||
$this->model = IQTravelItem::findOrFail($id);
|
||||
$this->model->fill($data);
|
||||
$this->model->save();
|
||||
}
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateTravelItemPlace($id, $data)
|
||||
{
|
||||
$data['pos'] = $data['pos'] ? intval($data['pos']) : 0;
|
||||
$data['i_q_travel_item_id'] = $data['iq_travel_item_id'];
|
||||
if($data['iq_travel_item_place_id'] == "new"){
|
||||
$this->model = IQTravelItemPlace::create($data);
|
||||
}
|
||||
else{
|
||||
$this->model = IQTravelItemPlace::findOrFail($data['iq_travel_item_place_id']);
|
||||
$this->model->fill($data);
|
||||
$this->model->save();
|
||||
}
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue