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
2dd6a3ea
Commit
2dd6a3ea
authored
Nov 03, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
a2810dab
a17774ec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
25 deletions
+53
-25
Goods.php
application/controllers/Goods.php
+2
-1
Group.php
application/controllers/Group.php
+2
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+17
-2
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+18
-1
StoreService.php
application/models/Business/Store/StoreService.php
+14
-20
No files found.
application/controllers/Goods.php
View file @
2dd6a3ea
...
...
@@ -13,7 +13,8 @@ class GoodsController extends \Our\Controller_AbstractIndex {
* 商品详情页
*/
public
function
getAction
(){
$goodsInfo
=
$this
->
goodsService
->
getCommonDetail
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
);
$address
=
\Business\User\AddressServiceModel
::
getInstance
()
->
getMyAddress
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
,
false
);
$goodsInfo
=
$this
->
goodsService
->
getCommonDetail
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
,
$address
);
$store
=
$this
->
goodsService
->
getStore
(
$goodsInfo
[
'storeId'
]);
$goodsInfo
[
'freeShippingPrice'
]
=
$store
[
'freeShippingPrice'
];
$goodsInfo
[
'isQuality'
]
=
$store
[
'isQuality'
];
...
...
application/controllers/Group.php
100755 → 100644
View file @
2dd6a3ea
...
...
@@ -19,7 +19,8 @@ class GroupController extends \Our\Controller_AbstractIndex {
}
public
function
getAction
(){
$goods
=
$this
->
GroupSaleService
->
getGroupGoods
(
$this
->
req
[
\Our\NameConst
::
data
]);
$address
=
\Business\User\AddressServiceModel
::
getInstance
()
->
getMyAddress
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
,
false
);
$goods
=
$this
->
GroupSaleService
->
getGroupGoods
(
$this
->
req
[
\Our\NameConst
::
data
],
$address
);
// $data = $this->GroupSaleService->getOnePBundingCache($this->req[\Our\NameConst::data]['groupId']);
// $this->GroupSaleService->handleData($data);
$storeInfo
=
\Business\Goods\GoodsCommonServiceModel
::
getInstance
()
->
getStore
(
$goods
[
'store_id'
]);
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
2dd6a3ea
...
...
@@ -351,11 +351,26 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* @throws \Exception
* @throws \Our\Exception
*/
public
function
getCommonDetail
(
$param
,
$memberId
){
public
function
getCommonDetail
(
$param
,
$memberId
,
$address
){
$goodsCommonId
=
intval
(
$param
[
'goodsCommonId'
]);
$attrs
=
$this
->
getAttr
(
$goodsCommonId
,
$memberId
);
$commonInfo
=
$attrs
[
'commonInfo'
];
$commonInfo
[
'goods_image'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$commonInfo
[
'goods_image'
]);
//位置相关
if
(
$address
)
{
$lng
=
$address
[
'lng'
];
$lat
=
$address
[
'lat'
];
}
else
{
$lng
=
$param
[
'lng'
];
$lat
=
$param
[
'lat'
];
}
$in_store_service_flag
=
0
;
if
(
$lng
&&
$lat
){
$location
=
array
(
'lat'
=>
$lat
,
'lng'
=>
$lng
);
$in_store_service
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
(
$location
,
$storeId
);
$in_store_service
&&
$in_store_service_flag
=
1
;
}
//所在地
$area
=
''
;
if
(
$commonInfo
[
'areaid_1'
]
&&
$commonInfo
[
'areaid_2'
]){
...
...
@@ -398,7 +413,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$html
=
array
(
'width'
=>
750
,
'height'
=>
$commonInfo
[
'goods_height'
],
'url'
=>
\Our\Common
::
getBaseUrl
()
.
'/index/goodsDetail?goodsCommonId='
.
$goodsCommonId
);
if
(
$commonInfo
[
'is_del'
]
==
1
)
$commonInfo
[
'goods_state'
]
=
0
;
unset
(
$attrs
[
'commonInfo'
]);
return
array_merge
(
array
(
'storeId'
=>
$commonInfo
[
'store_id'
],
'goodsId'
=>
$commonInfo
[
'goodsId'
],
'goodsName'
=>
$commonInfo
[
'goods_name'
],
'goodsVerify'
=>
$commonInfo
[
'goods_verify'
],
'goodsState'
=>
$commonInfo
[
'goods_state'
],
'saleCount'
=>
$commonInfo
[
'sale_num'
],
'collectionState'
=>
$collectionState
,
'isOwn'
=>
$isOwn
,
'isHot'
=>
$commonInfo
[
'goods_hot'
],
'isRecoment'
=>
$commonInfo
[
'goods_commend'
],
'isFree'
=>
$commonInfo
[
'goods_free'
],
'isVirtual'
=>
$commonInfo
[
'is_virtual'
],
'goodsMostLimit'
=>
$commonInfo
[
'goods_most_limit'
],
'goodsLeastLimit'
=>
$commonInfo
[
'goods_least_limit'
],
'goodsTotalLimit'
=>
$commonInfo
[
'goods_total_limit'
],
'address'
=>
$area
,
'range'
=>
$rangePrice
,
'productData'
=>
$productData
,
'htmlContent'
=>
$html
,
'videoUrl'
=>
$commonInfo
[
'goods_youku_url'
]),
$attrs
);
return
array_merge
(
array
(
'storeId'
=>
$commonInfo
[
'store_id'
],
'goodsId'
=>
$commonInfo
[
'goodsId'
],
'goodsName'
=>
$commonInfo
[
'goods_name'
],
'goodsVerify'
=>
$commonInfo
[
'goods_verify'
],
'goodsState'
=>
$commonInfo
[
'goods_state'
],
'saleCount'
=>
$commonInfo
[
'sale_num'
],
'collectionState'
=>
$collectionState
,
'isOwn'
=>
$isOwn
,
'isHot'
=>
$commonInfo
[
'goods_hot'
],
'isRecoment'
=>
$commonInfo
[
'goods_commend'
],
'isFree'
=>
$commonInfo
[
'goods_free'
],
'isVirtual'
=>
$commonInfo
[
'is_virtual'
],
'goodsMostLimit'
=>
$commonInfo
[
'goods_most_limit'
],
'goodsLeastLimit'
=>
$commonInfo
[
'goods_least_limit'
],
'goodsTotalLimit'
=>
$commonInfo
[
'goods_total_limit'
],
'address'
=>
$area
,
'range'
=>
$rangePrice
,
'productData'
=>
$productData
,
'htmlContent'
=>
$html
,
'videoUrl'
=>
$commonInfo
[
'goods_youku_url'
]
,
'inStoreService'
=>
$in_store_service_flag
),
$attrs
);
}
public
function
getAttr
(
$goodsCommonId
,
$memberId
=
null
){
$goodsCommonId
=
(
int
)
$goodsCommonId
;
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
2dd6a3ea
...
...
@@ -22,13 +22,30 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
* @param $param
* @return mixed
*/
public
function
getGroupGoods
(
$param
){
public
function
getGroupGoods
(
$param
,
$address
){
$groupId
=
intval
(
$param
[
'groupId'
]);
$groupList
=
$this
->
getPBundlingListByBlIds
(
array
(
$groupId
),
\Our\DbNameConst
::
salveDBConnectName
,
array
(),
false
,
\Our\ApiConst
::
one
);
if
(
!
$groupList
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyPBundlingdForOrder
);
}
$data
=
$groupList
[
0
];
//位置相关
if
(
$address
)
{
$lng
=
$address
[
'lng'
];
$lat
=
$address
[
'lat'
];
}
else
{
$lng
=
$param
[
'lng'
];
$lat
=
$param
[
'lat'
];
}
$in_store_service_flag
=
0
;
if
(
$lng
&&
$lat
){
$location
=
array
(
'lat'
=>
$lat
,
'lng'
=>
$lng
);
$in_store_service
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
(
$location
,
$storeId
);
$in_store_service
&&
$in_store_service_flag
=
1
;
}
$data
[
'inStoreService'
]
=
$in_store_service_flag
;
$data
[
'state'
]
=
\Our\ApiConst
::
cartGoodsOnline
;
if
(
$data
[
'bl_state'
]
==
\Our\ApiConst
::
zero
)
{
$data
[
'state'
]
=
\Our\ApiConst
::
zero
;
...
...
application/models/Business/Store/StoreService.php
View file @
2dd6a3ea
...
...
@@ -28,16 +28,7 @@ class StoreServiceModel extends \Business\AbstractModel{
if
(
!
$storeId
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyStoreId
);
}
if
(
$address
)
{
$lng
=
$address
[
'lng'
];
$lat
=
$address
[
'lat'
];
}
else
{
$lng
=
$param
[
'lng'
];
$lat
=
$param
[
'lat'
];
}
if
(
!
$lng
||
!
$lat
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyLatLngParam
);
}
list
(
$storeInfo
,
$storeLabel
)
=
\DAO\StoreModel
::
getInstance
()
->
get
(
$storeId
);
if
((
int
)
$param
[
'isScan'
]
>
0
)
{
//扫码进入
...
...
@@ -100,14 +91,21 @@ class StoreServiceModel extends \Business\AbstractModel{
$monthlySalesCount
=
$monthlySalesCount
?
$monthlySalesCount
:
0
;
//位置相关
$distince
=
\Our\CommonExtension
::
getDistance
(
$lat
,
$lng
,
$storeInfo
[
'store_latitude'
],
$storeInfo
[
'store_longitude'
]);
if
(
$address
)
{
$lng
=
$address
[
'lng'
];
$lat
=
$address
[
'lat'
];
}
else
{
$lng
=
$param
[
'lng'
];
$lat
=
$param
[
'lat'
];
}
$defaultDeliveryTime
=
0
;
if
(
$
distince
>
0
){
$in_store_service_flag
=
0
;
if
(
$
lng
&&
$lat
){
$location
=
array
(
'lat'
=>
$lat
,
'lng'
=>
$lng
);
$in_store_service_flag
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
(
$location
,
$storeId
);
if
(
$in_store_service_flag
){
$in_store_service_flag
=
1
;
$in_store_service
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
(
$location
,
$storeId
);
$in_store_service
&&
$in_store_service_flag
=
1
;
if
(
$in_store_service_flag
)
{
$distince
=
\Our\CommonExtension
::
getDistance
(
$lat
,
$lng
,
$storeInfo
[
'store_latitude'
],
$storeInfo
[
'store_longitude'
]);
$DeliveryFormulaInstance
=
\DAO\DeliveryFormulaModel
::
getInstance
();
$deliveryFormula
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db6\DeliveryFormulaRedisModel
::
getInstance
(),
array
(
&
$DeliveryFormulaInstance
,
'getOne'
),
array
(
'*'
,
array
(
'store_id'
=>
$storeId
)),
\Our\ApiConst
::
sevenDaySecond
,
array
(
$storeId
));
$formula
=
$DeliveryFormulaInstance
->
getDeliveryFormulaByDistince
(
$storeId
,
$distince
,
$deliveryFormula
);
...
...
@@ -116,12 +114,8 @@ class StoreServiceModel extends \Business\AbstractModel{
$defaultDeliveryTime
=
(
empty
(
$formula
[
'default_time'
])
?
$formula
[
2
][
'time'
]
:
$formula
[
'default_time'
]);
}
if
(
!
$defaultDeliveryTime
){
//$in_store_service_flag = 0;
$defaultDeliveryTime
=
0
;
}
}
else
{
$in_store_service_flag
=
0
;
$defaultDeliveryTime
=
0
;
}
}
//关注
...
...
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