```
//专业二开请加微信:anbin699
```
会员信息和余额积分更改
```
$member = m("member")->getMember($openid);
m('member')->setCredit($member["openid"], 'credit1', +$zscore, "赠送积分");
m('member')->setCredit($member["openid"], 'credit2', +$zscore, "赠送余额");
```
获取所有会员
```
if(!empty($agentid)){
$fxagentid = $agentid;
while ($fxagentid > 0 ){
$agentuser = m("member")->getMember($fxagentid);
$levelid = intval($agentuser["agentlevel"]);
if ($agentuser["isagent"] == 1 && $agentuser["status"] == 1 && $levelid > 0){
pdo_insert("ewei_shop_agentbouns", $bounsdata);
}
$ceng1 += 1;
$fxagentid = $agentuser['agentid'];
}
}
```
## 下线人数
```
//直推人数
$ztcount = pdo_fetchcolumn('select count(id) from ' . tablename('ewei_shop_member') . " where uniacid=:uniacid and agentid=:agentid and status=1 and isagent=1 and agentlevel>=0 limit 1", array(':uniacid' => $_W['uniacid'], ':agentid' => $agentuser['id']));
//下级团队所有ID
$allxj = pdo_fetchall('select id from ' . tablename('ewei_shop_commission_relation') . ' where pid=:pid', array(':pid' => $id), 'id');
//直推等于自己级别的直推
$zjcount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_commission_relation') . ' a left join ' . tablename('ewei_shop_member') . ' m on m.id = a.id where a.pid=:pid and m.status=1 and m.isagent=1 and m.agentlevel=:levelid limit 1', array(':pid' => $agentuser['id'],':levelid' => $levelid));
```
获取所有下级会员
$agentids = $this->model->getAgentids($member['id']);
```
//专业二开加微信:anbin699
public function getAgentids($openid = 0)
{
global $_W;
$member = m("member")->getMember($openid);
if(empty($member)){
return NULL;
}
$agentids1 = pdo_fetchall('select id from ' . tablename('ewei_shop_member') . ' where agentid=:agentid and uniacid=:uniacid ', array(':uniacid' => $_W['uniacid'], ':agentid' => $member['id']), 'id');
$agentids3 = array();
$agentids = array();
$aj = 0;
$agentids3[] = array_keys($agentids1);
do{
$agentids2 = pdo_fetchall('select id from ' . tablename('ewei_shop_member') . ' where agentid in( ' . implode(',', array_values($agentids3[$aj])) . ') and uniacid=:uniacid', array(':uniacid' => $_W['uniacid']), 'id');
if (!empty($agentids2)){
$agentids3[] = array_keys($agentids2);
}
$aj+=1;
}while(!empty($agentids2));
$agentids[] = $member['id'];
foreach($agentids3 as $value){
foreach($value as $va){
$agentids[] = $va;
}
}
return $agentids;
}
```
- php调试
- php记录
- 常用循环
- 日期时间转换
- 时间格式
- mktime获取今日昨日本月时间戳
- http_build_query生成请求字符串
- PHP取整的几种方法
- 微擎记录
- W全局变量
- Http请求
- 人人商城二开记录
- 数据处理
- 常用查询
- 会员信息
- 确认收货处理
- 维权处理
- 设置读取和配置
- 报单商品类型属性
- 团队佣金
- 自动升级
- 业绩分红
- 前端html和js
- html按钮提交处理
- 引用js传参
- 表单
- 表单判断
- 任务执行
- 提示跳转页
- 全局变量
- 订单交易
- DIY设置
- 系统菜单
- mysql记录
- 创建表-14
- html和js
- 模板中使用js变量传参
- js表单处理
- 表单判断
- js页面跳转刷新
- thinkphp帮助
- 导入导出excel