| | |
| | | require '../framework/bootstrap.inc.php'; |
| | | require '../web/common/interface.func.php'; |
| | | |
| | | |
| | | if($_SERVER['REQUEST_METHOD'] != 'POST'){ |
| | | http_response_code(405); |
| | | } else { |
| | | $retData=checkParam($_POST); |
| | | switch ($retData["regMsg"]){ |
| | | case "e00000": |
| | | $userApi = new UserApi(); |
| | | switch (getUrl($_SERVER['REQUEST_URI'])) |
| | | { |
| | | case "getUserList": |
| | | exit($userApi->getUserList($retData["regData"])); |
| | | break; |
| | | default: http_response_code(404); |
| | | } |
| | | case "e00001": |
| | | exit(array( |
| | | "rspCode"=>"e00001", |
| | | "rspMsg"=>"接入平台不存在" |
| | | )); |
| | | case "e00002": |
| | | exit(array( |
| | | "rspCode"=>"e00002", |
| | | "rspMsg"=>"鉴权失败" |
| | | )); |
| | | init(function($retData) { |
| | | $userApi = new UserApi(); |
| | | switch (getUrl($_SERVER['REQUEST_URI'])) |
| | | { |
| | | case "getUserList": |
| | | return $userApi->getUserList($retData["repData"]); |
| | | case "getUserOrderList": |
| | | return $userApi->getUserOrderList($retData["repData"]); |
| | | default: http_response_code(404); |
| | | } |
| | | } |
| | | return array(); |
| | | }); |
| | | |
| | | |
| | | |
| | | class UserApi |
| | |
| | | |
| | | public function getUserList($param) |
| | | { |
| | | $sql = "SELECT * from ims_users where invitation_code=:invitationCode"; |
| | | |
| | | return json_encode(pdo_fetchall("SELECT * from ims_users where invitation_code=:invitationCode",array(":invitationCode"=>"ICA001")),JSON_UNESCAPED_UNICODE); |
| | | $sqlParam = array(':invitationCode' => $param["invitationCode"]); |
| | | $sql = "SELECT u.uid,u.username,u.status,u.starttime,u.joindate,u.endtime,p.qq,p.mobile from ims_users u left join ims_users_profile p on u.uid = p.uid where invitation_code=:invitationCode"; |
| | | if ($param['user_name'] != null && $param['user_name'] != ''){ |
| | | $sql = $sql." and u.username like '%".$param["user_name"]."%' "; |
| | | } |
| | | |
| | | if ($param['phone_number'] != null && $param['phone_number'] != ''){ |
| | | $sql = $sql." and p.mobile like '%".$param['phone_number']."%' "; |
| | | $sqlParam[":phone_number"] = $param["phone_number"]; |
| | | } |
| | | |
| | | if ($param['status'] != null && $param['status'] != ''){ |
| | | $sql = $sql.' and u.status=:status'; |
| | | $sqlParam[":status"] = $param["status"]; |
| | | } |
| | | |
| | | if ($param['min_date'] != null && $param['min_date'] != ''){ |
| | | $sql = $sql.' and u.joindate<:min_date'; |
| | | $sqlParam[":min_date"] = $param["min_date"]; |
| | | } |
| | | |
| | | if ($param['max_date'] != null && $param['max_date'] != ''){ |
| | | $sql = $sql.' and u.joindate>:max_date'; |
| | | $sqlParam[":max_date"] = $param["max_date"]; |
| | | } |
| | | return pdo_fetchall($sql,$sqlParam); |
| | | } |
| | | } |