```
//專業二開請加微信: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