query($sql); if($result){ $list=$result->fetchAll(PDO::FETCH_ASSOC); $code = 0; $info = 'success'; $massge = '成功'; foreach($list as $k => $v){ foreach($v as $kk => $vv){ if(array_key_exists($kk,$coutomer)){ $list[$k][$kk] = $coutomer[$kk][$vv]; } } if($v['STUTA'] == 1){ $list[$k]['STUTAS'] = "未处理"; } else{ $list[$k]['STUTAS'] = "已处理"; } } $sql = "select count(*) as totalNum from base_apply as a,base_customer as b where a.CUST_ID = b.CUST_id".$str; $result=$pdo->query($sql); $totalNum = $result->fetchAll(PDO::FETCH_ASSOC); $totalNum = $totalNum[0]['totalNum']; }else{ $code = -1; $info = 'fail'; $massge = '失败'; $totalNum = 0; $list = ''; } $json['code'] = $code; $json['info'] = $info; $json['massge'] = $massge; $json['totalNum'] = $totalNum; $json['list'] = $list; //print_r($json); echo json_encode($json); ?>