diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2014-06-20 14:57:39 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2014-06-20 14:57:39 +0200 |
| commit | 789b6c74e6d9766b64128d20ccecc3a5a6e5e881 (patch) | |
| tree | 629692dde8993bf73e277cfcbadaff1ffe428851 | |
| parent | b53f83a45b9ce727a45b374a01fa9022307a2e9f (diff) | |
Sortierung Vereine und Tageszuordnung optimiert (Freitag geht bis 2 Uhr nachts etc)
| -rw-r--r-- | protected/models/Veranstaltung.php | 6 | ||||
| -rw-r--r-- | protected/models/Verein.php | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index f8d3e01..5d90e6d 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -160,7 +160,7 @@ class Veranstaltung extends CActiveRecord { return array( 'published'=>array( - 'condition'=>'published=1', + 'condition'=>'`t`.`published`=1', ), 'sorted'=>array( 'order'=>'startzeit ASC', @@ -170,10 +170,10 @@ class Veranstaltung extends CActiveRecord ), 'freitag'=>array( - 'condition'=>"dayofweek(startzeit)=6", + 'condition'=>"(dayofweek(startzeit)=6 or (dayofweek(startzeit)=7 and hour(startzeit) <= 2))", ), 'samstag'=>array( - 'condition'=>"dayofweek(startzeit)=7", + 'condition'=>"((dayofweek(startzeit)=7 and hour(startzeit) > 2) or (dayofweek(startzeit)=1 and hour(startzeit) <= 2))", ), 'sonntag'=>array( 'condition'=>"dayofweek(startzeit)=1", diff --git a/protected/models/Verein.php b/protected/models/Verein.php index e3984db..ee165b7 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -123,7 +123,7 @@ class Verein extends CActiveRecord //$criteria->compare('startzeit','< '.$nowPlus); //$criteria->compare("endzeit"," <= ".$now,'AND'); $criteria->condition = 'published = 1 '; - $criteria->order = "isnull(bild), isnull(hintergrund) asc, name ASC"; + $criteria->order = "isnull(bild) asc, isnull(hintergrund) asc, name ASC"; return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); |
