$sql="select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id'];
$sql="select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]supplier_bank_info where mid = ".$s['id'];
$ret['data']=$this->db->getall($sql);
}
}
$this->returnjson($ret);
}
//模拟客户接口
publicfunctiongetcustomerAjax(){
$name=$this->post('cname');
$data=m('option')->getone('`name` like "'.$name.'%"','id,name');
$this->returnjson($data);
}
//格式化子表数据
publicfunctionsavesubbefore($data,$tables)
{
if($tables=='c_rhythm'){
if(count($data)>=1){
foreach($dataas$key=>$arr){
if($arr['amount']!=''){
$data[$key]['cycle_numb']=$key+1;
}
}
}
}
return$data;
}
publicfunctiongettypesAjax(){
$pid=$this->post('pid');
if($pid==0)
$data=m('option')->getall(' pid in (676,955)','num as value,name');
else
$data=m('option')->getall(' pid = "'.$pid.'"','num as value,name');