diff --git a/application/api/controller/User.php b/application/api/controller/User.php index e1b39767e..cbc72b652 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -16,6 +16,9 @@ use app\service\GoodsService; use app\service\MessageService; use app\service\AppCenterNavService; use app\service\BuyService; +use app\service\GoodsFavorService; +use app\service\GoodsBrowseService; +use app\service\IntegralService; /** * 用户 @@ -518,11 +521,11 @@ class User extends Common // 商品收藏总数 $where = ['user_id'=>$this->user['id']]; - $user_goods_favor_count = GoodsService::GoodsFavorTotal($where); + $user_goods_favor_count = GoodsFavorService::GoodsFavorTotal($where); // 商品浏览总数 $where = ['user_id'=>$this->user['id']]; - $user_goods_browse_count = GoodsService::GoodsBrowseTotal($where); + $user_goods_browse_count = GoodsBrowseService::GoodsBrowseTotal($where); // 未读消息总数 $params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0]; @@ -531,9 +534,13 @@ class User extends Common // 用户订单状态 $user_order_status = OrderService::OrderStatusStepTotal(['user_type'=>'user', 'user'=>$this->user, 'is_comments'=>1, 'is_aftersale'=>1]); + // 用户积分 + $user_integral_data = IntegralService::UserIntegral($params['user']['id']); + $user_integral = (isset($user_integral_data['data']) && isset($user_integral_data['data']['integral'])) ? $user_integral_data['data']['integral'] : 0; + // 初始化数据 $result = array( - 'integral' => (int) $this->user['integral'], + 'integral' => $user_integral, 'avatar' => $this->user['avatar'], 'nickname' => $this->user['nickname'], 'username' => $this->user['username'], diff --git a/application/api/controller/Usergoodsbrowse.php b/application/api/controller/Usergoodsbrowse.php index c54718c26..d2a018626 100755 --- a/application/api/controller/Usergoodsbrowse.php +++ b/application/api/controller/Usergoodsbrowse.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\service\GoodsService; +use app\service\GoodsBrowseService; /** * 用户商品浏览 @@ -56,10 +56,10 @@ class UserGoodsBrowse extends Common $page = max(1, isset($this->data_post['page']) ? intval($this->data_post['page']) : 1); // 条件 - $where = GoodsService::UserGoodsBrowseListWhere($params); + $where = GoodsBrowseService::UserGoodsBrowseListWhere($params); // 获取总数 - $total = GoodsService::GoodsBrowseTotal($where); + $total = GoodsBrowseService::GoodsBrowseTotal($where); $page_total = ceil($total/$number); $start = intval(($page-1)*$number); @@ -69,7 +69,7 @@ class UserGoodsBrowse extends Common 'n' => $number, 'where' => $where, ); - $data = GoodsService::GoodsBrowseList($data_params); + $data = GoodsBrowseService::GoodsBrowseList($data_params); // 返回数据 $result = [ @@ -92,7 +92,7 @@ class UserGoodsBrowse extends Common { $params = $this->data_post; $params['user'] = $this->user; - return GoodsService::GoodsBrowseDelete($params); + return GoodsBrowseService::GoodsBrowseDelete($params); } } ?> \ No newline at end of file diff --git a/application/index/controller/User.php b/application/index/controller/User.php index c960f4c19..076466aa4 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -95,7 +95,7 @@ class User extends Common $this->assign('common_message_total', $common_message_total); // 获取进行中的订单列表 - $params = array_merge($_POST, $_GET); + $params = $this->data_request; $params['user'] = $this->user; $params['is_more'] = 1; $params['status'] = [1,2,3,4]; diff --git a/application/index/view/default/goods/index.html b/application/index/view/default/goods/index.html index 681921045..d40da6bfc 100755 --- a/application/index/view/default/goods/index.html +++ b/application/index/view/default/goods/index.html @@ -312,7 +312,7 @@ -