コード例 #1
0
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete()
 {
     $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '';
     $arrJson = array();
     WCourseLecture::updateTestPreTest($id);
     WQuestion::deleteQues($id);
     if ($this->loadModel($id)->delete()) {
         $arrJson = array('status' => true, 'msg' => 'Success');
     } else {
         $arrJson = array('status' => false, 'msg' => 'UnSuccess');
     }
     echo CJSON::encode($arrJson);
     exit;
 }