CataractComplicationsReport::getTotalOperations PHP Method

getTotalOperations() public method

public getTotalOperations ( )
    public function getTotalOperations()
    {
        $this->command->reset();
        $this->command->select('COUNT(*) as total')->from('et_ophtroperationnote_cataract')->join('event', 'et_ophtroperationnote_cataract.event_id = event.id')->join('et_ophtroperationnote_surgeon', 'et_ophtroperationnote_surgeon.event_id = event.id')->where('surgeon_id = :surgeon', array('surgeon' => $this->surgeon))->andWhere('event.deleted=0');
        if ($this->from) {
            $this->command->andWhere('event.event_date >= :dateFrom', array('dateFrom' => $this->from));
        }
        if ($this->to) {
            $this->command->andWhere('event.event_date <= :dateTo', array('dateTo' => $this->to));
        }
        $totalData = $this->command->queryAll();
        return $totalData[0]['total'];
    }

Usage Example

Exemplo n.º 1
0
 public function actionCataractComplicationTotal()
 {
     $reportObj = new CataractComplicationsReport(Yii::app());
     $this->renderJSON(array($reportObj->getTotalComplications(), $reportObj->getTotalOperations()));
 }