function getList(array $args = array()) { !isset($args['type']) && ($args['type'] = 'society'); return parent::getList($args); }
function _save($id) { $team = new Team_model($id); $config['upload_path'] = $this->config->item('base_dir') . 'uploads/images/Team/'; $config['allowed_types'] = 'gif|jpg|png'; // $config['max_size'] = '100'; // $config['max_width'] = '1024'; // $config['max_height'] = '768'; $this->load->library('upload', $config); if (!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); // $this->load->view('upload_form', $error); //echo "ERROR" . print_r($error, 1); } else { $uploaded = $this->upload->data(); $_POST['photo'] = $uploaded['orig_name']; } if ($id) { $team->save($_POST); } else { $id = $team->create($_POST); } return $id; }
/** * 返回人员所在的组列表 */ function teamList() { $team = new Team_model(); $list = $this->table->setFields($this->team_list_args)->setRowAttributes(array('hash' => '{type}/{id}'))->setData($team->getList(array('has_relative_like' => $this->people->id, 'get_leader' => true, 'limit' => 10)))->generate(); return $list; }
function __construct() { parent::__construct(); }