FEATURE #1450: add widget overview
This commit is contained in:
@@ -3,22 +3,28 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Class WidgetArea
|
||||
*/
|
||||
class WidgetArea extends Model
|
||||
{
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'code',
|
||||
'description'
|
||||
];
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function getWidgets($uniqueCode)
|
||||
{
|
||||
return DB::table('widget_areas')
|
||||
->select('widget_areas.*', 'widgets.widget_type_handler', 'widgets.name as widget_name', 'widgets.settings')
|
||||
->where('code', $uniqueCode)
|
||||
->join('widget_in_widget_area', 'widget_in_widget_area.widget_area_id', '=', 'widget_areas.id')
|
||||
->join('widgets', 'widget_in_widget_area.widget_id', '=', 'widgets.id')
|
||||
->orderBy('widget_in_widget_area.position');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user