$value ) { $this->$key = $value; } $itid = $this->insert (); } return $itid; } function getInvoiceTrainingByTodo($select = ""){ Doo::loadModel ( 'staff' ); $staff = new staff (); Doo::loadModel ( 'L_category' ); $lCategory = new L_category (); $condition = array ( 'where' => "status= 0 or status=1 ", 'limit'=>8, 'asArray' => TRUE ); if (! empty ( $select )) $condition += array ( 'select' => $select ); $list=$this->find ( $condition ); foreach ($list as $key=>$value){ $detail=$staff->getStaffBySid($value['creator']); $list[$key]['staff']=$detail; $detail=$lCategory->getCategoryById($value['cid']); $list[$key]['category']=$detail; } return $list; } /** * 根据状态获取培训班 * @param number $status */ function getInvoiceTrainingByStatus($status = 0, $select = "") { Doo::loadModel ( 'staff' ); $staff = new staff (); Doo::loadModel ( 'L_category' ); $lCategory = new L_category (); $condition = array ( 'where' => "status= '" . $status . "' ", 'limit'=>8, 'asArray' => TRUE ); if (! empty ( $select )) $condition += array ( 'select' => $select ); $list=$this->find ( $condition ); foreach ($list as $key=>$value){ $detail=$staff->getStaffBySid($value['creator']); $list[$key]['staff']=$detail; $detail=$lCategory->getCategoryById($value['cid']); $list[$key]['category']=$detail; } return $list; } } ?>