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
d0125c61
Commit
d0125c61
authored
Dec 06, 2018
by
christ
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
8562be52
b2fad5b6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
9 deletions
+18
-9
ImageUtil.php
application/library/Our/ImageUtil.php
+1
-1
GoodsClassService.php
application/models/Business/Goods/GoodsClassService.php
+1
-2
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+4
-1
StoreService.php
application/models/Business/Store/StoreService.php
+12
-5
No files found.
application/library/Our/ImageUtil.php
View file @
d0125c61
...
...
@@ -136,7 +136,7 @@ class ImageUtil {
return
$goodsImg
;
}
public
function
getStoreLabel
(
$storeLabel
,
$directory
=
\Our\ImageConst
::
storeLabel
,
$width
=
\Our\ApiConst
::
zero
,
$height
=
\Our\ApiConst
::
zero
){
public
static
function
getStoreLabel
(
$storeLabel
,
$directory
=
\Our\ImageConst
::
storeLabel
,
$width
=
\Our\ApiConst
::
zero
,
$height
=
\Our\ApiConst
::
zero
){
$storeLableImage
=
\Our\Common
::
getStaticFile
(
$storeLabel
,
$directory
);
if
(
$width
){
if
(
!
$height
){
...
...
application/models/Business/Goods/GoodsClassService.php
View file @
d0125c61
...
...
@@ -186,7 +186,6 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$lat
=
$where
[
'lat'
];
$lng
=
$where
[
'lng'
];
$cityCode
=
$where
[
'cityCode'
];
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$signStoreClasses
=
$this
->
getSignClassesByCityCode
(
$cityCode
);
//var_dump($signStoreClasses);
...
...
@@ -196,7 +195,7 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$storeList
=
array
();
if
(
$tempStoreList
){
foreach
(
$tempStoreList
as
$tempStore
){
$storeList
[
$tempStore
[
'store
_i
d'
]]
=
$tempStore
;
$storeList
[
$tempStore
[
'store
I
d'
]]
=
$tempStore
;
}
}
$returnClass
=
array
();
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
d0125c61
...
...
@@ -954,6 +954,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
$stores
=
$nearbyStoresArray
[
'stores'
]
;
if
(
!
$stores
){
$storesService
=
\Business\Store\StoreServiceModel
::
getInstance
();
$stores
=
$storesService
->
getNearbyStores
(
$position
,
true
,
true
);
}
$storeIds
=
array_keys
(
$stores
);
if
(
$storeIds
)
{
$saleTopSaleGoodsModel
=
\DAO\Goods\StoreTopSaleGoodsModel
::
getInstance
();
...
...
@@ -1003,7 +1007,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$otherGoodsList
=
$goodsList
;
}
}
if
(
count
(
$otherGoodsList
)
<=
\Our\ApiConst
::
defaultIndexGoodsCount
){
$newNineGoodsIds
=
array_keys
(
$otherGoodsList
);
$nineGoodsList
=
$otherGoodsList
;
...
...
application/models/Business/Store/StoreService.php
View file @
d0125c61
...
...
@@ -632,7 +632,7 @@ class StoreServiceModel extends \Business\AbstractModel{
* 获取附近的店铺
* @param $data
*/
public
function
getNearbyStores
(
$where
){
public
function
getNearbyStores
(
$where
,
$nearByFlag
=
false
,
$returnStoreListFlag
=
false
){
$addressDao
=
\DAO\AddressModel
::
getInstance
();
$validFlag
=
$addressDao
->
getValidAddress
(
$where
);
if
(
!
$validFlag
){
...
...
@@ -644,6 +644,10 @@ class StoreServiceModel extends \Business\AbstractModel{
ksort
(
$position
);
$readisSuffix
=
crc32
(
serialize
(
$position
));
$nearbyStoreIds
=
$this
->
getNearbyStoreIds
(
$position
);
if
(
$nearByFlag
&&!
$nearbyStoreIds
){
//如果是换一批调用当前方法 ,没有从缓存得到福建的店铺 ,则直接再次获取
$signStoreInfo
=
\Business\Goods\GoodsClassServiceModel
::
getInstance
()
->
getSignStoreInfo
(
$where
);
$nearbyStoreIds
=
$signStoreInfo
[
'signStoreIds'
];
//当前位置签约店铺ID
}
//没有得到任何附近的店铺
if
(
!
$nearbyStoreIds
){
return
array
(
'totalCount'
=>
0
);
...
...
@@ -665,6 +669,7 @@ class StoreServiceModel extends \Business\AbstractModel{
$stores
[
$store
[
'storeId'
]]
=
$store
;
}
$returnData
[
'totalCount'
]
=
count
(
$stores
);
if
(
$returnData
[
'totalCount'
]
<=
\Our\ApiConst
::
defaultIndexStoreCount
){
//附近的店铺总数小于等于3家则全部返回,大于三家则随机取三家
$threeStoreIds
=
array_keys
(
$stores
);
...
...
@@ -685,6 +690,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$readisSuffix
;
$storeRedis
->
update
(
$nearbyStoreKey
,
$nearbyStoresArray
,
\Our\ApiConst
::
oneHour
);
$threeStores
=
array_values
(
$threeStores
);
if
(
$returnStoreListFlag
){
return
$stores
;
}
return
array
(
'totalCount'
=>
count
(
$stores
),
'stores'
=>
$threeStores
);
}
...
...
@@ -710,7 +718,7 @@ class StoreServiceModel extends \Business\AbstractModel{
}
/*else if(is_array($serviceStoreIds)){
$nearbyStoreIds = $serviceStoreIds;
}*/
if
(
$nearbyStoreIds
&&
is_array
(
$nearbyStoreIds
)){
if
(
isset
(
$nearbyStoreIds
)
&&
is_array
(
$nearbyStoreIds
)){
return
$nearbyStoreIds
;
}
return
false
;
...
...
@@ -765,8 +773,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeRedis
->
update
(
$nearbyStoreKey
,
$nearbyStoresArray
,
\Our\ApiConst
::
oneHour
);
$threeStores
=
array_values
(
$threeStores
);
return
array
(
'totalCount'
=>
count
(
$stores
),
'stores'
=>
$threeStores
);
}
else
{
return
$this
->
getNearbyStores
(
$where
,
true
);
}
return
array
(
'totalCount'
=>
\Our\ApiConst
::
zero
);
}
/**
* 根据一级分类获取所有二级分类对应推荐店铺
...
...
@@ -788,7 +797,6 @@ class StoreServiceModel extends \Business\AbstractModel{
foreach
(
$allStores
as
&
$store
){
$store
[
'isPurchased'
]
=
\Our\ApiConst
::
zero
;
}
$memberStores
=
null
;
if
(
$memberId
){
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
...
...
@@ -805,7 +813,6 @@ class StoreServiceModel extends \Business\AbstractModel{
//$storeGoodsClassDao = \DAO\StoreGoodsClassModel::getInstance();
//签约分类对应店铺
$signStores
=
$this
->
getSignClassStores
(
$gcId
,
$condition
);
//服务分类对应店铺
$serviceStores
=
$this
->
getServiceClassStores
(
$gcId
,
$condition
);
//获取签约分类对应店铺
...
...
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