diff --git a/app/Http/Controllers/Weixin/CollectGoodsController.php b/app/Http/Controllers/Weixin/CollectGoodsController.php new file mode 100644 index 0000000..8858034 --- /dev/null +++ b/app/Http/Controllers/Weixin/CollectGoodsController.php @@ -0,0 +1,37 @@ +input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');} + if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');} + if($request->input('keyword', '') != ''){$data['keyword'] = $request->input('keyword');} + if($request->input('status', '') != ''){$data['status'] = $request->input('status');} + if($request->input('is_promote', '') != ''){$data['is_promote'] = $request->input('is_promote');} + if($request->input('orderby', '') != ''){$data['orderby'] = $request->input('orderby');} + if($request->input('max_price', '') != ''){$data['max_price'] = $request->input('max_price');}else{$data['max_price'] = 99999;} + if($request->input('min_price', '') != ''){$data['min_price'] = $request->input('min_price');}else{$data['min_price'] = 0;} + + //商品列表 + $postdata = array( + 'limit' => 10, + 'offset' => 0 + ); + $url = env('APP_API_URL')."/goods_list"; + $goods_list = curl_request($url,$postdata,'GET'); + $data['goods_list'] = $goods_list['data']['list']; + + return view('weixin.goods.goodslist', $data); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php index 803f0fd..9dacf6f 100644 --- a/app/Http/Controllers/Weixin/UserController.php +++ b/app/Http/Controllers/Weixin/UserController.php @@ -40,16 +40,41 @@ class UserController extends CommonController public function userGoodsHistory(Request $request) { //商品列表 + $pagesize = 10; + $offset = 0; + if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} + $postdata = array( - 'limit' => 10, - 'offset' => 0, + 'limit' => $pagesize, + 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] ); $url = env('APP_API_URL')."/user_goods_history_list"; $res = curl_request($url,$postdata,'GET'); $data['user_goods_history'] = $res['data']['list']; - return view('weixin.user.userGoodsHistory', $data); + $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['goods']['title'].'
'; + $html .= '¥'.$v['goods']['price'].'
'; + $html .= '删除
'; + $html .= '我的收藏
diff --git a/resources/views/weixin/user/userGoodsHistory.blade.php b/resources/views/weixin/user/userGoodsHistory.blade.php index 3a285aa..fe88526 100644 --- a/resources/views/weixin/user/userGoodsHistory.blade.php +++ b/resources/views/weixin/user/userGoodsHistory.blade.php @@ -21,6 +21,67 @@