本文整理匯總了PHP中DB_test::get_all_key方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_test::get_all_key方法的具體用法?PHP DB_test::get_all_key怎麽用?PHP DB_test::get_all_key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB_test
的用法示例。
在下文中一共展示了DB_test::get_all_key方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_cusfenrun
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;
}
示例2: get_cusfenrun
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;
}