diff --git a/app/Http/Controllers/Api/BonusController.php b/app/Http/Controllers/Api/BonusController.php index ce56abf..103c709 100644 --- a/app/Http/Controllers/Api/BonusController.php +++ b/app/Http/Controllers/Api/BonusController.php @@ -21,7 +21,6 @@ class BonusController extends CommonController //参数 $data['limit'] = $request->input('limit', 10); $data['offset'] = $request->input('offset', 0); - $data['user_id'] = Token::$uid; $res = Bonus::getList($data); if(!$res) diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php index dea75d2..b9b89a4 100644 --- a/app/Http/Controllers/Api/UserController.php +++ b/app/Http/Controllers/Api/UserController.php @@ -105,6 +105,10 @@ class UserController extends CommonController $data['limit'] = $request->input('limit', 10); $data['offset'] = $request->input('offset', 0); + if($request->input('parent_id', '')!=''){$data['parent_id'] = $request->input('parent_id');} + if($request->input('group_id', '')!=''){$data['group_id'] = $request->input('group_id');} + if($request->input('sex', '')!=''){$data['sex'] = $request->input('sex');} + $res = User::getList($data); if(!$res) { diff --git a/app/Http/Controllers/Weixin/BonusController.php b/app/Http/Controllers/Weixin/BonusController.php index 8bbe22c..d15f92a 100644 --- a/app/Http/Controllers/Weixin/BonusController.php +++ b/app/Http/Controllers/Weixin/BonusController.php @@ -20,8 +20,7 @@ class BonusController extends CommonController $postdata = array( 'limit' => $pagesize, - 'offset' => $offset, - 'access_token' => $_SESSION['weixin_user_info']['access_token'] + 'offset' => $offset ); $url = env('APP_API_URL')."/bonus_list"; $res = curl_request($url,$postdata,'GET'); diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php index 35b2df9..5455cf7 100644 --- a/app/Http/Controllers/Weixin/UserController.php +++ b/app/Http/Controllers/Weixin/UserController.php @@ -46,6 +46,56 @@ class UserController extends CommonController return view('weixin.user.userinfo', $data); } + //我的分销 + public function userDistribution(Request $request) + { + //获取会员信息 + $postdata = array( + 'access_token' => $_SESSION['weixin_user_info']['access_token'] + ); + $url = env('APP_API_URL')."/user_info"; + $res = curl_request($url,$postdata,'GET'); + $data['user_info'] = $res['data']; + + //获取直属下级会员列表 + $pagesize = 10; + $offset = 0; + if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} + + $postdata = array( + 'limit' => $pagesize, + 'offset' => $offset, + 'parent_id' => $_SESSION['weixin_user_info']['id'], + 'access_token' => $_SESSION['weixin_user_info']['access_token'] + ); + $url = env('APP_API_URL')."/user_list"; + $res = curl_request($url,$postdata,'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count']/$pagesize); + + if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) + { + $html = ''; + + if($res['data']['list']) + { + foreach($res['data']['list'] as $k => $v) + { + $html .= '
'.$v['user_name'].'
'; + $html .= '佣金:'.$v['commission'].'
'; + $html .= '注册时间:'.date('Y-m-d',$v['add_time']).'
'; + $html .= '¥
-有效期至 满可用
+¥
+有效期至 满可用
佣金:
+注册时间:
+