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
12fa3995
Commit
12fa3995
authored
Sep 21, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单满起送和订单免服务费
parent
f4a1222c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
Cart.php
application/controllers/Cart.php
+1
-0
CartService.php
application/models/Business/Cart/CartService.php
+20
-12
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+1
-1
No files found.
application/controllers/Cart.php
View file @
12fa3995
...
@@ -138,6 +138,7 @@ class CartController extends \Our\Controller_AbstractApi{
...
@@ -138,6 +138,7 @@ class CartController extends \Our\Controller_AbstractApi{
$gcIds
=
isset
(
$cartList
[
'gcIds'
])
?
$cartList
[
'gcIds'
]
:
array
();
$gcIds
=
isset
(
$cartList
[
'gcIds'
])
?
$cartList
[
'gcIds'
]
:
array
();
$storeCartData
=
array
(
'cartList'
=>
$cartList
[
'list'
],
'storeIds'
=>
array_keys
(
$cartList
[
'list'
]),
'goodsIds'
=>
$cartList
[
'goodsIds'
],
'goodsCommonIds'
=>
$cartList
[
'goodsCommonIds'
],
'blIds'
=>
$cartList
[
'blIds'
],
'gcIds'
=>
$gcIds
);
$storeCartData
=
array
(
'cartList'
=>
$cartList
[
'list'
],
'storeIds'
=>
array_keys
(
$cartList
[
'list'
]),
'goodsIds'
=>
$cartList
[
'goodsIds'
],
'goodsCommonIds'
=>
$cartList
[
'goodsCommonIds'
],
'blIds'
=>
$cartList
[
'blIds'
],
'gcIds'
=>
$gcIds
);
$storeCartData
=
$cartService
->
checkCouponForCart
(
$storeCartData
,
$this
->
memberId
);
$storeCartData
=
$cartService
->
checkCouponForCart
(
$storeCartData
,
$this
->
memberId
);
//$this->success($storeCartData);
$storeCartData
=
$cartService
->
getDeliveryTypeForCart
(
$address
,
$storeCartData
);
$storeCartData
=
$cartService
->
getDeliveryTypeForCart
(
$address
,
$storeCartData
);
$data
=
$cartService
->
getFormatCartListForOrder
(
$storeCartData
,
$address
);
$data
=
$cartService
->
getFormatCartListForOrder
(
$storeCartData
,
$address
);
$this
->
success
(
$data
);
$this
->
success
(
$data
);
...
...
application/models/Business/Cart/CartService.php
View file @
12fa3995
...
@@ -597,21 +597,29 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -597,21 +597,29 @@ class CartServiceModel extends \Business\AbstractModel{
$deliverySetting
[
'buyerDistribution'
]
=
$store
[
'buyer_distribution'
];
$deliverySetting
[
'buyerDistribution'
]
=
$store
[
'buyer_distribution'
];
$deliverySetting
[
'sellerDistribution'
]
=
$store
[
'seller_distribution'
];
$deliverySetting
[
'sellerDistribution'
]
=
$store
[
'seller_distribution'
];
if
(
$deliverySetting
[
'sellerDistribution'
]
&&
$address
){
if
(
$deliverySetting
[
'sellerDistribution'
]
&&
$address
){
$str
=
str_replace
(
'\"'
,
'"'
,
$store
[
'store_sales_scope'
]);
if
((
isset
(
$store
[
'start_shipping_price'
])
&&
$store
[
'start_shipping_price'
]
>
\Our\ApiConst
::
zero
)
&&
$storeCarts
[
'storeTotalPrice'
]
<
$store
[
'start_shipping_price'
]){
$store_sales_scope
=
json_decode
(
$str
,
true
);
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
$result
=
\Our\CommonExtension
::
isPointInPolygon
(
$store_sales_scope
,
array
(
'lng'
=>
$address
[
'lng'
],
'lat'
=>
$address
[
'lat'
]));
}
else
{
$storeDistance
=
\Our\CommonExtension
::
getDistance
(
$address
[
'lat'
],
$address
[
'lng'
],
$store
[
'store_latitude'
],
$store
[
'store_longitude'
],
\Our\ApiConst
::
one
);
$deliveryFreeFlag
=
$storeCarts
[
'deliveryFreeFlag'
];
if
((
isset
(
$store
[
'free_shipping_price'
])
&&
$store
[
'free_shipping_price'
]
>
\Our\ApiConst
::
zero
)
&&
$storeCarts
[
'storeTotalPrice'
]
>=
$store
[
'free_shipping_price'
]){
if
(
$result
){
$deliveryFreeFlag
=
\Our\ApiConst
::
one
;
$deliverTimeList
=
$deliveryFormulaDao
->
getDeliveryFormulaForCart
(
$store
,
$storeDistance
,
$storeCarts
[
'deliveryFreeFlag'
]);
}
if
(
$deliverTimeList
){
$str
=
str_replace
(
'\"'
,
'"'
,
$store
[
'store_sales_scope'
]);
$deliverySetting
[
'deliverTimeList'
]
=
$deliverTimeList
;
$store_sales_scope
=
json_decode
(
$str
,
true
);
$storeCartData
[
'cartList'
][
$storeId
][
'storeDistance'
]
=
$storeDistance
;
$result
=
\Our\CommonExtension
::
isPointInPolygon
(
$store_sales_scope
,
array
(
'lng'
=>
$address
[
'lng'
],
'lat'
=>
$address
[
'lat'
]));
$storeDistance
=
\Our\CommonExtension
::
getDistance
(
$address
[
'lat'
],
$address
[
'lng'
],
$store
[
'store_latitude'
],
$store
[
'store_longitude'
],
\Our\ApiConst
::
one
);
if
(
$result
){
$deliverTimeList
=
$deliveryFormulaDao
->
getDeliveryFormulaForCart
(
$store
,
$storeDistance
,
$deliveryFreeFlag
);
if
(
$deliverTimeList
){
$deliverySetting
[
'deliverTimeList'
]
=
$deliverTimeList
;
$storeCartData
[
'cartList'
][
$storeId
][
'storeDistance'
]
=
$storeDistance
;
}
else
{
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
}
}
else
{
}
else
{
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
}
}
}
else
{
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
}
}
}
else
{
}
else
{
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
$deliverySetting
[
'sellerDistribution'
]
=
\Our\ApiConst
::
zero
;
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
12fa3995
...
@@ -948,7 +948,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
...
@@ -948,7 +948,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj
[
'goodsAttr'
]
=
$goodsDao
->
getFormatGoodsAttr
(
$goods
[
'goods_spec'
]);
$tempObj
[
'goodsAttr'
]
=
$goodsDao
->
getFormatGoodsAttr
(
$goods
[
'goods_spec'
]);
}
}
$store
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$storeDao
,
'getInfoById'
),
array
(
$storeId
,
\Our\NameConst
::
allField
,
false
,
\Our\DbNameConst
::
salveDBConnectName
),
\Our\ApiConst
::
oneHour
);
$store
=
$storeDao
->
get
(
$storeId
,
false
);
$tempObj
[
'goodsMid'
]
=
$store
[
'member_id'
];
$tempObj
[
'goodsMid'
]
=
$store
[
'member_id'
];
$storeCarts
[]
=
$tempObj
;
$storeCarts
[]
=
$tempObj
;
$temp
[
'goodsFreight'
]
=
$goodsFreight
;
$temp
[
'goodsFreight'
]
=
$goodsFreight
;
...
...
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