Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function relations()
- {
- // NOTE: you may need to adjust the relation name and the related
- // class name for the relations automatically generated below.
- return array('calls' => array(self::HAS_MANY, 'Call', 'submitter'),
- 'callResponses' => array(self::HAS_MANY, 'CallResponse', 'emp_id'),
- 'jobs' => array(self::HAS_MANY, 'Job', 'emp_id'),
- 'logs' => array(self::HAS_MANY, 'Log', 'emp_id_affected'),
- 'times' => array(self::HAS_MANY, 'Time', 'emp_id'),
- 'position0' => array(self::BELONGS_TO, 'Position', 'position'),
- 'memberTeams' => array(self::HAS_MANY, 'MemberTeam', 'member'),
- 'trainingos' => array(self::HAS_MANY, 'MemberTrainingo', 'emp_id',
- 'join'=>'INNER JOIN `trainingo` as `to` '.
- 'ON `t`.`training_id`=`to`.`training_id`',
- 'select'=>'`to`.`name`'),
- 'memberTrainingos' => array(self::HAS_MANY, 'MemberTrainingo', 'emp_id',
- 'join'=>'INNER JOIN `trainingo` as `to` '.
- 'ON `memberTrainingos`.`training_id`=`to`.`training_id`'),
- 'memberTrainingoCount' => array(self::STAT, 'MemberTrainingo', 'emp_id',
- 'condition' => '`expire`>' . time()),
- 'memberTrainingoRCount' => array(self::STAT, 'MemberTrainingo', 'emp_id',
- 'condition' => '`raise`=1 AND `expire`>' . time()),
- 'totalHours' => array(self::STAT, 'Time', 'emp_id',
- 'select' => 'sum(`hours`)'),
- 'totalPay' => array(self::STAT, 'Time', 'emp_id',
- 'select' => 'sum(`pay`)'),
- 'jobCount' => array(self::STAT, 'Job', 'emp_id',
- 'condition' => '`valid_start`<'.time().' AND `valid_end`>'.time()),
- 'events' => array(self::HAS_MANY, 'Event', 'supervisor'),
- 'notes' => array(self::MANY_MANY, 'Notes',
- 'notes_completers(emp_id, NotesID)'),
- 'notesTemplates' => array(self::MANY_MANY, 'NotesTemplate',
- 'notes_template_email(emp_id, nTempID)'),
- 'allRating' => array(self::STAT, 'Time', 'emp_id',
- 'select' => "AVG(`rating`)"),
- 'all6mRating' => array(self::STAT, 'Time', 'emp_id',
- 'select' => "AVG(`rating`)",
- 'condition' => '`out` >= '.($_SERVER['REQUEST_TIME']-15768000)),
- 'crewRating' => array(self::STAT, 'Time', 'emp_id',
- 'select' => "AVG(`rating`)",
- 'condition' => '`t`.`crew`='.Member::$crewStat),
- 'crew6mRating' => array(
- self::STAT, 'Time', 'emp_id',
- 'select' => "AVG(`rating`)",
- 'condition' => '`t`.`crew`='.Member::$crewStat.' AND `out` >= '.
- ($_SERVER['REQUEST_TIME']-15768000)
- ),
- );
Add Comment
Please, Sign In to add comment