private static function getpaymerinfo($authorid) { $db = new DB_test(); $ErrorReponse = new ErrorReponse(); $query = "select fd_sdcr_merid as merid,fd_sdcr_securitykey as securitykey,fd_sdcr_id as sdcrid," . "fd_sdcr_payfee as \t\t sdcrpayfee,fd_sdcr_tradeurl as tradeurl,fd_sdcr_queryurl as queryurl," . "fd_sdcr_minpayfee as minsdcrpayfee," . "fd_sdcr_agentfee as sdcragentfee from tb_author join tb_sendcenter " . "on fd_sdcr_id = fd_author_sdcrid where fd_author_id = '{$authorid}'"; if ($db->execute($query)) { $arr_merinfo = $db->get_one($query); return $arr_merinfo; } else { $Error = array('rettype' => '100', 'retcode' => '100', 'retmsg' => '商户未审核,不允许操作该功能。'); $ErrorReponse->reponError($Error); exit; } }
public function YiBaoPayFeedback($payResult, $orderId) { if ($payResult["r1_Code"] == "1") { $db = new DB_test(); $query = "update tb_transfermoneyglist set fd_tfmglist_payrq ='00' ,fd_tfmglist_paydate = NOW(), fd_tfmglist_bkntno = '" . $payResult['r2_TrxId'] . "' where fd_tfmglist_bkordernumber = '{$orderId}'"; $db->query($query); $query = "update tb_agentpaymoneylist set fd_agpm_payrq = '00', fd_agpm_bkntno = '" . $payResult['r2_TrxId'] . "' where fd_agpm_bkordernumber = '{$orderId}'"; $db->query($query); $query = "select 1 from tb_cus_fenrunglist where 1 and fd_frlist_bkordernumber = '" . $orderId . "' limit 1"; if ($db->execute($query)) { } else { $query = "SELECT fd_tfmglist_authorid AS authorid, fd_author_cusid AS cusid, fd_tfmglist_paycardid AS paycardid, fd_tfmglist_paydate AS paydate, fd_tfmglist_paymoney AS paymoney, fd_tfmglist_payfee AS payfee, fd_tfmglist_sdcrpayfeemoney AS sdcrpayfeemoney, fd_tfmglist_paytype AS paytype, fd_tfmglist_sdcrpayfeemoney FROM tb_transfermoneyglist WHERE fd_tfmglist_bkordernumber = '{$orderId}'"; if ($db->execute($query)) { $arr_info = $db->get_one($query); $cusfee = 0; $tfbfenrun = 0; $cusfeeResult = getcusfenrun::get_cusfenrun($arr_info['cusid'], $arr_info['paytype'], $arr_info['payMoney'], $arr_info['fd_tfmglist_sdcrpayfeemoney'], $arr_info['fd_tfmglist_payfee'], 0, date("Y-m-d"), null, null); $cusfee = $cusfeeResult["cusfee"]; $tfbfenrun = $arr_cusfee['tfbfenrun']; unset($dateArray); $dateArray['fd_frlist_authorid'] = $arr_info['authorid']; $dateArray['fd_frlist_cusid'] = $arr_info['cusid']; $dateArray['fd_frlist_paycardid'] = $arr_info['paycardid']; $dateArray['fd_frlist_paydate'] = $arr_info['paydate']; $dateArray['fd_frlist_paymoney'] = $arr_info['paymoney']; $dateArray['fd_frlist_payfee'] = $arr_info['payfee']; $dateArray['fd_frlist_cusfee'] = $cusfee; $dateArray['fd_frlist_bkordernumber'] = $orderId; $dateArray['fd_frlist_payrq'] = '00'; $dateArray['fd_frlist_paytype'] = $arr_info['paytype']; $dateArray['fd_frlist_sdcrid'] = 3; $dateArray['fd_frlist_sdcrpayfeemoney'] = $arr_info['sdcrpayfeemoney']; $dateArray['fd_frlist_tfbfenrun'] = $tfbfenrun; $dateArray['fd_frlist_datetime'] = date("Y-m-d H:i:s"); $db->insert("tb_cus_fenrunglist", $dateArray); } } } }
public static function getauthorusername($authorid) { $db = new DB_test(); $query = "select fd_author_state as state,fd_author_truename as truename,fd_author_username as username," . " fd_author_memid as memid,fd_author_shoucardno as shoucardno,fd_author_shoucardman as shoucardman," . " fd_author_shoucardphone as shoucardmobile,fd_author_shoucardbank as shoucardbank from" . " tb_author where fd_author_id = '{$authorid}' "; if ($db->execute($query)) { $arr_author = $db->get_one($query); $authortruename = g2u($arr_author['username']); } return $arr_author; }
function countallsalepaycard($listid, $ftabname, $stabname) { $db = new DB_test(); $query = "select sum(fd_stdetail_quantity) as allquantity from {$stabname} where fd_stdetail_seltid={$listid} group by fd_stdetail_seltid "; $arr_date = $db->get_one($query); $allquantity = $arr_date['allquantity']; $memo_z = "系统补货" . $allquantity . "台刷卡器"; $query = "update {$ftabname} set fd_selt_allquantity = '{$allquantity}',fd_selt_memo = '{$memo_z}'\n\t where fd_selt_id = '{$listid}'"; $db->query($query); }
public function payCardCheck() { global $arr_limitauthorid; $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $paycardkey = $arr_body['paycardkey']; $authorid = $arr_channelinfo['authorid']; /*2014-06-18 取消商户对刷卡器的限制 */ $paycardkey = strtolower($paycardkey); $paycardkey = str_replace("fff", "", $paycardkey); //$paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardkey'])); //刷卡器设备号 $arr_paycard = GetPayCalcuInfo::readpaycardid($arr_body['paycardkey'], $authorid); //刷卡器设备号 $paycardid = $arr_paycard['paycardid']; //刷卡器id $cusid = trim($arr_paycard['cusid']); //代理商 $paycardkey = trim($arr_paycard['paycardkey']); //刷卡器key AgentPayglist::savePayCardinfo($paycardid); //保存最新刷卡时间 $arr_message = array("result" => "success", "message" => "刷卡器检验成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); /*---end --- */ $query = "select fd_paycard_authorid as pauthorid from tb_paycard where fd_paycard_key = '{$paycardkey}' "; $arr_authid = $db->get_one($query); // if(in_array($authorid, $arr_limitauthorid)) // { // if($arr_authid['pauthorid']!=$authorid && $arr_authid['pauthorid']>0) // { // $Error = array ( // 'result' => 'failure', // 'retcode' => '200', // 'retmsg' => '该刷卡器已被其他商户使用,您不允许使用!' // ); // $this->ErrorReponse->reponError($Error); //出错反馈 // exit; // // } // } $query = "select fd_paycard_id,fd_paycard_active,fd_paycard_posstate from tb_paycard where fd_paycard_key = '{$paycardkey}' "; $db->query($query); //echo $query; if ($db->nf()) { $db->next_record(); $paycardid = $db->f(fd_paycard_id); $posstate = $db->f(fd_paycard_posstate); //0 停用 1 警告 2启用 3 冻结 $paycardactive = $db->f(fd_paycard_active); //0 停用 1 警告 2启用 3 冻结 if ($paycardactive == 0) { $arr_message = array("result" => "failure", "message" => "请先激活刷卡器!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 } else { $arr_message = array("result" => "success", "message" => "刷卡器检验成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 } if ($posstate == '3' || $posstate == '0') { $arr_message = array("result" => "failure", "message" => "该刷卡器被冻结或者停用!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 } } else { $arr_message = array("result" => "failure", "message" => "刷卡失败,请先激活刷卡器!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 if (!in_array($authorid, $arr_limitauthorid)) { $arr_message = array("result" => "success", "message" => "刷卡器验证通过!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 } } $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public function authorMenuCount() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $appmnuid = $arr_body['appmnuid']; $authorid = $arr_channelinfo['authorid']; $query = "select fd_appmnuc_count as count from tb_appmenucout where fd_appmnuc_authorid = '{$authorid}'\n and fd_appmnuc_appmnuid = '{$appmnuid}' "; $db->query($query); if ($db->nf()) { $arr_val = $db->get_one($query); $count = $arr_val['count']; $querywhere = " fd_appmnuc_authorid = '{$authorid}'\n and fd_appmnuc_appmnuid = '{$appmnuid}'"; $dateArray['fd_appmnuc_count'] = $count + 1; $db->update("tb_appmenucout", $dateArray, $querywhere); } else { $dateArray['fd_appmnuc_authorid'] = $authorid; $dateArray['fd_appmnuc_appmnuid'] = $appmnuid; $dateArray['fd_appmnuc_count'] = $memo; $db->insert("tb_appmenucout", $dateArray); } $listid = $db->insert_id(); //取出刚插入的记录的主关键值的id $arr_message = array("result" => "success", "message" => "插入数据成功!", "retcode" => "0"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public static function readpmreqmoney($authorid) { $db = new DB_test(); $query = "select sum(fd_pmreq_repmoney) as repmoney,month(fd_pmreq_reqdatetime) as months," . "year(fd_pmreq_reqdatetime) as years " . "from tb_slotcardmoneyreq where fd_pmreq_authorid = '{$authorid}' and fd_pmreq_state = '9' " . "group by years,months "; if ($db->execute($query)) { $arr_monthreqmoney = $db->get_one($query); } return $arr_monthreqmoney; }
public static function get_cusfenrun($cusid, $appmenuno, $paymoney, $payfee, $feelirun = 0) { $db = new DB_test(); $query = "select * from tb_appmenu where fd_appmnu_no = '{$appmenuno}'"; if ($db->execute($query)) { $arr_menuval = $db->get_one($query); $appmenuid = $arr_menuval['fd_appmnu_id']; } else { $appmenuid = 0; //所有功能 ; } $query = "select fd_cus_fenrunid as fenrunid from tb_customer where fd_cus_id = '{$cusid}' "; if ($db->execute($query)) { $arr_cus = $db->get_one($query); $fenrunid = $arr_cus['fenrunid']; } $query = "select * from tb_cus_fenrunset where fd_fenrun_id = '{$fenrunid}' "; if ($db->execute($query)) { $arr_fenrun = $db->get_one($query); } $query = "select * from tb_cus_fenrunsetappmenu where fd_frmset_fenrunid = '{$fenrunid}' group by fd_frmset_appmnuid "; if ($db->execute($query)) { $arr_fenrunappmenu = $db->get_all_key($query, fd_frmset_appmnuid); } $arr_lirunset = $arr_fenrunappmenu[$appmenuid]; //获取到功能分润设置 if (is_array($arr_lirunset)) { $jsmoneytype = $arr_lirunset['fd_frmset_jsmoneytype']; switch ($jsmoneytype) { case "paymoney": $paycardmoney = $paymoney; //交易金额 break; case "payfee": $paycardmoney = $payfee; break; case "feelirun": $paycardmoney = $feelirun; break; } $mode = $arr_lirunset['fd_frmset_mode']; //润分方式 固定还是% $fixfee = $arr_lirunset['fd_frmset_fee']; //固定分润金额 $minfee = $arr_lirunset['fd_frmset_minfee']; //最小分润金额 $maxfee = $arr_lirunset['fd_frmset_maxfee']; //最大分润金额 $fee = $arr_lirunset['fd_frmset_sqfee']; //浮动费率 $fee = substr($fee, 0, -1); switch ($mode) { case "fix": $return_feemoney = $fixfee; break; default: $return_feemoney = round($fee / 100 * $paycardmoney, 2); $return_feemoney = $return_feemoney < $minfee ? $minfee : $return_feemoney; $return_feemoney = $return_feemoney > $maxfee ? $maxfee : $return_feemoney; break; } } else { $return_feemoney = 0; //为设置分润方案 } return $return_feemoney; }
function updateappmenu() { $db = new DB_test(); $query = "select fd_appmnu_version as version from tb_appmenu"; $arr_data = $db->get_one($query); $version = $arr_data['version'] + 0.1; $query = "update tb_appmenu set fd_appmnu_version={$version}"; $db->query($query); }
public static function get_cusfenrun($cusid, $appmenuno, $paymoney, $payfee, $feelirun = 0, $paydate = '', $payprice = '', $paynum = '') { $db = new DB_test(); $query = "select * from tb_appmenu where fd_appmnu_no = '{$appmenuno}'"; if ($db->execute($query)) { $arr_menuval = $db->get_one($query); $appmenuid = $arr_menuval['fd_appmnu_id']; } else { $appmenuid = 0; //所有功能 ; } $query = "select fd_cus_fenrunid as fenrunid\n from tb_customer where fd_cus_id = '{$cusid}' and fd_cus_state = 9 and\n fd_cus_active = '1' "; if ($db->execute($query)) { $arr_cus = $db->get_one($query); $fenrunid = $arr_cus['fenrunid']; } else { return 0; exit; } $query = "select *,fd_fenrun_orderbuycz as orderbuycz,fd_fenrun_agentprice as agentprice\n from tb_cus_fenrunset where fd_fenrun_id = '{$fenrunid}' "; if ($db->execute($query)) { $arr_fenrun = $db->get_one($query); } $agentprice = $arr_fenrun['agentprice']; $orderbuycz = $arr_fenrun['orderbuycz']; if ($appmenuno == 'orderbuy') { $cusfee = ($payprice - $orderbuycz - $agentprice) * $paynum; return $cusfee; exit; } if ($arr_fenrun['fd_fenrun_lirunset'] == 'all') { $appmenuid = 0; } $query = "select * from tb_cus_fenrunsetappmenu where fd_frmset_fenrunid = '{$fenrunid}' group by fd_frmset_appmnuid "; if ($db->execute($query)) { $arr_fenrunappmenu = $db->get_all_key($query, "fd_frmset_appmnuid"); } $arr_lirunset = $arr_fenrunappmenu[$appmenuid]; //获取到功能分润设置 if (is_array($arr_lirunset)) { $jsmoneytype = $arr_lirunset['fd_frmset_jsmoneytype']; switch ($jsmoneytype) { case "paymoney": $paycardmoney = $paymoney; //交易金额 break; case "payfee": $paycardmoney = $payfee; break; case "feelirun": $paycardmoney = $feelirun; break; } $mode = $arr_lirunset['fd_frmset_mode']; //润分方式 固定还是% $fixfee = $arr_lirunset['fd_frmset_fee']; //固定分润金额 $minfee = $arr_lirunset['fd_frmset_minfee']; //最小分润金额 $maxfee = $arr_lirunset['fd_frmset_maxfee']; //最大分润金额 $fee = $arr_lirunset['fd_frmset_sqfee']; //浮动费率 $fee = substr($fee, 0, -1); switch ($mode) { case "fix": $return_feemoney = $fixfee; break; default: $return_feemoney = round($fee / 100 * $paycardmoney, 2); $return_feemoney = $return_feemoney < $minfee ? $minfee : $return_feemoney; $return_feemoney = $return_feemoney > $maxfee ? $maxfee : $return_feemoney; break; } } else { $return_feemoney = 0; //为设置分润方案 } return $return_feemoney; }
public function payagentfenrunlist() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; //$paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid'])); //插卡器 $authorid = trim($arr_channelinfo['authorid']); //操作者 $agentid = trim($arr_channelinfo['agentid']); //代理商id $querytype = trim($arr_body['querytype']); //收益条件 $querywhere = trim($arr_body['querywhere']); //充值金额 $appfunid = trim($arr_body['appfunid']); //充值金额 switch ($querytype) { case "year": break; case "month": break; case "date": break; } $querywhere1 = " and fd_frlist_paydate like '%{$querywhere}%'"; $query = "select fd_frlist_cusid,sum(fd_frlist_cusfee) as totalfenrun\n from tb_cus_fenrunglist\n where fd_frlist_payrq = '00' and fd_frlist_sdcrid<100\n {$querywhere1} and fd_frlist_cusid = '{$agentid}' group by fd_frlist_cusid\n "; if ($db->execute($query)) { $arr_money = $db->get_one($query); } $query = "select fd_amtype_id as appfunid, fd_amtype_name as appfunname,\n sum(fd_frlist_paymoney) as paymoney,sum(fd_frlist_payfee) as payfee,sum(fd_frlist_cusfee) as allfenrun\n from tb_cus_fenrunglist left join tb_appmenu on fd_appmnu_no = fd_frlist_paytype\n left join tb_appmenutype on fd_amtype_id = fd_appmnu_amtypeid\n where fd_frlist_payrq = '00' and fd_frlist_sdcrid<100\n {$querywhere1} and fd_frlist_cusid = '{$agentid}' group by fd_amtype_id order by\n fd_amtype_no "; $db->query($query); $msgdiscount = $db->nf(); $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8'); if (!$arr_msg) { $arr_message = array("result" => "failure", "message" => "没有数据!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 } else { $arr_message = array("result" => "success", "message" => "读取成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 } $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $arr_msg['msgbody']['totalfenrun'] = $arr_money['totalfenrun']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public function insertSupTransferMoney() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $bkntno = trim($arr_body['bkntno']); //银行交易流水号 $authorid = trim($arr_channelinfo['authorid']); $nowdate = date("Y-m-d H:i:s"); $result = $arr_body['result']; $query = "select fd_tfmglist_bkordernumber as bkordernumber,fd_tfmglist_authorid as authorid ,\n DATE_FORMAT(fd_tfmglist_paydate,'%Y%m%d') as orderTime\n from tb_transfermoneyglist\n where 1 and fd_tfmglist_bkntno = '{$bkntno}' and fd_tfmglist_authorid = '{$authorid}' limit 1"; $arr_val = $db->get_one($query); $orderNumber = $arr_val['bkordernumber']; $orderTime = $arr_val['orderTime']; $arr_returninfo = BankPayInfo::bankorderquery($authorid, '', $orderNumber, $orderTime); $arr_returninfo = $this->Publiccls->xml_to_array($arr_returninfo); if ($result == 'success' && $bkntno != "") { $query = "update tb_transfermoneyglist set fd_tfmglist_payrq ='00' ,fd_tfmglist_paydate ='{$nowdate}' \n\t\t\t\t\t where fd_tfmglist_bkntno = '{$bkntno}'"; $db->query($query); $query = "update tb_agentpaymoneylist set fd_agpm_payrq = '00' where fd_agpm_bkntno = '{$bkntno}'"; $db->query($query); $arr_message = array("result" => "success", "message" => "支付成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 } else { if ($result == 'cancel') { // $query = "update tb_transfermoneyglist set fd_tfmglist_payrq ='03' ,fd_tfmglist_paydate ='$nowdate' // where fd_tfmglist_bkntno = '$bkntno'"; // $db->query($query); // $query = "update tb_agentpaymoneylist set fd_agpm_payrq = '03' where fd_agpm_bkntno = '$bkntno'"; // $db->query($query); $arr_message = array("result" => "success", "message" => "支付失败!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 } } $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => array('result' => $arr_message['result'], "message" => $arr_message['message'], $arr_returninfo)); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public static function readsuptfmgcount($authorid, $paytype) { $db = new DB_test(); $datetime = date("Y-m-d"); $query = "select count(1) as count " . "from tb_agentpaymoneylist where fd_agpm_authorid = '{$authorid}' and fd_agpm_paytype = '{$paytype}' and " . "fd_agpm_paydate = '{$datetime}' and fd_agpm_payrq = '00' "; if ($db->execute($query)) { $arr_count = $db->get_one($query); } return $arr_count['count']; }
include "../include/pageft.php"; $db = new DB_test(); $db1 = new DB_test(); if ($brows_rows != "") { $loginreportline = $brows_rows; } switch ($action) { case "selmore": //新增数据 for ($i = 0; $i < count($checkid); $i++) { if (!empty($checkid[$i])) { $query = "select * from tb_paymoneylistdetail where fd_pymyltdetail_agpmid='{$checkid[$i]}'"; $db->query($query); if ($db->nf()) { $query = "select fd_agpm_no as agpm_no from tb_agentpaymoneylist where fd_agpm_id = '{$checkid[$i]}' "; $arr_data = $db->get_one($query); if ($agpm_no) { $agpm_no .= "," . $arr_data['agpm_no']; } else { $agpm_no = $arr_data['agpm_no']; } } } } if ($agpm_no) { $error = "单据编号:{$agpm_no} 已在代付款申请,无法退回"; } else { foreach ($checkid as $value) { $query = "update tb_agentpaymoneylist set fd_agpm_state = 0 ,fd_agpm_spman = '{$loginstaname}',fd_agpm_spdate=now()\n where fd_agpm_id = '{$value}'"; //$db->query($query); }
function getupmenuname($code) { $db = new DB_test(); $query = "select fd_menu_code as mnucode,fd_menu_upcode as mnuupcode,fd_menu_name as mnuname from tb_menu where fd_menu_code = '{$code}'"; $return_array = $db->get_one($query); return $return_array; }
public function checkRechaMoneyStatus() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $bkntno = trim($arr_body['bkntno']); //交易流水号 //$paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid'])); //刷卡器设备号 $authorid = trim($arr_channelinfo['authorid']); //authorid $result = $arr_body['result']; $nowdate = date("Y-m-d H:i:s"); //手机卡充值业务 $query = "select fd_mrclist_bkordernumber as bkordernumber,fd_mrclist_authorid as authorid ,\n fd_mrclist_date as orderdate ,DATE_FORMAT(fd_mrclist_date,'%Y%m%d') as orderTime,\n fd_mrclist_qq as qq\n from tb_qqrechargelist\n where 1 and fd_mrclist_bkntno = '{$bkntno}' and fd_mrclist_authorid = '{$authorid}' limit 1"; $arr_val = $db->get_one($query); $orderNumber = $arr_val['bkordernumber']; $orderTime = $arr_val['orderTime']; $arr_returninfo = BankPayInfo::bankorderquery($authorid, '', $orderNumber, $orderTime); $arr_returninfo = $this->Publiccls->xml_to_array($arr_returninfo); // print_r($arr_returninfo); // exit; if (!is_array($arr_returninfo)) { $arr_message = array("result" => "failure", "message" => "请等待,正在为您充值中!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 } else { $of_retcode = $arr_returninfo['orderinfo']['retcode']; //欧飞接口1为成功 跟我们自己的成功 0 if ($of_retcode == 1) { $retcode = 0; //反馈状态 0 成功 200 自定义错误 $arr_message = array("result" => "success", "message" => $arr_returninfo['orderinfo']['err_msg']); } else { $retcode = $of_retcode; //反馈状态 0 成功 200 自定义错误 $arr_message = array("result" => "failure", "message" => $arr_returninfo['orderinfo']['err_msg']); } } $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
function upallmoney($listid) { $db = new DB_test(); $query = "select fd_couponset_fee as fee,fd_couponset_maxfee as maxfee from tb_couponset left join tb_arrive on fd_arrive_id =fd_couponset_arriveid"; $arr_couponset = $db->get_one($query); $couponfee = substr($arr_couponset['fee'], 0, -1); //浮动手续费 $query = "select (fd_agpm_paymoney) as allmoney,fd_agpm_paytype as paytype \n from tb_paymoneylistdetail \n left join tb_agentpaymoneylist on fd_pymyltdetail_agpmid = fd_agpm_id \n where fd_pymyltdetail_paymoneylistid = '{$listid}' "; $db->query($query); if ($db->nf()) { while ($db->next_record()) { $allmoney = $db->f(allmoney); $paytype = $db->f(paytype); if ($paytype == 'coupon') { $value['payfee'] = $allmoney * ($couponfee * 0.01); $value['payfee'] = $arr_couponset['maxfee'] < $value['payfee'] ? $arr_couponset['maxfee'] : $value['payfee']; $vallmoney += $allmoney - $value['payfee']; //$allmoney = $allmoney * (1-$couponfee*0.01); //$allmoney = $arr_couponset['maxfee']<$allmoney?$arr_couponset['maxfee']:$allmoney; } else { $vallmoney += $allmoney; } } $query = "update tb_paymoneylist set fd_pymylt_money = '{$vallmoney}' where fd_pymylt_id = '{$listid}'"; $db->query($query); } }
$query = "select * from tb_paymoneylist where fd_pymylt_id = '{$listid}' "; $db->query($query); if ($db->nf()) { $db->next_record(); $listno = $db->f(fd_pymylt_no); $dealwithman = $db->f(fd_pymylt_dealwithman); $money = $db->f(fd_pymylt_money); $date = $db->f(fd_pymylt_date); $fkdate = $db->f(fd_pymylt_fkdate); $memo_z = $db->f(fd_pymylt_memo); $times = $db->f(fd_pymylt_times); $isallagentpay = $db->f(fd_pymylt_isagentpay); $paytype = $db->f(fd_pymylt_paytype); } $query = "select fd_couponset_fee as fee,fd_couponset_maxfee as maxfee from tb_couponset left join tb_arrive on fd_arrive_id =fd_couponset_arriveid"; $arr_couponset = $db->get_one($query); $couponfee = substr($arr_couponset['fee'], 0, -1); //浮动手续费 $t->set_block("createfile", "prolist", "prolists"); $query = "select\n case \n when fd_agpm_isagentpay ='0' then '确认付款'\n when fd_agpm_isagentpay ='1' then '已付款'\n when fd_agpm_isagentpay ='2' then '取消付款'\n END isagentpay,\n case\n when fd_agpm_payfeedirct ='s' then ' 收款方'\n when fd_agpm_payfeedirct ='f' then '付款方'\n END payfeedirct,\n fd_agpm_bkordernumber as bkordernumber,\n fd_pymyltdetail_id as vid,\n fd_agpm_bkntno as bkntno,\n fd_paycard_key as paycardkey,\n fd_author_truename as author,\n case\n when fd_agpm_paytype ='coupon' then '购买抵用券'\n when fd_agpm_paytype ='creditcard' then '信用卡还款'" . "when fd_agpm_paytype ='recharge' then '充值'" . "when fd_agpm_paytype ='repay' then '还贷款'" . "when fd_agpm_paytype ='order' then '订单付款'" . "when fd_agpm_paytype ='tfmg' then '转账汇款'" . "when fd_agpm_paytype ='suptfmg' then '超级转账'\n else '其他业务' END paytype,\n fd_agpm_paytype as paytypee,\n fd_agpm_paydate as paydate,\n fd_agpm_shoucardno as shoucardno,\n fd_agpm_shoucardbank as shoucardbank,\n fd_agpm_shoucardman as shoucardman,\n fd_agpm_shoucardmobile as shoucardmobile,\n fd_agpm_current as current,\n fd_agpm_paymoney as paymoney ,\n fd_agpm_payfee as payfee,\n case\n when fd_agpm_payfeedirct ='f' then fd_agpm_paymoney\n when fd_agpm_payfeedirct ='s' then (fd_agpm_paymoney-fd_agpm_payfee)\n else fd_agpm_paymoney END money,\n fd_agpm_arrivemode as arrivemode,\n fd_agpm_arrivedate as arrivedate,\n fd_paycardaccount_accountname as accountname,\n fd_sdcr_name as sdcrname,\n fd_paycardaccount_accountnum as accountnum\n from tb_paymoneylistdetail \n left join tb_agentpaymoneylist on fd_pymyltdetail_agpmid = fd_agpm_id\n left join tb_paycard on fd_agpm_paycardid = fd_paycard_id\n left join tb_author on fd_author_id = fd_agpm_authorid\n left join tb_paycardaccount on fd_paycard_paycardaccount = fd_paycardaccount_id\n left join tb_sendcenter on fd_sdcr_id = fd_agpm_sdcrid\n where fd_pymyltdetail_paymoneylistid = '{$listid}'\n order by fd_agpm_bkntno"; $db->query($query); $arr_result = $db->getFiledData(''); $count = 0; $list_disabled = "disabled"; foreach ($arr_result as $key => $value) { $count++; $value['count'] = $count; $value['arrivemode'] = "T+" . $value['arrivemode']; if ($value['paytypee'] == 'coupon') { $value['payfee'] = $value['paymoney'] * ($couponfee * 0.01); $value['payfee'] = $arr_couponset['maxfee'] < $value['payfee'] ? $arr_couponset['maxfee'] : $value['payfee'];
<?php header('Content-Type: application/x-www-form-urlencoded'); header('Content-Type: text/html;charset=gbk'); require "../include/common.inc.php"; require_once '../include/json.php'; $db = new DB_test(); $query = "select fd_holiday_active as active from tb_holiday where fd_holiday_id ='{$holidayid}'"; $db->query($query); $arr_state = $db->get_one(); if ($arr_state['active']) { $changestate = 0; $returnvalue = "Í£ÓÃ"; } else { $changestate = 1; $returnvalue = "ÆôÓÃ"; } $query = "update tb_holiday set fd_holiday_active='{$changestate}'\t\nwhere fd_holiday_id ='{$holidayid}'"; $db->query($query); echo $returnvalue;
public function orderPayrqStatus() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $bkntno = trim($arr_body['bkntno']); //交易流水号 //$paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid'])); //刷卡器设备号 $authorid = trim($arr_channelinfo['authorid']); //authorid $result = $arr_body['result']; $nowdate = date("Y-m-d H:i:s"); //手机卡充值业务 $query = "select fd_orderlist_bkordernumber as bkordernumber,fd_orderlist_authorid as authorid ,\n fd_orderlist_date as orderdate ,DATE_FORMAT(fd_orderlist_date,'%Y%m%d') as orderTime\n from tb_orderglist\n where 1 and fd_orderlist_bkntno = '{$bkntno}' and fd_orderlist_authorid = '{$authorid}' limit 1"; $arr_val = $db->get_one($query); $orderNumber = $arr_val['bkordernumber']; $orderTime = $arr_val['orderTime']; $arr_returninfo = BankPayInfo::bankorderquery($authorid, '', $orderNumber, $orderTime); $arr_returninfo = $this->Publiccls->xml_to_array($arr_returninfo); if ($result == 'success') { $retcode = 0; //反馈状态 0 成功 200 自定义错误 $arr_message = array("result" => "success", "message" => "订单已支付完成"); } else { $retcode = 0; //反馈状态 0 成功 200 自定义错误 $arr_message = array("result" => "success", "message" => "交易已取消"); } $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public static function getTaocanfee($authorid, $array_taocan, $type, $money) { $db = new DB_test(); $bkcardscdmsetid = $array_taocan[0]['bkcardscdmsetid']; $bkcardpayfsetid = $array_taocan[0]['bkcardpayfsetid']; $slotscdmsetid = $array_taocan[0]['slotscdmsetid']; $slotpayfsetid = $array_taocan[0]['slotpayfsetid']; switch ($type) { case "1": // 信用卡还款 $listid = $bkcardpayfsetid; break; case "2": // 转账汇款 $listid = $bkcardpayfsetid; break; case "3": // 还款款 $listid = $bkcardpayfsetid; break; default: //银行卡 $listid = $bkcardpayfsetid; break; } $query = "select fd_payfset_maxfee as maxfee ,fd_payfset_minfee as minfee ,fd_payfset_fee as fee ," . "fd_payfset_defeedirct as defeedirct ,fd_payfset_arriveid as arriveid ,fd_payfset_fixfee as fixfee from tb_payfeeset where fd_payfset_id='{$listid}' "; $db->query($query); if ($db->execute($query)) { $array_taocan = $db->get_one($query); if ($array_taocan[0]['fixfee'] > 0) { $feemoney = $array_taocan[0]['fixfee']; } else { $fee = $array_taocan[0]['fee']; $feemoney = round($fee / 100 * $money, 2); $feemoney = $feemoney < $array_taocan[0]['minfee'] ? $array_taocan[0]['minfee'] : $feemoney; $feemoney = $feemoney > $array_taocan[0]['maxfee'] ? $array_taocan[0]['maxfee'] : $feemoney; } $arrvalue = array('feemoney' => $feemoney, 'defeedirct' => $array_taocan[0]['defeedirct'], 'arriveid' => $array_taocan[0]['defeedirct']); return $arrvalue; } else { return false; } }