當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。