public function member_pc()
{
if ($_GET ['id'] && $_GET ['type']) {
$type = $_GET ['type'];
import('ORG.Util.Page');
$id = $_GET ["id"];
$user = htmlspecialchars($_GET ["user"]);
$where = array('id' => $id);
$usersresult = M("User")->where($where)->find();
if (empty($usersresult)) {
exit('未查到该用户信息');
}
//分销保持资格
$this->fenxiao_zige($usersresult);
$this->assign("users", $usersresult);
$count_desc = "TA的:";
if ($type == 1) {
$where = array('l_id' => $id);
} else if ($type == 2) {
$where = array('l_b' => $id);
} else if ($type == 3) {
$where = array('l_c' => $id);
}
if (!empty($user)) {
$where['id'] = $user;
}
$count = M("User")->where($where)->count();
if ($type == 1) {
$count_desc .= "一级下线($count)人";
} else if ($type == 2) {
$count_desc .= "二级下线($count)人";
} else if ($type == 3) {
$count_desc .= "三级下线($count)人";
}
$Page = new Page ($count, 20);
$Page->setConfig('header', '人');
$Page->setConfig('theme', '<li><a>%totalRow% %header%</a></li> <li>%upPage%</li> <li>%downPage%</li> <li>%first%</li> <li>%prePage%</li> <li>%end%</li> '); //(对thinkphp自带分页的格式进行自定义)
$show = $Page->show(); // 分页显示输出
$result = M("User")->where($where)->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign("result", $result);
$this->assign("page", $show);
$this->assign("count_desc", $count_desc);
$info = R("Api/Api/gettheme");
C("DEFAULT_THEME", $info ["theme"]);
$this->assign("info", $info);
$this->assign("dongjia_time", $this->dongjia_time);
$this->display();
}
}选择一个顶级id找到所有其下属idThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。