|
- <?php
- /*
- * wechat 2.0
- * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
- * Date: 2016.7.12
- * Something is to pay QQ1062140302
- */
- //require_once '../../Common/Mysql.php';
-
-
- if (ALLOW_ORIGIN)
- header("Access-Control-Allow-Origin:*");
- date_default_timezone_set('PRC');
- $userid =$_COOKIE['user_id'];
- $openid = $_COOKIE['open_id'];
- $sql = "select id,name,id_type,id_num from wechat_customer where cancel_flag =0 and wechat_user_id ='".$userid."'";
- writeLog($sql);
- $rs = $pdo->query($sql);
- $rowset = $rs->fetchAll(PDO::FETCH_ASSOC);
- foreach ($rowset as $v) {
- $list[] = array('id'=>$v['id'],'name'=>$v['name'],'id_type'=>$v['id_type'],'id_num'=>$v['id_num']);
- }
- if($rowset){
- echo json_encode(array('code'=>'0','info'=>'0','list'=>$list));
- }else{
- echo json_encode(array('code'=>'0','info'=>$rs,'list'=>array()));
- }
|