getUserList($retData["regData"])); break; case "getUserOrderList": exit($userApi->getUserOrderList($retData["regData"])); break; default: http_response_code(404); } case "e00001": exit(array( "rspCode"=>"e00001", "rspMsg"=>"接入平台不存在" )); case "e00002": exit(array( "rspCode"=>"e00002", "rspMsg"=>"鉴权失败" )); } } class UserApi { static $db; function _initialize() { $db = $this-> pdo(); } function pdo() { static $db; global $_W; if(empty($db)) { if($_W['config']['db']['slave_status'] == true && !empty($_W['config']['db']['slave'])) { load()->classs('slave.db'); $db = new SlaveDb('master'); } else { load()->classs('db'); if(empty($_W['config']['db']['master'])) { $_W['config']['db']['master'] = $GLOBALS['_W']['config']['db']; $db = new DB($_W['config']['db']); } else { $db = new DB('master'); } } } return $db; } public function getUserList($param) { return json_encode($param,JSON_UNESCAPED_UNICODE); } public function getUserOrderList($param) { return json_encode($param,JSON_UNESCAPED_UNICODE); } }