本文整理匯總了PHP中users::get_user_byid方法的典型用法代碼示例。如果您正苦於以下問題:PHP users::get_user_byid方法的具體用法?PHP users::get_user_byid怎麽用?PHP users::get_user_byid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類users
的用法示例。
在下文中一共展示了users::get_user_byid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update_user_amount
public function update_user_amount($db, $resultmoney, $uid)
{
//$sql="select sum(amount) sumamount from income where userid = ".$uid." and left(addtime,10) = date(now()) and states=1";
$sql = "select sum(amount) sumamount from income where userid = " . $uid . " and states=1";
$query_amount = $db->query($sql);
$result = $db->fetch_array($query_amount);
$sumamount = $result["sumamount"];
if ($sumamount == "") {
$sumamount = 0;
}
$users = new users();
$usersinfo = $users->get_user_byid($uid);
$bizset = new bizset();
$bizsetinfo = $bizset->get_bizset_bykey("TOP" . $usersinfo["productcount"]);
$topmoney = $bizsetinfo["bizvalue"];
if ($sumamount + $resultmoney > $topmoney) {
$resultmoney = $topmoney - $sumamount;
}
if ($resultmoney > 0) {
$sql = "update users set amount = amount + " . $resultmoney . " where id = " . $uid . "";
$db->query($sql);
//個人收入扣稅
$settlement = new settlement();
$settlement->do_deduction($uid, $resultmoney, 'TAX', '個人收入扣稅', '');
return $resultmoney;
} else {
return 0;
}
}
示例2: ceil
$totalPage = ceil($totalNumber / $perNumber);
//計算出總頁數
if (!isset($page)) {
$page = 1;
}
//如果沒有值,則賦值1
if (empty($page)) {
$page = 1;
}
$startCount = ($page - 1) * $perNumber;
//分頁開始,根據此方法計算出開始的記錄
$result = $db->query("select * from shengji where jieuserid='" . $_SESSION["uuserid"] . "' {$sqladd} limit {$startCount},{$perNumber}");
//根據前麵的計算出開始的記錄和記錄數
while ($row = $db->fetch_array($result)) {
$users = new users();
$rowu = $users->get_user_byid($db, $row['userid']);
if (!empty($rowu)) {
?>
<tr class="bg-white">
<td><?php
echo $rowu['nickname'];
?>
<br><span class="text-yellow"><?php
echo $rowu['wechat'];
?>
</span><br><span class="text-blue"><?php
echo $rowu['loginname'];
?>
</span></td>
<td><?php