Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
$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