本文整理汇总了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