Ejemplo n.º 1
0
function recordFail($xml)
{
    $sql = "INSERT INTO tbl_rp_fail(return_code, return_msg, result_code,err_code,err_code_des,mch_billno,mch_id,wxappid,re_openid,total_amount)VALUES(\r\n'{$xml->return_code}','{$xml->return_msg}','{$xml->result_code}','{$xml->err_code}','{$xml->err_code_des}','{$xml->mch_billno}','{$xml->mch_id}','{$xml->wxappid}','{$xml->re_openid}',{$xml->total_amount}\r\n);";
    $sh = new SqlHelper();
    $sh->connDataBase(DB_WX_URL, DB_WX_USER, DB_WX_PWD, DB_WX_NAME);
    return $sh->modify($sql);
}
Ejemplo n.º 2
0
 private function record2DB($openid, $key)
 {
     $sql = "UPDATE tbl_rbkey SET openid='{$openid}',used_date=NOW()  WHERE rb_key ='{$key}' AND openid IS NULL;";
     $st = new SqlHelper();
     $st->connDataBase(DB_URL, DB_USER, DB_PWD, DB_RBKEY);
     $result = $st->modify($sql);
     $st->close();
     return $result;
 }
Ejemplo n.º 3
0
/**
 * 生成商户订单号
 * @param $openid
 */
function getOrderId($mchBillno)
{
    $temp = $mchBillno . date("Ymd");
    $sql = "SELECT COUNT(*) AS count FROM tbl_rp_success";
    $st = new SqlHelper();
    $st->connDataBase(DB_WX_URL, DB_WX_USER, DB_WX_PWD, DB_WX_NAME);
    $result = $st->query($sql);
    $id = $result[0]['count'];
    $count = strlen($id);
    for ($i = $count; $i < 10; $i++) {
        $temp .= '0';
    }
    $temp .= $id;
    return $temp;
}