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


PHP users::get_usercount_bypid方法代码示例

本文整理汇总了PHP中users::get_usercount_bypid方法的典型用法代码示例。如果您正苦于以下问题:PHP users::get_usercount_bypid方法的具体用法?PHP users::get_usercount_bypid怎么用?PHP users::get_usercount_bypid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users的用法示例。


在下文中一共展示了users::get_usercount_bypid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: user_upgrade_stand

 public function user_upgrade_stand()
 {
     $users = new users();
     $bizset = new bizset();
     $award = new award();
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD");
     //达标业绩个数
     $standardcount = $bizsetinfo["bizvalue"];
     //根据等级获取达标金额
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE2");
     $standard_price2 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE3");
     $standard_price3 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE4");
     $standard_price4 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE5");
     $standard_price5 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE6");
     $standard_price6 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE7");
     $standard_price7 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE8");
     $standard_price8 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE9");
     $standard_price9 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE10");
     $standard_price10 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE11");
     $standard_price11 = $bizsetinfo["bizvalue"];
     $db = new DB();
     $db->Connect(DBHOST, DBUSER, DBPW, DBNAME);
     $sql = "select * from users where states = 1 and id !=100000 ";
     $query = $db->query($sql);
     $count = $db->num_rows($query);
     for ($i = 0; $i < $count; $i++) {
         $row = $db->fetch_array($query);
         $uid = $row["id"];
         $productcount = $row["standardlevel"];
         //团队达标级别
         //获取达标个数
         if ($uid > 0) {
             $pidcount = $users->get_usercount_bypid($uid);
         } else {
             $pidcount = 0;
         }
         if ($pidcount == $standardcount) {
             //判断三个市场是否都达标 获取达标系数
             $sql_standard = "select * from users where states = 1 and pid = " . $uid;
             $query_standard = $db->query($sql_standard);
             for ($i = 1; $i <= 3; $i++) {
                 $row_standard = $db->fetch_array($query_standard);
                 $uid_standard = $row_standard["id"];
                 $usersids = $users->getrecursiveallusersid($uid_standard);
                 $usersids = substr($usersids, 0, strlen($usersids) - 1);
                 if (strlen($usersids) <= 0) {
                     $usersids = "0";
                 }
                 if ($usersids != "0") {
                     //获取该区团队业绩
                     $sql = "select abs(sum(amount)) as price from income where types='BUYSTOCK' and userid in ({$usersids}) ";
                     $query_s = $db->query($sql);
                     $result = $db->fetch_array($query_s);
                     $sumamount = $result["price"];
                     $str = "sumamount" . $i;
                     ${$str} = $sumamount;
                 }
             }
             //echo $sumamount1."-".$sumamount2."-".$sumamount3;exit;
             if ($sumamount1 == "") {
                 $sumamount1 = 0;
             }
             if ($sumamount2 == "") {
                 $sumamount2 = 0;
             }
             if ($sumamount3 == "") {
                 $sumamount3 = 0;
             }
             //根据3个市场的累计业绩 判断等级
             $standard_sumamount = self::getMinNum($sumamount1, $sumamount2, $sumamount3);
             if ($standard_sumamount >= $standard_price11) {
                 $sql = "update users set standardlevel = 11  where id=" . $uid . "";
                 $db->query($sql);
             } else {
                 if ($standard_sumamount >= $standard_price10) {
                     $sql = "update users set standardlevel = 10  where id=" . $uid . "";
                     $db->query($sql);
                 } else {
                     if ($standard_sumamount >= $standard_price9) {
                         $sql = "update users set standardlevel = 9  where id=" . $uid . "";
                         $db->query($sql);
                     } else {
                         if ($standard_sumamount >= $standard_price8) {
                             $sql = "update users set standardlevel = 8  where id=" . $uid . "";
                             $db->query($sql);
                         } else {
                             if ($standard_sumamount >= $standard_price7) {
                                 $sql = "update users set standardlevel = 7  where id=" . $uid . "";
                                 $db->query($sql);
                             } else {
                                 if ($standard_sumamount >= $standard_price6) {
//.........这里部分代码省略.........
开发者ID:ekdd1987,项目名称:panda,代码行数:101,代码来源:biz.class.php

示例2: standard_settle

 public function standard_settle($db, $standardcount)
 {
     $users = new users();
     $bizset = new bizset();
     $award = new award();
     //获取最新结算号
     $settle_no = self::get_settle_no();
     //获取最新股价
     $stockinfo = new stock();
     $new_price = $stockinfo->get_newprice(1);
     //根据等级获取达标金额
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE2");
     $standard_price2 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE3");
     $standard_price3 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE4");
     $standard_price4 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE5");
     $standard_price5 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE6");
     $standard_price6 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE7");
     $standard_price7 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE8");
     $standard_price8 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE9");
     $standard_price9 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE10");
     $standard_price10 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PRICE11");
     $standard_price11 = $bizsetinfo["bizvalue"];
     //根据等级获取达标分红比例
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT2");
     $standard_percent2 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT3");
     $standard_percent3 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT4");
     $standard_percent4 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT5");
     $standard_percent5 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT6");
     $standard_percent6 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT7");
     $standard_percent7 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT8");
     $standard_percent8 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT9");
     $standard_percent9 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT10");
     $standard_percent10 = $bizsetinfo["bizvalue"];
     $bizsetinfo = $bizset->get_bizset_bykey("STANDARD_PERCENT11");
     $standard_percent11 = $bizsetinfo["bizvalue"];
     //遍历users
     $query = $db->query("select * from users where states = 1");
     $count = $db->num_rows($query);
     for ($i = 0; $i < $count; $i++) {
         $row = $db->fetch_array($query);
         $uid = $row["id"];
         $usersinfo = $users->get_user_byid($uid);
         $stock = $usersinfo["stock"];
         //用户投资额
         //$user_stock_price = $stock*$new_price;
         //获取达标个数
         $pidcount = $users->get_usercount_bypid($uid);
         if ($pidcount == $standardcount) {
             //判断三个市场是否都达标 获取达标系数
             $sql_standard = "select * from users where states = 1 and pid = " . $uid;
             $query_standard = $db->query($sql_standard);
             for ($i = 0; $i < $standardcount; $i++) {
                 $row_standard = $db->fetch_array($query_standard);
                 $uid_standard = $row_standard["id"];
                 $usersids = $users->getrecursiveallusersid($uid_standard);
                 $usersids = substr($usersids, 0, strlen($usersids) - 1);
                 if (strlen($usersids) <= 0) {
                     $usersids = "0";
                 }
                 if ($usersids != "0") {
                     //$sql = "select sum(stock) as price from users where id in ($usersids) ";
                     //获取投资者投资额
                     $sql = "select abs(sum(amount)) as price  from income where types='BUYSTOCK' and userid = {$uid}";
                     $query_s = $db->query($sql);
                     $result = $db->fetch_array($query_s);
                     $sumamount = $result["price"];
                     //用户投资额
                     //$sumamount = $sumamount*$new_price;
                     //达标分红比例
                     if ($sumamount >= $standard_price11) {
                         $percent = $standard_percent11;
                         $standard_amout = $standard_price11;
                     } else {
                         if ($sumamount >= $standard_price10) {
                             $percent = $standard_percent10;
                             $standard_amout = $standard_price10;
                         } else {
                             if ($sumamount >= $standard_price9) {
                                 $percent = $standard_percent9;
                                 $standard_amout = $standard_price9;
                             } else {
                                 if ($sumamount >= $standard_price8) {
                                     $percent = $standard_percent8;
//.........这里部分代码省略.........
开发者ID:ekdd1987,项目名称:panda,代码行数:101,代码来源:biz.class.bak.php


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