public function run($id) { $duty_info = Duty::model()->findByPk($id); if ($duty_info->delete()) { $this->controller->success(''); } }
public static function getList($nurser_id) { $model = Duty::model(); //$tableName = $model->tableName(); $condition = "a.nurser_id = b.id And a.nurser_id={$nurser_id}"; $command = $model->getDbConnection()->CreateCommand(); return $command->select('b.name,a.*')->from('t_duty a,t_nurser_user b')->where($condition)->order('a.day_time ASC')->queryAll(); }