function RegisterCreditorCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req) { //print_r($str3XmlParaInfo); $pMerBillNo = $str3Req["pMerBillNo"]; $where = " pMerBillNo = '" . $pMerBillNo . "'"; $sql = "update " . DB_PREFIX . "ips_register_creditor set is_callback = 1 where is_callback = 0 and " . $where; $GLOBALS['db']->query($sql); if ($GLOBALS['db']->affected_rows()) { //操作成功 $data = array(); $data['pAccountDealNo'] = $str3Req["pAccountDealNo"]; //投资人编号 否 IPS返回的投资人编号 $data['pBidDealNo'] = $str3Req["pBidDealNo"]; //标的编号 否 IPS返回的标的编号 $data['pBusiType'] = $str3Req["pBusiType"]; //业务类型 否 返回1,代表投标 $data['pTransferAmt'] = $str3Req["pTransferAmt"]; //实际冻结金额 否 实际冻结金额 $data['pStatus'] = $str3Req["pStatus"]; //债权人状态 否 0:新增 1:迚行中 10:结束 $data['pP2PBillNo'] = $str3Req["pP2PBillNo"]; //IPS P2P订单号 否 由IPS系统生成的唯一流水号 $data['pIpsTime'] = $str3Req["pIpsTime"]; //IPS处理时间 否 格式为:yyyyMMddHHmmss $data['pErrCode'] = $pErrCode; $data['pErrMsg'] = $pErrMsg; $GLOBALS['db']->autoExecute(DB_PREFIX . "ips_register_creditor", $data, 'UPDATE', $where); if ($pErrCode == 'MG00000F') { $ipsdata = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ips_register_creditor where " . $where); $user_id = intval($ipsdata['user_id']); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $data['pMerBillNo'] = $pMerBillNo; $data['pContractNo'] = $str3Req["pContractNo"]; $data['pP2PBillNo'] = $data['pP2PBillNo']; $data['user_id'] = $user_id; $data['user_name'] = $user['user_name']; $data['deal_id'] = $ipsdata['deal_id']; $data['money'] = $data['pTransferAmt']; $data['create_time'] = TIME_UTC; $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_load", $data, "INSERT"); $load_id = $GLOBALS['db']->insert_id(); if ($load_id > 0) { require APP_ROOT_PATH . 'app/Lib/deal_func.php'; dobid2_ok($ipsdata['deal_id'], $user_id); return $ipsdata; } //$user_id = intval($GLOBALS['db']->getOne("select user_id from ".DB_PREFIX."ips_register_creditor where ".$where)); //$GLOBALS['db']->query("update ".DB_PREFIX."user set ips_acct_no = '".$data['pIpsAcctNo']."' where id = ".$user_id); } } else { $ipsdata = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ips_register_creditor where " . $where); return $ipsdata; } }
function dobid2($deal_id, $bid_money, $bid_paypassword) { $root = check_dobid2($deal_id, $bid_money, $bid_paypassword); if ($root["status"] == 0) { return $root; } elseif ($root["status"] == 2) { $root['jump'] = APP_ROOT . "/index.php?ctl=collocation&act=RegisterCreditor&deal_id={$deal_id}&user_id=" . $GLOBALS['user_info']['id'] . "&bid_money={$bid_money}&bid_paypassword={$bid_paypassword}"; return $root; } $root["status"] = 0; $bid_money = floatval($bid_money); $bid_paypassword = strim($bid_paypassword); if ($bid_money > $GLOBALS['user_info']['money']) { $root["show_err"] = $GLOBALS['lang']['MONEY_NOT_ENOUGHT']; return $root; } $data['user_id'] = $GLOBALS['user_info']['id']; $data['user_name'] = $GLOBALS['user_info']['user_name']; $data['deal_id'] = $deal_id; $data['money'] = $bid_money; $data['create_time'] = TIME_UTC; $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_load", $data, "INSERT"); $load_id = $GLOBALS['db']->insert_id(); if ($load_id > 0) { //更改资金记录 $msg = sprintf('编号%s的投标,付款单号%s', $deal_id, $load_id); require_once APP_ROOT_PATH . "system/libs/user.php"; modify_account(array('money' => -$bid_money, 'score' => 0), $GLOBALS['user_info']['id'], $msg); dobid2_ok($deal_id, $GLOBALS['user_info']['id']); //$root["show_err"] = $GLOBALS['lang']['ERROR_TITLE']; $root["status"] = 1; //0:出错;1:正确; return $root; //showSuccess($GLOBALS['lang']['DEAL_BID_SUCCESS'],$ajax,url("index","deal",array("id"=>$id))); } else { $root["show_err"] = $GLOBALS['lang']['ERROR_TITLE']; return $root; } }
function RegisterCreditorCallBack($str3Req) { //print_r($str3XmlParaInfo); $order_id = $str3Req["order_id"]; $where = " order_id = '" . $order_id . "'"; $sql = "update " . DB_PREFIX . "baofoo_business set is_callback = 1 where is_callback = 0 and " . $where; $GLOBALS['db']->query($sql); if ($GLOBALS['db']->affected_rows()) { //操作成功 $data = array(); $GLOBALS['db']->autoExecute(DB_PREFIX . "baofoo_business", $str3Req, 'UPDATE', $where); if ($str3Req['code'] == 'CSD000') { $ipsdata = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "baofoo_business where " . $where); $user_id = intval($ipsdata['load_user_id']); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $deal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . (int) $ipsdata['cus_id']); $data['pMerBillNo'] = $order_id; $data['pContractNo'] = $order_id; $data['pP2PBillNo'] = $order_id; $data['user_id'] = $user_id; $data['user_name'] = $user['user_name']; $data['deal_id'] = $ipsdata['cus_id']; $data['money'] = $ipsdata['load_amount']; $insertdata = return_deal_load_data($data, $user, $deal); $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_load", $insertdata, "INSERT"); $load_id = $GLOBALS['db']->insert_id(); if ($load_id > 0) { require APP_ROOT_PATH . 'app/Lib/deal_func.php'; dobid2_ok($ipsdata['cus_id'], $user_id); return $ipsdata; } } } else { return 1; } }
function dobid2($deal_id, $bid_money, $bid_paypassword, $is_pc = 0) { $root = check_dobid2($deal_id, $bid_money, $bid_paypassword, $is_pc); if ($root["status"] == 0) { return $root; } elseif ($root["status"] == 2) { $root['jump'] = APP_ROOT . "/index.php?ctl=collocation&act=RegisterCreditor&deal_id={$deal_id}&user_id=" . $GLOBALS['user_info']['id'] . "&bid_money=" . $root['bid_money'] . "&bid_paypassword={$bid_paypassword}" . "&from=" . $GLOBALS['request']['from']; $root['jump'] = str_replace("/mapi", "", SITE_DOMAIN . $root['jump']); return $root; } $root["status"] = 0; $bid_money = floatval($root['bid_money']); $bid_paypassword = strim($bid_paypassword); if ($bid_money > $GLOBALS['user_info']['money']) { $root["show_err"] = $GLOBALS['lang']['MONEY_NOT_ENOUGHT']; return $root; } $data['user_id'] = $GLOBALS['user_info']['id']; $data['user_name'] = $GLOBALS['user_info']['user_name']; $data['deal_id'] = $deal_id; $data['money'] = $bid_money; $insertdata = return_deal_load_data($data, $GLOBALS['user_info'], $root['deal']); $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_load", $insertdata, "INSERT"); $load_id = $GLOBALS['db']->insert_id(); if ($load_id > 0) { //更改资金记录 $msg = '[<a href="' . $root['deal']['url'] . '" target="_blank">' . $root['deal']['name'] . '</a>]的投标,付款单号' . $load_id; require_once APP_ROOT_PATH . "system/libs/user.php"; modify_account(array('money' => -$bid_money, 'lock_money' => $bid_money), $GLOBALS['user_info']['id'], $msg, 2); dobid2_ok($deal_id, $GLOBALS['user_info']['id']); //$root["show_err"] = $GLOBALS['lang']['ERROR_TITLE']; $root["status"] = 1; //0:出错;1:正确; return $root; //showSuccess($GLOBALS['lang']['DEAL_BID_SUCCESS'],$ajax,url("index","deal",array("id"=>$id))); } else { $root["show_err"] = $GLOBALS['lang']['ERROR_TITLE']; return $root; } }
function RegisterCreditorCallBack($str3Req) { $requestNo = $str3Req["requestNo"]; $where = " requestNo = '" . $requestNo . "'"; $sql = "update " . DB_PREFIX . "yeepay_cp_transaction set is_callback = 1 where is_callback = 0 and " . $where; $GLOBALS['db']->query($sql); //操作成功 if ($str3Req["code"] == "1") { //print_r($str3XmlParaInfo); $data = array(); $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_cp_transaction", $str3Req, 'UPDATE', $where); if ($str3Req['code'] == '1') { $ipsdata = $GLOBALS['db']->getRow("select *,tenderOrderNo as deal_id from " . DB_PREFIX . "yeepay_cp_transaction where " . $where); $user_id = intval($ipsdata['platformUserNo']); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $deal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $ipsdata['tenderOrderNo']); $data['pMerBillNo'] = $requestNo; $data['pContractNo'] = $requestNo; $data['pP2PBillNo'] = $requestNo; $data['user_id'] = $user_id; $data['user_name'] = $user['user_name']; $data['deal_id'] = $ipsdata['tenderOrderNo']; $data['money'] = $ipsdata['paymentAmount']; $insertdata = return_deal_load_data($data, $user, $deal); $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_load", $insertdata, "INSERT"); $load_id = $GLOBALS['db']->insert_id(); if ($load_id > 0) { require APP_ROOT_PATH . 'app/Lib/deal_func.php'; dobid2_ok($ipsdata['orderNo'], $user_id); return $ipsdata; } } } else { $ipsdata = $GLOBALS['db']->getRow("select *,tenderOrderNo as deal_id from " . DB_PREFIX . "yeepay_cp_transaction where " . $where); return $ipsdata; } }