3) { // 用户已经申请过了,返回状态码1和提示信息 $response = array('status' => 1, 'msg' => '您申请的卡数已超限!请联系客服!'); echo json_encode($response); } else { $data_insert = mysqli_query($con, "insert into oder(goods,name,uid,phone,sf,city,xian,dizhi,oderid,time,proxy_id,proxy_price,proxy_prices,price) values('$goods','$name','$uid','$phone','$sf','$city','$xian','$dizhi','$oderid','$time','$proxy_id','$proxy_price','$proxy_prices','$price')"); // echo $data_insert; // echo "SQL: " . $data_insert . "
"; if ($data_insert) { // 申请成功,返回状态码0和提示信息 $response = array('status' => 0, 'msg' => '申请成功'); echo json_encode($response); // 判断$status是否为0,如果是则执行$sendSms()函数 if ($response['status'] == 0) { // 写入佣金记录表 $data_revenue = mysqli_query($con, "insert into revenue(account,oderid,name,price,beizhu,cr_time,proxy_upid,proxy_prices) values('$proxy_acc','$oderid','$name','$proxy_prices','$beizhu','$time','$proxy_upid','$proxy_price')"); //发送短信通知 sendSms($appId, $appKey, $phoneNumber, $templateId, $smsSign); } } else { // 信息不全,返回状态码-1和提示信息 $response = array('status' => -1, 'msg' => '信息不全,请输入全部信息'); echo json_encode($response); } } }