Рефакторинг, дебаг календаря, добавление кнопки назад, отображение выбранного дня
This commit is contained in:
@ -2,10 +2,6 @@
|
||||
|
||||
namespace backend\modules\reports\models;
|
||||
|
||||
use common\classes\Debug;
|
||||
use yii\base\Model;
|
||||
use function GuzzleHttp\Psr7\str;
|
||||
|
||||
class Month
|
||||
{
|
||||
|
||||
@ -18,10 +14,9 @@ class Month
|
||||
{
|
||||
$this->inactive_begin = [];
|
||||
$this->inactive_end = [];
|
||||
if (!$date and !self::is_date($date)) {
|
||||
if ( !($date and self::is_date($date)) ){
|
||||
$date = date('Y-m-d');
|
||||
}
|
||||
|
||||
$first_day_of_week = self::get_day_week(self::get_first_day($date));
|
||||
$quantity_days = self::get_days_month($date);
|
||||
|
||||
|
@ -59,7 +59,9 @@ class ReportsSearch extends Reports
|
||||
|
||||
$this->load($params);
|
||||
|
||||
|
||||
if (isset($params['user_id'])) {
|
||||
$this->user_card_id = $params['user_id'];
|
||||
}
|
||||
if (isset($params['year'])) {
|
||||
$query->andFilterWhere(['=', 'YEAR(reports.created_at)', $params['year']]);
|
||||
}
|
||||
@ -79,7 +81,7 @@ class ReportsSearch extends Reports
|
||||
|
||||
|
||||
$query->andFilterWhere([
|
||||
'user_card.id' => $this->id,
|
||||
'reports.id' => $this->id,
|
||||
'reports.created_at' => $this->created_at,
|
||||
'user_card_id' => $this->user_card_id,
|
||||
]);
|
||||
|
Reference in New Issue
Block a user