From 234020780506bd5cbfd54d01bc77c30f449ef31a Mon Sep 17 00:00:00 2001 From: jianglong Date: Fri, 9 Jun 2023 16:27:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 8 +++++--- app/api/logic/IndexLogic.php | 12 +++++++++++- app/common/enum/AdEnum.php | 2 +- app/common/enum/MenuEnum.php | 24 ++++++++++++++++++++---- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 31a196e..6153fd1 100644 --- a/.env +++ b/.env @@ -3,12 +3,14 @@ app_debug = "false" charset = "utf8mb4" database = "ahbcqz" debug = "1" -hostname = "122.114.59.173" +# hostname = "122.114.59.173" +hostname = "127.0.0.1" hostport = "3306" -password = "DP3hD2E8tTCAJcZF" +# password = "DP3hD2E8tTCAJcZF" +password = "123456" prefix = "ls_" type = "mysql" -username = "ahbcqz" +username = "root" [project] admin_name = "博创设计" diff --git a/app/api/logic/IndexLogic.php b/app/api/logic/IndexLogic.php index 40f7aa8..5a80faa 100644 --- a/app/api/logic/IndexLogic.php +++ b/app/api/logic/IndexLogic.php @@ -297,8 +297,18 @@ class IndexLogic extends Logic $city = DevRegion::where('id',$city)->field('db09_lng,db09_lat')->findOrEmpty()->toArray(); + +// $shopLists = Db::name('shop') +// ->field('id,name,logo,background,expire_time,cover,banner,visited_num,longitude,latitude,round(st_distance_sphere(point('.$city['db09_lng'].','.$city['db09_lat'].'),point(longitude, latitude)),2) as distance') +// ->where($where) +// ->order('distance asc') +// ->limit(5) +// ->select() +// ->toArray(); $shopLists = Db::name('shop') - ->field('id,name,logo,background,expire_time,cover,banner,visited_num,longitude,latitude,round(st_distance_sphere(point('.$city['db09_lng'].','.$city['db09_lat'].'),point(longitude, latitude)),2) as distance') + ->field('id,name,logo,background,expire_time,cover,banner,visited_num,longitude,latitude,ROUND(ACOS(SIN(RADIANS('.$city['db09_lat'].')) * SIN(RADIANS(latitude)) + + COS(RADIANS('.$city['db09_lat'].')) * COS(RADIANS(latitude)) * + COS(RADIANS('.$city['db09_lng'].' - longitude))) * 6371,2) AS distance ' ) ->where($where) ->order('distance asc') ->limit(5) diff --git a/app/common/enum/AdEnum.php b/app/common/enum/AdEnum.php index 8a367e0..edca872 100644 --- a/app/common/enum/AdEnum.php +++ b/app/common/enum/AdEnum.php @@ -52,7 +52,7 @@ class AdEnum{ [ 'name' => '商品分类', 'path' => '/pages/goods_cate/goods_cate', - 'is_tab' => 1, + 'is_tab' => 0, ], [ 'name' => '领券中心', diff --git a/app/common/enum/MenuEnum.php b/app/common/enum/MenuEnum.php index d86c003..8c72ff3 100644 --- a/app/common/enum/MenuEnum.php +++ b/app/common/enum/MenuEnum.php @@ -97,7 +97,7 @@ class MenuEnum{ 'index' => 110, 'name' => '商品分类', 'link' => '/pages/goods_cate/goods_cate', - 'is_tab' => 1, + 'is_tab' => 0, 'link_type' => 1, ], // //积分抽奖 @@ -129,7 +129,7 @@ class MenuEnum{ 'index' => 114, 'name' => '商铺街', 'link' => '/pages/shop_street/shop_street', - 'is_tab' => 0, + 'is_tab' => 1, 'link_type' => 1, ], //商家入驻 @@ -185,9 +185,17 @@ class MenuEnum{ 'index' => 121, 'name' => '投诉中心', 'link' => '/bundle/pages/user/complain', - 'is_tab' => 1, + 'is_tab' => 0, 'link_type' => 1, - ] + ], + //资料库 + [ + 'index' => 122, + 'name' => '资料库', + 'link' => '/pages/resource_list/resource_list', + 'is_tab' => 0, + 'link_type' => 1, + ] ]; //个人中心菜单 @@ -296,6 +304,14 @@ class MenuEnum{ 'is_tab' => 0, 'link_type' => 1, 'menu_type' => 1, + ], + [ + 'index' => 1002, + 'name' => '资料库', + 'link' => '/pages/resource_list/resource_list', + 'is_tab' => 1, + 'link_type' => 1, + 'menu_type' => 1, ] ];