diversen
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Page extends Eloquent {
|
||||
|
||||
protected $table = "offers";
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo( 'Project' );
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,10 @@ class Page extends Eloquent {
|
||||
->with( [
|
||||
'subpages' => function ( $q ) use ( $user ) {
|
||||
$q->whereRaw(
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" );
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" )
|
||||
->orderBy( 'pageorder' );
|
||||
}] )
|
||||
->orderBy( 'pageorder' )
|
||||
->get();
|
||||
|
||||
return $pages;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Project extends Eloquent {
|
||||
|
||||
protected $table = "projects";
|
||||
|
||||
public function offers()
|
||||
{
|
||||
return $this->hasMany( 'Offer' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 15/12/2017
|
||||
* Time: 19:37
|
||||
*/
|
||||
|
||||
class Offer_model extends MY_Model {
|
||||
|
||||
protected $tablename = "offers";
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user