2017-05-23 7 views
0

に呼び出す前に、この質問をもう一度お聞きしたいと思います。私は、ここで関連トピックを検索しましたが、「致命的なエラー:メンバー関数への呼び出し」を試して解決策を試しますが、このエラーはまだあります。だから、今日、私はあなたの助けを借りてこのエラーを解決するようお願いします。私は、検索キーを押すと、結果が致命的なエラー:非オブジェクトのメンバー関数result_array()を

Fatal error: Call to a member function result_array() on a non-object in

ない本当のデータであるとき

このエラーが表示されます。

これは私のプログラムです:

コントローラー:

public function gridSearchAll() { 
    $this->load->helper('form'); 
    $this->load->helper('lightutility'); 
    $this->load->model('moMasterMng'); 
    $this->load->model('moMasterConf'); 
    $this->load->model('moMasterFilling'); 
    $this->load->model('moUser'); 
    $objMUser = new moUser(); 
    $objMMasterMng = new moMasterMng(); 
    $objMMasterFill = new moMasterFilling(); 
    $objMMasterConf = new moMasterConf(); 
    $ucValue = array(); 
    $data = array(); 
    $result = ''; 
    $alertMsg = ''; 

    // get data 
    $data['StartPage'] = $this->input->post('hidStartPage'); 
    $data['DisplayRows'] = longRows(); 
    $data['Ordering'] = $this->input->post('ddlOrdering'); 
    $data['OrderingType'] = $this->input->post('ddlOrderingType');  $data['DateRetentionFrom'] = reverseDate(cleanText($this->input->post('txtDateRetentionFrom'))); 
    $data['DateRetentionTo'] = reverseDate(cleanText($this->input->post('txtDateRetentionTo'))); 
    $data['DateArchivedFrom'] = reverseDate(cleanText($this->input->post('txtDateArchivedFrom'))); 
    $data['DateArchivedTo'] = reverseDate(cleanText($this->input->post('txtDateArchivedTo'))); 

    $data['Category'] = $this->input->post('ddlCategory'); 
    $data['Keyword'] = $this->input->post('txtKeyword'); 

    //validation 
    if(!isValidDateSystem($data['DateArchivedFrom']) AND !isValidDateSystem($data['DateArchivedTo'])){ 
     $alertMsg .= 'Penulisan Tanggal Arsip Tidak Valid!\n'; 
    } 
    if(!isValidDateSystem($data['DateRetentionFrom']) AND !isValidDateSystem($data['DateRetentionTo'])){ 
     $alertMsg .= 'Penulisan Tanggal Retensi Tidak Valid!\n'; 
    } 
    if(empty($data['DateArchivedFrom']) XOR empty($data['DateArchivedTo'])){ 
     $alertMsg .= 'Tanggal Arsip Tidak Boleh Kosong Salah Satu!\n'; 
    } 
    if(empty($data['DateRetentionFrom']) XOR empty($data['DateRetentionTo'])){ 
     $alertMsg .= 'Tanggal Retensi Tidak Boleh Kosong Salah Satu!\n'; 
    } 

    $i = 0; 
    $no = $data['StartPage'] + 1; 
    $result .= '<table class="listcoll-tb" cellpadding="0" cellspacing="0"> 
      <tr class="head"> 
       <td class="cell">No.</td> 
       <td class="cell2">Tgl&nbsp;Arsip</td> 
       <td class="cell2">Ditinjau&nbsp;Kembali</td> 
       <td class="cell2">Judul/Nama</td> 
       <td class="cell2">No&nbsp;Batch</td> 
       <td class="cell2">Deskripsi</td> 
       <td class="cell2">Pemilik/Instansi</td> 
       <td class="cell2">Lokasi</td> 
       <td class="cell2">Petugas&nbsp;Input</td> 
       <td class="cell2">Petugas&nbsp;Verifikasi</td> 
      </tr>'; 
    if($alertMsg != ''){ 
     alert($alertMsg); 
    } 
    else{ 
     $dt = $objMMasterFill->populateMasterDescriptionsFilling($data); 

     foreach($dt as $value) 
     { 
      $rowOdd = 'odd2'; 
      if($i % 2 == 0){ 
       $rowOdd = 'odd1'; 
      } 
      $id = $value['ID']; 
      $instance = ''; 

      $instance = $objMMasterConf->getAncestorB($value['InstanceID'], 'instance'); 

      $attCount = $objMMasterMng->getMasterFillFileCount($id); 
      if($attCount == 0){ 
       $attCount = '-'; 
      } 
      else{ 
       $attCount .= ' file'; 
      } 

      if($value['DateArchived'] != '0000-00-00'){ 
       $value['DateArchived'] = reverseDate($value['DateArchived']); 
      } 
      else{ 
       $value['DateArchived'] = ''; 
      } 

      $userEntry = $objMUser->getUserName($value['UserIDEntry']); 
      $userVerif = $objMUser->getUserName($value['UserIDVerification']); 

      $result .= ' 
       <tr class="row '.$rowOdd.'" id="'.$id.'"> 
        <td class="cell"> 
         <div class="btn-panel2"> 
          '.$no.'. 
          <div class="inner hide"> 
           <a href="#" class="btn-detail">Detail</a> 
          </div> 
         </div> 
        </td> 
        <td class="cell2"> 
         '.$value['DateArchived'].' 
        </td> 
        <td class="cell2"> 
         '.$value['DateRetention'].' 
        </td> 
        <td class="cell2"> 
         '.$value['Title'].' 
        </td> 
        <td class="cell2"> 
         '.$value['Code'].' 
        </td> 
        <td class="cell2"> 
         '.$value['Description'].' 
        </td> 
        <td class="cell2"> 
         '.$instance.' 
        </td> 
        <td class="cell2"> 
         '.$value['ClassLoc'].' 
        </td> 
        <td class="cell2"> 
         '.$userEntry.' 
        </td> 
        <td class="cell2"> 
         '.$userVerif.' 
        </td> 
       </tr> 
       '; 
      $i ++; 
      $no ++; 
     } 
    } 
    if($i < 3 AND $i > 0){ 
     $result .= ' 
      <tr class="row"> 
       <td class="cell2" style="height:120px;"></td> 
       <td class="cell2" colspan="12"></td> 
      </tr>'; 
    } 
    elseif($i == 0){ 
     $result .= ' 
      <tr class="row"> 
       <td class="cell2" colspan="12" style="height:160px;"> 
        <div class="empty">Kosong</div> 
       </td> 
      </tr>'; 
    } 
    $result .= '</table>'; 
    $result .= $this->load->view('userControls/lib/ucTooltip', '', true); 
    return $result; 
} 

がモデル:

public function populateMasterDescriptionsFilling($data){ 
    $result; 
    $where = array(); 
    $order = array(); 
    $limit = array(); 

    if(!empty($data['DateArchivedFrom']) AND !empty($data['DateArchivedTo'])){ 
     $where['master_filling.DateArchived >='] = $data['DateArchivedFrom']; 
     $where['master_fillling.DateArchived <='] = $data['DateArchivedTo'].' 24:00:00'; 
    } 
    if(!empty($data['DateRetentionFrom']) AND !empty($data['DateRetentionTo'])){ 
     $where['master_filling.DateRetention >='] = $data['DateRetentionFrom']; 
     $where['master_filling.DateRetention <='] = $data['DateRetentionTo'].' 24:00:00'; 
    } 
    if(!empty($data['Keyword'])){ 
      $like['master_filling.'.$data['Category']] = $data['Keyword']; 
    } else{ 
      $like['master_location.Code'] = $data['Keyword']; 
    } 

    $order[$data['Ordering']] = $data['OrderingType']; 
    $limit[$data['DisplayRows']] = $data['StartPage']; 

    $result = StoredProcedure::MSPSelectMasterDescriptionsDynamicFill($where, $order, $limit); 

    return $result; 
} 

図書館:

public static function MSPSelectMasterDescriptionsDynamicFill($where, $order, $limit){ 
    self::$loadDb->db->where($where); 
    self::$loadDb->db->order_by(key($order), $order[key($order)]); 
    self::$loadDb->db->limit(key($limit), $limit[key($limit)]); 
    $dset = self::$loadDb->db->get('master_filling'); 
    return $dset->result_array(); 
} 

私はあなたの助けのために非常に感謝されます。

+0

通常、クエリに問題がある場合、コードシニタで発生します。実際のクエリのログを記録しようとしましたか? –

+0

@aljo fしたことがあります – Dee

答えて

0

エラーメッセージが$dsetがここ

$dset = self::$loadDb->db->get('master_filling'); 

あなたはそれだと思う対象ではないことを語っています。その文の直後に

error_log('$dset = '.print_r($dset,TRUE)); 

を追加してから、エラーログを調べてください。

+0

まずは試してみます。 – Dee