summaryrefslogtreecommitdiff
path: root/protected/models/Veranstaltung.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/models/Veranstaltung.php')
-rw-r--r--protected/models/Veranstaltung.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php
index 843d430..f8d3e01 100644
--- a/protected/models/Veranstaltung.php
+++ b/protected/models/Veranstaltung.php
@@ -106,7 +106,7 @@ class Veranstaltung extends CActiveRecord
$criteria->compare('endzeit',$this->endzeit,true);
$criteria->compare('beschreibung',$this->beschreibung,true);
$criteria->compare('standort_id',$this->standort_id);
- $criteria->compare('published',true);
+ $criteria->compare('published',$this->published);
return new CActiveDataProvider($this, array(
@@ -148,6 +148,14 @@ class Veranstaltung extends CActiveRecord
// 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
+ public function parentStage($stageid=56)
+ {
+ $this->getDbCriteria()->mergeWith(array(
+ 'condition'=>"standort_id = $stageid",
+ ));
+ return $this;
+ }
+
public function scopes()
{
return array(
@@ -158,9 +166,18 @@ class Veranstaltung extends CActiveRecord
'order'=>'startzeit ASC',
),
'thisYear'=>array(
- 'condition'=>"startzeit > STR_TO_DATE('".Yii::app()->params['start_date']."',GET_FORMAT(DATE,'EUR'))",
+ 'condition'=>"startzeit >= STR_TO_DATE('".Yii::app()->params['start_date']."',GET_FORMAT(DATE,'EUR'))",
),
+ 'freitag'=>array(
+ 'condition'=>"dayofweek(startzeit)=6",
+ ),
+ 'samstag'=>array(
+ 'condition'=>"dayofweek(startzeit)=7",
+ ),
+ 'sonntag'=>array(
+ 'condition'=>"dayofweek(startzeit)=1",
+ ),
);
}
} \ No newline at end of file