Example #1
0
 public function delete($id)
 {
     if (!$this->check_power('subject_category_delete')) {
         return;
     }
     $id = intval($id);
     $id && ($row = SubjectCategoryModel::get_method_tactic($id));
     if (empty($row)) {
         message('方法策略不存在');
         return;
     }
     if ($this->_has_relate_info($id)) {
         message('该方法策略有关联的其他信息,无法删除');
     }
     $query1 = $this->db->get_where('subject_category', array('id' => $row['subject_category_id']), 1);
     $row1 = $query1->row_array();
     $subject_category_id = $row1['id'];
     $this->db->delete('method_tactic', array('id' => $id));
     message('方法策略删除成功', 'admin/method_tactic/index/' . $subject_category_id);
 }