0
我是新來這...幫助我請無法訪問空白屬性的原因?
$數據對象
stdClass Object ([menu_id] => 38 [menu_code] => M062 [menu_name] => BAP (RICE) [price] => Rp 6.364 [total] => 1
和$域是數組,這還不是全部..
Array ([0] => Array ([code] => menu_id [title] => ID [width] => 5) [1] => Array ([code] => menu_code [title] => Kode [width] => 8) [2] =>
這是我的功能:
function writeRowAsli($row, $startChar, $fields, $data){
$i=$startChar; $j=''; $k='';
foreach($fields as $field){
$k = $j.$i;
$this->excel->getActiveSheet()->setCellValue($k.$row, $data->$field['code']);
$last = $k;
if($i == 'Z'){
$i='A';
$j.=$i;
} else $i++;
}
$this->excel->getActiveSheet()->setCellValue($j.$i.$row, '=SUM(C'.$row.':'.$k.$row.')');
}
我知道壞行是$ this-> excel-> getActiveSheet() - > setCellV alue($ k。$ row,$ data - > $ field ['code']); 感謝所有