当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_test::get_all_key方法代码示例

本文整理汇总了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;
 }
开发者ID:Xiaoyuyexi,项目名称:client-server,代码行数:67,代码来源:getcusfenrun.php

示例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;
 }
开发者ID:Xiaoyuyexi,项目名称:client-server,代码行数:80,代码来源:getcusfenrun.class.php


注:本文中的DB_test::get_all_key方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。