function actionAccountResourceReport($account_id) { $model = ProjectMember::model()->getProjectByMember($account_id); $this->render('account_resource_report', array('model' => $model, 'account_id' => $account_id)); }
/** * Tổng số task, thời gian bé nhất, thời gian lớn nhất cua tat ca dự án được gán cho nhân viên * @param type $project_id * @param type $accout_id * @param type $status */ public function generalAccountProject($account_id) { $project_member = ProjectMember::model()->getProjectByMember($account_id); $total_task = 0; $start_arr = array(); $end_arr = array(); $i = 0; foreach ($project_member->data as $project_member_item) { $project_id = $project_member_item->project_id; $account_id = $project_member_item->account_id; if ($this->getStartTaskProject($project_id, $account_id) != "Null") { $start_arr[$i] = $this->getStartTaskProject($project_id, $account_id); } if ($this->getEndTaskProject($project_id, $account_id) != "Null") { $end_arr[$i] = $this->getEndTaskProject($project_id, $account_id); } $total_task += $this->calculateTaskOneProject($project_id, $account_id); $i++; } $generalAP = array(); $generalAP['total_task'] = $total_task; if (count($start_arr) > 0) { $generalAP['start'] = min($start_arr); } else { $generalAP['start'] = 'Null'; } if (count($end_arr) > 0) { $generalAP['end'] = max($end_arr); } else { $generalAP['end'] = 'Null'; } return $generalAP; }