Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
78afda56
Commit
78afda56
authored
Sep 20, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺首页切换内容未切换错误
parent
823946bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
14 deletions
+41
-14
Home.php
application/controllers/Home.php
+22
-11
StoreService.php
application/models/Business/Store/StoreService.php
+0
-2
AddressService.php
application/models/Business/User/AddressService.php
+19
-0
QmStoreClass.php
application/models/DAO/QmStoreClass.php
+0
-1
No files found.
application/controllers/Home.php
View file @
78afda56
...
@@ -23,21 +23,21 @@ class HomeController extends \Our\Controller_AbstractIndex{
...
@@ -23,21 +23,21 @@ class HomeController extends \Our\Controller_AbstractIndex{
}
}
$returnData
[
'currentAddress'
]
=
$currentAddress
;
$returnData
[
'currentAddress'
]
=
$currentAddress
;
$
currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
)
;
$
data
=
$this
->
req
[
\Our\NameConst
::
data
]
;
$requestAddress
=
\Business\User\AddressServiceModel
::
getInstance
()
->
getRequestAddress
(
$data
,
$currentAddress
);
//获取首页推荐分类
//获取首页推荐分类
$resultClasses
=
$this
->
getPlatformGoodsClassAction
(
true
);
$resultClasses
=
$this
->
getPlatformGoodsClassAction
(
$requestAddress
);
if
(
$resultClasses
){
if
(
$resultClasses
){
$returnData
[
'recommendClasses'
]
=
$resultClasses
;
$returnData
[
'recommendClasses'
]
=
$resultClasses
;
}
}
//获取当前位置对应附近店铺
//获取当前位置对应附近店铺
$nearbyStores
=
$this
->
getNearbyStoresAction
(
true
);
$nearbyStores
=
$this
->
getNearbyStoresAction
(
$requestAddress
);
$returnData
[
'nearbyStores'
]
=
$nearbyStores
;
$returnData
[
'nearbyStores'
]
=
$nearbyStores
;
//获取附近店铺对应的商品
//获取附近店铺对应的商品
$recommendGoods
=
$this
->
getIndexHotSalesGoodsAction
(
true
);
$recommendGoods
=
$this
->
getIndexHotSalesGoodsAction
(
$requestAddress
);
$returnData
[
'recommendGoods'
]
=
$recommendGoods
;
$returnData
[
'recommendGoods'
]
=
$recommendGoods
;
...
@@ -46,6 +46,8 @@ class HomeController extends \Our\Controller_AbstractIndex{
...
@@ -46,6 +46,8 @@ class HomeController extends \Our\Controller_AbstractIndex{
$this
->
success
(
$returnData
);
$this
->
success
(
$returnData
);
}
}
/**
/**
* 设置当前地址
* 设置当前地址
* @param bool $flag
* @param bool $flag
...
@@ -67,11 +69,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
...
@@ -67,11 +69,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
* @param bool $flag
* @param bool $flag
* @return array
* @return array
*/
*/
public
function
getIndexHotSalesGoodsAction
(
$
flag
=
false
){
public
function
getIndexHotSalesGoodsAction
(
$
address
=
false
){
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
if
(
$address
){
$currentAddress
=
$address
;
}
$goodsCommonService
=
\Business\Goods\GoodsCommonServiceModel
::
getInstance
();
$goodsCommonService
=
\Business\Goods\GoodsCommonServiceModel
::
getInstance
();
$recommendGoods
=
$goodsCommonService
->
getIndexHotSalesGoods
(
$currentAddress
);
$recommendGoods
=
$goodsCommonService
->
getIndexHotSalesGoods
(
$currentAddress
);
if
(
$
flag
){
if
(
$
address
){
return
$recommendGoods
;
return
$recommendGoods
;
}
}
$this
->
success
(
$recommendGoods
);
$this
->
success
(
$recommendGoods
);
...
@@ -82,11 +87,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
...
@@ -82,11 +87,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
* @param bool $flag
* @param bool $flag
* @return array
* @return array
*/
*/
public
function
getNearbyStoresAction
(
$
flag
=
false
){
public
function
getNearbyStoresAction
(
$
address
=
false
){
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
if
(
$address
){
$currentAddress
=
$address
;
}
$storesService
=
\Business\Store\StoreServiceModel
::
getInstance
();
$storesService
=
\Business\Store\StoreServiceModel
::
getInstance
();
$nearbyStores
=
$storesService
->
getNearbyStores
(
$currentAddress
);
$nearbyStores
=
$storesService
->
getNearbyStores
(
$currentAddress
);
if
(
$
flag
){
if
(
$
address
){
return
$nearbyStores
;
return
$nearbyStores
;
}
}
$this
->
success
(
$nearbyStores
);
$this
->
success
(
$nearbyStores
);
...
@@ -98,11 +106,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
...
@@ -98,11 +106,14 @@ class HomeController extends \Our\Controller_AbstractIndex{
* @param bool $flag
* @param bool $flag
* @return array
* @return array
*/
*/
public
function
getPlatformGoodsClassAction
(
$
flag
=
false
){
public
function
getPlatformGoodsClassAction
(
$
address
=
false
){
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
$currentAddress
=
$this
->
sess
->
get
(
'currentAddress'
);
if
(
$address
){
$currentAddress
=
$address
;
}
$goodsClassService
=
\Business\Goods\GoodsClassServiceModel
::
getInstance
();
$goodsClassService
=
\Business\Goods\GoodsClassServiceModel
::
getInstance
();
$resultClasses
=
$goodsClassService
->
getHomeIndexGoodsClasses
(
$currentAddress
);
$resultClasses
=
$goodsClassService
->
getHomeIndexGoodsClasses
(
$currentAddress
);
if
(
$
flag
){
if
(
$
address
){
return
$resultClasses
;
return
$resultClasses
;
}
}
$this
->
success
(
$resultClasses
);
$this
->
success
(
$resultClasses
);
...
...
application/models/Business/Store/StoreService.php
View file @
78afda56
...
@@ -398,7 +398,6 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -398,7 +398,6 @@ class StoreServiceModel extends \Business\AbstractModel{
if
(
!
$nearbyStoreIds
){
if
(
!
$nearbyStoreIds
){
return
array
(
'totalCount'
=>
0
);
return
array
(
'totalCount'
=>
0
);
}
}
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$storeDao
=
\DAO\StoreModel
::
getInstance
();
...
@@ -483,7 +482,6 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -483,7 +482,6 @@ class StoreServiceModel extends \Business\AbstractModel{
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$readisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)));
$readisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)));
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$readisSuffix
;
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$readisSuffix
;
...
...
application/models/Business/User/AddressService.php
View file @
78afda56
...
@@ -16,6 +16,25 @@ class AddressServiceModel extends \Business\AbstractModel {
...
@@ -16,6 +16,25 @@ class AddressServiceModel extends \Business\AbstractModel {
{
{
}
}
public
function
getRequestAddress
(
$data
,
$returnAddress
){
$returnData
=
array
();
if
(
$returnAddress
[
'returnAddressId'
]
>
\Our\ApiConst
::
zero
){
$returnData
[
'lat'
]
=
$returnAddress
[
'addresses'
][
0
][
'lat'
];
$returnData
[
'lng'
]
=
$returnAddress
[
'addresses'
][
0
][
'lng'
];
$returnData
[
'cityCode'
]
=
$returnAddress
[
'addresses'
][
0
][
'cityCode'
];
}
else
{
if
(
$data
[
'cityCode'
]
&&
$data
[
'lng'
]
&&
$data
[
'lat'
]){
$returnData
=
$data
;
}
else
{
$returnData
=
\Our\ArrayConst
::
defaultAddress
;
unset
(
$returnData
[
'address'
]);
unset
(
$returnData
[
'default'
]);
}
}
return
$returnData
;
}
public
function
writeToFile
(){
public
function
writeToFile
(){
$addressDao
=
\DAO\AreaModel
::
getInstance
();
$addressDao
=
\DAO\AreaModel
::
getInstance
();
...
...
application/models/DAO/QmStoreClass.php
View file @
78afda56
...
@@ -33,7 +33,6 @@ class QmStoreClassModel extends \DAO\AbstractModel{
...
@@ -33,7 +33,6 @@ class QmStoreClassModel extends \DAO\AbstractModel{
}
else
{
}
else
{
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
}
}
return
$result
;
return
$result
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment