Пример #1
0
 public function get_group_selected_by_id($id)
 {
     $dao = Model_ReportGroupSelected::data_access();
     try {
         $groups = $dao->filter(Model_ReportGroupSelected::ID, $id)->find_one();
     } catch (Exception $e) {
     }
     if ($groups) {
         return $groups;
     } else {
         return null;
     }
 }
Пример #2
0
 public function group_delete($group_id)
 {
     $dao = Model_UserGroupCustom::data_access();
     $dao_selected = Model_ReportGroupSelected::data_access();
     try {
         $groupInfo = $dao->filter(Model_UserGroupCustom::ID, $group_id)->find_one();
     } catch (Exception $e) {
     }
     $groups_arr = $dao_selected->filter_by_op(Model_ReportGroupSelected::GroupIDS, 'like', "%" . $group_id . "%")->find();
     if ($groupInfo) {
         $groupInfo->status = 1;
         $groupInfo->save();
         if ($groups_arr) {
             foreach ($groups_arr as $groups) {
                 $data_id = $this->update_group_selected_by_groups_id($group_id, $groups->id);
             }
         }
         return true;
     } else {
         return false;
     }
 }