commit
724a287a5e
@ -3,6 +3,7 @@
|
|||||||
namespace backend\widgets;
|
namespace backend\widgets;
|
||||||
|
|
||||||
|
|
||||||
|
use common\classes\Debug;
|
||||||
use yii\base\Widget;
|
use yii\base\Widget;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
|
|
||||||
@ -17,14 +18,25 @@ class Calendar extends Widget
|
|||||||
|
|
||||||
public $monthUpdate;
|
public $monthUpdate;
|
||||||
|
|
||||||
public $colorClasses = ['accept' => 'access', 'default' => 'danger', 'offDay' => ''];
|
public $colorClasses;// = ['accept' => 'access', 'default' => 'danger', 'offDay' => ''];
|
||||||
|
|
||||||
public $offDaysShow = 1;
|
public $offDaysShow = 0;
|
||||||
|
|
||||||
public $script = 'CalendarHelper.main()';
|
public $script = 'CalendarHelper.main()';
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->monthUpdate['url'])){
|
||||||
|
Debug::dd('Не существует $monthUpdate["url"]');
|
||||||
|
}
|
||||||
|
if (!isset($this->dayUpdate['url'])){
|
||||||
|
Debug::dd('Не существует $dayUpdate["url"]');
|
||||||
|
}
|
||||||
|
if (!isset($this->colorClasses)){
|
||||||
|
Debug::dd('Не существует $colorClasses;<br> ["accept" => "access", "default" => "danger", "offDay" => ""]');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
$view = $this->getView();
|
$view = $this->getView();
|
||||||
AppAsset::register($view);
|
AppAsset::register($view);
|
||||||
|
@ -39,13 +39,12 @@ class ReportSearchForm extends Model
|
|||||||
{
|
{
|
||||||
$queryBuilder = Reports::find()
|
$queryBuilder = Reports::find()
|
||||||
->with('task')
|
->with('task')
|
||||||
->andWhere(['between', 'reports.created_at', $this->fromDate, $this->toDate, $this->user_id])
|
->andWhere(['between', 'reports.created_at', $this->fromDate, $this->toDate])
|
||||||
->limit($this->limit)
|
->limit($this->limit)
|
||||||
->offset($this->offset);
|
->offset($this->offset);
|
||||||
|
|
||||||
if(isset($this->user_id)) {
|
if(isset($this->user_id)) {
|
||||||
$userCardId = UserCard::findByUserId($this->user_id)->id;
|
$queryBuilder->andWhere(['user_card_id' => $this->user_id]);
|
||||||
$queryBuilder->andWhere(['user_card_id' => $userCardId]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $queryBuilder->asArray()->all();
|
$data = $queryBuilder->asArray()->all();
|
||||||
|
Loading…
Reference in New Issue
Block a user