Ignore:
Timestamp:
2012-12-06T16:34:50-08:00 (6 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
42f7955
Parents:
7fc2072
git-author:
Compass <pan.luo@…> (12/06/2012 04:28:07 PM)
git-committer:
Compass <pan.luo@…> (12/06/2012 04:34:50 PM)
Message:

moved EvaluationSubmission? find function into model and fixed the
event_id issue. refacted evaluation submission model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/models/evaluation_submission.php

    r7fc2072 r57ef617  
    3636    {
    3737        return $this->find('all', array(
    38             'conditions' => array($this->alias.'.event_id' => $eventId),
     38            'conditions' => array(
     39                $this->alias.'.event_id' => $eventId,
     40                $this->alias.'.submitted' => '1',
     41            ),
    3942            'contain' => false,
    4043        ));
     
    5356    {
    5457        return $this->find('first', array(
    55             'conditions' => array($this->alias.'.grp_event_id' => $grpEventId, $this->alias.'.submitter_id' => $submitter)
     58            'conditions' => array(
     59                $this->alias.'.grp_event_id' => $grpEventId,
     60                $this->alias.'.submitter_id' => $submitter,
     61                $this->alias.'.submitted' => '1',
     62            ),
    5663        ));
    5764    }
     
    6976    {
    7077        return $this->find('first', array(
    71             'conditions' => array($this->alias.'.event_id' => $eventId, 'submitter_id' => $submitter),
     78            'conditions' => array(
     79                $this->alias.'.event_id' => $eventId,
     80                $this->alias.'.submitter_id' => $submitter,
     81                $this->alias.'.submitted' => 1,
     82            ),
    7283            'contain' => false,
    7384        ));
     
    8899            array(
    89100                'conditions' => array(
    90                     'EvaluationSubmission.submitted' => 1,
    91                     'EvaluationSubmission.grp_event_id' => $groupEventId
     101                    $this->alias.'.submitted' => 1,
     102                    $this->alias.'.grp_event_id' => $groupEventId
    92103                ),
    93104            )
Note: See TracChangeset for help on using the changeset viewer.