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
a52596d6
Commit
a52596d6
authored
Nov 22, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clientOrder
parent
0ee06732
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
CartService.php
application/models/Business/Cart/CartService.php
+2
-1
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+3
-3
Order.php
application/models/DAO/Order/Order.php
+7
-5
No files found.
application/models/Business/Cart/CartService.php
View file @
a52596d6
...
@@ -1255,11 +1255,12 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -1255,11 +1255,12 @@ class CartServiceModel extends \Business\AbstractModel{
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
$postData
=
json_decode
(
$data
[
'param'
],
true
);
$orderUtil
=
\Order\OrderConfirmUtil
::
getInstance
();
$orderUtil
=
\Order\OrderConfirmUtil
::
getInstance
();
$return
=
$orderUtil
->
addOrder
(
$data
,
$memberId
,
$currentAddress
);
$return
=
$orderUtil
->
addOrder
(
$data
,
$memberId
,
$currentAddress
);
//删除订单列表缓存
//删除订单列表缓存
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$orderDao
->
deleteOrderCache
(
$memberId
);
$orderDao
->
deleteOrderCache
(
$memberId
,
false
,(
$postData
[
'storeId'
])
?
$postData
[
'storeId'
]
:
$postData
[
0
][
'storeId'
]
);
return
$return
;
return
$return
;
}
}
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
a52596d6
...
@@ -296,14 +296,14 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
...
@@ -296,14 +296,14 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$orderCommonDao
=
\DAO\Order\OrderCommonModel
::
getInstance
();
$orderCommonDao
=
\DAO\Order\OrderCommonModel
::
getInstance
();
$returnData
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$orderDao
->
getOrderDetailField
(),
$pageIndex
,
$pageSize
,
$order
,
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
)
));
$returnData
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$orderDao
->
getOrderDetailField
(),
$pageIndex
,
$pageSize
,
$order
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orders
=
$returnData
[
'list'
];
$orders
=
$returnData
[
'list'
];
if
(
!
empty
(
$orders
))
{
if
(
!
empty
(
$orders
))
{
$orderIds
=
array_column
(
$orders
,
'orderId'
);
$orderIds
=
array_column
(
$orders
,
'orderId'
);
if
(
!
empty
(
$orderIds
))
{
if
(
!
empty
(
$orderIds
))
{
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\Order
RedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByOrderIds'
),
array
(
$orderIds
,
$orderGoodsDao
->
orderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\Store
RedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByOrderIds'
),
array
(
$orderIds
,
$orderGoodsDao
->
orderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
//$orderGoods = $orderGoodsDao->getOrderGoodsByOrderIds($orderIds, $orderGoodsDao->orderGoodsField);
//$orderGoods = $orderGoodsDao->getOrderGoodsByOrderIds($orderIds, $orderGoodsDao->orderGoodsField);
$orderCommons
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\Order
RedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'getAllByOrderIds'
),
array
(
$orderIds
,
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orderCommons
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\Store
RedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'getAllByOrderIds'
),
array
(
$orderIds
,
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
//$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
//$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
$ordersOrderCommons
=
Common
::
intergrateOneToOne
(
$orders
,
$orderCommons
,
'orderId'
,
'orderId'
);
$ordersOrderCommons
=
Common
::
intergrateOneToOne
(
$orders
,
$orderCommons
,
'orderId'
,
'orderId'
);
$orderMerge
=
\Our\Common
::
intergrateOneToMany
(
$ordersOrderCommons
,
$orderGoods
,
'orderId'
,
'orderId'
,
'orderGoods'
);
$orderMerge
=
\Our\Common
::
intergrateOneToMany
(
$ordersOrderCommons
,
$orderGoods
,
'orderId'
,
'orderId'
,
'orderGoods'
);
...
...
application/models/DAO/Order/Order.php
View file @
a52596d6
...
@@ -849,11 +849,14 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -849,11 +849,14 @@ class OrderModel extends \DAO\AbstractModel
}
}
//删除订单列表缓存
//删除订单列表缓存
public
function
deleteGetListByMemberId
(
$
member
Id
)
public
function
deleteGetListByMemberId
(
$
store
Id
)
{
{
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$this
,
'getList'
),
array
(),
array
(
$
member
Id
));
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$this
,
'getList'
),
array
(),
array
(
$
store
Id
));
}
}
public
function
deleteStoreOrderListCacheByStoreId
(
$storeId
){
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$this
,
'getList'
),
array
(),
array
(
$storeId
));
}
//删除订单缓存
//删除订单缓存
public
function
deleteOrderCache
(
$memberId
,
$orderId
=
false
,
$stroeId
=
false
,
$deleteGetShopKeeperCountByStoreId
=
false
,
$deleteGetFavoritesCountByStoreId
=
false
,
$diliverymanId
=
ApiConst
::
zero
)
public
function
deleteOrderCache
(
$memberId
,
$orderId
=
false
,
$stroeId
=
false
,
$deleteGetShopKeeperCountByStoreId
=
false
,
$deleteGetFavoritesCountByStoreId
=
false
,
$diliverymanId
=
ApiConst
::
zero
)
{
{
...
@@ -863,17 +866,16 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -863,17 +866,16 @@ class OrderModel extends \DAO\AbstractModel
\DAO\MemberModel
::
getInstance
()
->
deleteTotalCache
(
$memberId
);
\DAO\MemberModel
::
getInstance
()
->
deleteTotalCache
(
$memberId
);
}
}
if
(
!
empty
(
$stroeId
))
{
if
(
!
empty
(
$stroeId
))
{
if
(
$deleteGetShopKeeperCountByStoreId
)
{
if
(
$deleteGetShopKeeperCountByStoreId
)
{
$this
->
deleteGetShopKeeperCountByStoreId
(
$stroeId
);
$this
->
deleteGetShopKeeperCountByStoreId
(
$stroeId
);
}
}
if
(
$deleteGetFavoritesCountByStoreId
)
{
if
(
$deleteGetFavoritesCountByStoreId
)
{
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
$favoritesStoreDao
->
deleteGetFavoritesCountByStoreId
(
$stroeId
);
$favoritesStoreDao
->
deleteGetFavoritesCountByStoreId
(
$stroeId
);
}
}
$this
->
delete
GetListByMember
Id
(
$stroeId
);
$this
->
delete
StoreOrderListCacheByStore
Id
(
$stroeId
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
\DAO\Store\MemberFavoritesStoreStoreMemberStatisticsModel
::
getInstance
()
->
deleteCacheGetGoodsCountOrderTotalByStoreId
(
$stroeId
);
\DAO\Store\MemberFavoritesStoreStoreMemberStatisticsModel
::
getInstance
()
->
deleteCacheGetGoodsCountOrderTotalByStoreId
(
$stroeId
);
$orderGoodsDao
->
deleteOrderGoodsCache
(
$memberId
,
$orderId
,
$stroeId
);
$orderGoodsDao
->
deleteOrderGoodsCache
(
$memberId
,
$orderId
,
$stroeId
);
}
}
...
...
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