我目前遇到此错误的问题:
数组到字符串的转换
这是代码:
控制器:
function get_tariff()
{
$this->load->model('model_tariff');
$data['destination']=$this->input->post('dest',true);
$data['lines']=$this->input->post('lines',true);
$data['weight']=$this->input->post('weight',true);
$data['priceperkg']=$this->model_tariff->get_tariff();
$data['pricetotal']=$data['priceperkg']* $data['weight'];
$this->load->view('tariff_result',$data);
}
模型:
function get_tariff()
{
$destination=$this->input->post('dest');
$lines=$this->input->post('lines');
$weightt=$this->input->post('weight');
$this->db->select('price');
$this->db->from('view_tariff');
$this->db->where('city_name',$destination);
$this->db->where('lines',$lines);
$price=$this->db->get();
return $price->result();
}
看法:
Price per kg <?php echo $priceperkg?>;
Bayar total <?php echo $pricetotall?>;