ORIENT/plugins/tps/reklama/models/Statistika.php

48 lines
978 B
PHP
Raw Normal View History

2021-04-08 08:08:59 +00:00
<?php namespace Tps\Reklama\Models;
use Model;
/**
* Model
*/
class Statistika extends Model
{
use \October\Rain\Database\Traits\Validation;
2021-04-13 09:07:38 +00:00
2021-04-08 08:08:59 +00:00
/*
* Disable timestamps by default.
* Remove this line if timestamps are defined in the database table.
*/
public $timestamps = false;
2023-02-27 04:39:19 +00:00
protected $fillable = ['item_id','date'];
2021-04-08 08:08:59 +00:00
/**
* @var string The database table used by the model.
*/
public $table = 'tps_reklama_statistika';
/**
* @var array Validation rules
*/
public $rules = [
];
2021-04-13 09:07:38 +00:00
public $belongsTo = [
'reklama' => ['Tps\Reklama\Models\Reklama',
'table' => 'tps_reklama_item',
'order' => 'name'
],
];
2021-04-15 09:23:36 +00:00
public function filterCategory()
{
$result = [];
foreach (Reklama::where('active', 1)->orderBy('title', 'asc')->get()->all() as $item) {
$result[$item->id] = $item->title;
}
return $result;
}
2021-04-08 08:08:59 +00:00
}