//jsonp回調
$callback = isset($_GET['callback']) ? trim($_GET['callback']) : ''; //jsonp回調參數,必需 $cgc_kanjia_zhuli_rec = new cgc_kanjia_zhuli_rec(); $recmember = pdo_fetchall("SELECT * FROM " . tablename('cgc_kanjia_zhuli_member') . " WHERE mobile='" . $_GPC['mobile'] . "'"); foreach ($recmember as $k => $v) { $con = " a.uniacid = $uniacid and a.openid = '{$v['openid']}' order by a.id desc"; $sql = "SELECT ... WHERE $con"; $rec_list[] = pdo_fetchall($sql); } $result = array(); foreach ($rec_list as $k => $v) { $result = array_merge($result,$v); } $tmp= json_encode($result); //json 數據 echo $callback . '(' . $tmp .')'; //返回格式,必需