0
請幫助...這似乎錯誤是在致命錯誤:在線路不能使用類型爲stdClass的對象作爲數組33
$agentList = array();
我只是想回響在我看來
列表請幫助...請幫助...請幫助...
$this->load->model('home_model');
$agent= $this->home_model->getAgent($data['userID']);
$agentList = array();
$listAgent = '';
if($agent !== FALSE)
{
foreach ($agent->result() as $row)
{
array_push($agentList, $row['AgentCode']);
$listAgent .= "<option value='".$row->AgentCode."'>".$row->Name."</option>";
}
}
$listSchool = $this->home_model->getAllSchool($agentList);
$listTD = '';
if($listSchool !== FALSE)
{
foreach ($listSchool->result() as $row)
{
$address = $row->Address." ".$row->Address2;
$listTD .= "<tr>
<td class='schoolCode' data-comp='".$row->CompanyName."' data-kpID='".$row->KeyPersonID."'>".$row->No_."</td>
<td>".$row->Name."</td>
<td>".$address."</td>
<td class='schoolCode2'>".$row->SecondaryCode."</td>
<td>".$row->SegmentName."</td>
</tr>";
}
}
$data['returnData'] = array("listAgent" => $listAgent, "listTD" => $listTD);
$this->load->view('home',$data);
嘗試'result_array()',而不是'結果()' – user4419336