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
60e6cc9c
Commit
60e6cc9c
authored
Nov 23, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccw:master_dev
parent
2babff2b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
14 deletions
+59
-14
OrderService.php
application/models/Business/Order/OrderService.php
+1
-0
RefundService.php
application/models/Business/Order/RefundService.php
+17
-10
DeliveryService.php
application/models/Business/Store/DeliveryService.php
+1
-0
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+9
-3
Order.php
application/models/DAO/Order/Order.php
+3
-1
RefundReturn.php
application/models/DAO/Order/RefundReturn.php
+2
-0
Store.php
application/models/DAO/Store.php
+24
-0
Delivery.php
application/modules/Client/controllers/Delivery.php
+2
-0
No files found.
application/models/Business/Order/OrderService.php
View file @
60e6cc9c
...
...
@@ -916,6 +916,7 @@ class OrderServiceModel extends \Business\AbstractModel
}
$data
[
'order_amount'
]
=
$newOrderAmount
;
$res
=
$orderDao
->
updateByOrderId
(
$data
,
$orderId
);
$orderDao
->
deleteOrderCache
(
$orderDetail
[
'memberId'
],
$orderId
,
$storeId
,
true
);
$orderLogDao
->
add
(
$orderDetail
[
'orderId'
],
ArrayConst
::
logMsgType
[
ApiConst
::
sellerUpdateOrderAmount
],
DescribeConst
::
sellerLog
,
$memberName
,
$orderDetail
[
'orderState'
]);
return
$res
;
}
...
...
application/models/Business/Order/RefundService.php
View file @
60e6cc9c
...
...
@@ -119,10 +119,10 @@ class RefundServiceModel extends \Business\AbstractModel
$refund
=
$refundReturnDao
->
find
(
$whereRefund
);
$return_delay
=
$this
->
getMaxDay
(
'return_delay'
);
//发货默认5天后才能选择没收到
$delay_time
=
TIMESTAMP
-
$refund
[
'delay_time'
]
-
60
*
60
*
24
*
$return_delay
;
if
((
$refund
[
'seller_state'
]
!=
'2'
&&
$refund
[
'platform_state'
]
!=
'1'
)
||
$refund
[
'goods_state'
]
!=
'2'
)
{
//检查状态,防止页面刷新不及时造成数据错误
return
false
;
}
// if (($refund['seller_state'] != '2' && $refund['platform_state'] != '1') || $refund['goods_state'] != '2') {//检查状态,防止页面刷新不及时造成数据错误
// return false;
// }
error_reporting
(
E_ALL
);
$refund_array
=
array
();
if
(
$goodsState
==
'3'
&&
$delay_time
>
0
)
{
$refund_array
[
'goods_state'
]
=
3
;
...
...
@@ -131,6 +131,7 @@ class RefundServiceModel extends \Business\AbstractModel
$refund_array
[
'receive_message'
]
=
'确认收货完成'
;
$refund_array
[
'refund_state'
]
=
'3'
;
//状态:1为处理中,2为待管理员处理,3为已完成
$refund_array
[
'goods_state'
]
=
4
;
$refund_array
[
'shipping_over'
]
=
1
;
}
$refundReturnDao
->
db
->
doTransaction
();
$state
=
$refundReturnDao
->
editRefundReturn
(
$whereRefund
,
$refund_array
);
...
...
@@ -180,8 +181,12 @@ class RefundServiceModel extends \Business\AbstractModel
}
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(),
array
(
$refund
[
'store_id'
]));
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
$storeDAO
->
deleteStoreRefundCache
(
$refund
[
'store_id'
],
$refund
[
'order_id'
]);
$refundReturnDao
->
db
->
doCommit
();
return
true
;
}
$refundReturnDao
->
db
->
doRollback
();
...
...
@@ -425,17 +430,17 @@ class RefundServiceModel extends \Business\AbstractModel
}
//获得售后列表
$refundReturns
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\Order
RedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(
$where
,
$this
->
storeRefundReturnField
,
$pageIndex
,
$pageSize
,
$order
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$refundReturns
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\Store
RedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(
$where
,
$this
->
storeRefundReturnField
,
$pageIndex
,
$pageSize
,
$order
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orderGoodsId
=
array_column
(
$refundReturns
[
'list'
],
'orderGoodsId'
);
//获得售后商品列表getOrderGoodsByRecIds
if
(
!
empty
(
$orderGoodsId
))
{
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\Order
RedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByRecIds'
),
array
(
$orderGoodsId
,
$this
->
refundOrderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\Store
RedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByRecIds'
),
array
(
$orderGoodsId
,
$this
->
refundOrderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$refundMerge
=
Common
::
intergrateOneToOne
(
$refundReturns
[
'list'
],
$orderGoods
,
'orderGoodsId'
,
'recId'
);
$orderIds
=
array_column
(
$refundMerge
,
'orderId'
);
$orderWhere
[
'order_id'
]
=
array
(
'in'
,
$orderIds
);
$orders
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
5\Order
RedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$orderWhere
,
$orderDao
->
getOrderDetailField
(),
ApiConst
::
zero
,
$pageSize
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orders
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db
6\Store
RedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$orderWhere
,
$orderDao
->
getOrderDetailField
(),
ApiConst
::
zero
,
$pageSize
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$orders
=
$orderDao
->
convertOrder
(
$orders
[
'list'
],
'orderId'
);
$orderCommons
=
$orderCommonDao
->
getAllByOrderIds
(
$orderIds
,
$orderCommonDao
->
orderCommonField
);
$orderCommons
=
$orderDao
->
convertOrder
(
$orderCommons
,
'orderId'
);
...
...
@@ -764,10 +769,11 @@ class RefundServiceModel extends \Business\AbstractModel
$refundReasonDao
=
\DAO\Order\RefundReasonModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderInfo
=
$orderDao
->
findByMemberIdAndOrderId
(
$memberId
,
$refund
[
'orderId'
],
$this
->
orderField
);
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$whereRefund
[
'goods_id'
]
=
$refund
[
'goodsId'
];
$whereRefund
[
'buyer_id'
]
=
$memberId
;
$whereRefund
[
'order_id'
]
=
$orderInfo
[
'orderId'
];
$refundOne
=
$refundReturnDao
->
find
(
$whereRefund
);
$refundOne
=
$refundReturnDao
->
find
(
$whereRefund
,
$refundReturnDao
->
refundDetailField
);
if
(
!
empty
(
$refundOne
)){
ErrorModel
::
throwException
(
CodeConfigModel
::
alreadyExsitRefundGoods
);
}
...
...
@@ -838,6 +844,7 @@ class RefundServiceModel extends \Business\AbstractModel
$state
=
$refundReturnDao
->
addRefundReturn
(
$refundArray
,
$orderInfo
,
$orderGoods
);
$orderDao
->
deleteOrderCache
(
$memberId
,
$orderInfo
[
'orderId'
],
$orderInfo
[
'storeId'
],
true
);
$refundReturnDao
->
deleteRefundCache
(
$memberId
);
$storeDao
->
deleteStoreRefundCache
(
$refundOne
[
'storeId'
]);
if
(
$state
)
{
$refundStateName
=
$refundReturnDao
->
getRefundTextStatus
(
$refundArrayUnLine
);
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$orderGoods
[
'recId'
]),
array
(
'refund_state_name'
=>
$refundStateName
,
'refund_id'
=>
$state
));
...
...
@@ -882,8 +889,8 @@ class RefundServiceModel extends \Business\AbstractModel
if
(
empty
(
$refundReturn
))
{
ErrorModel
::
throwException
(
CodeConfigModel
::
notExistRefund
);
}
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\RefundReasonRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'findByRecId'
),
array
(
$refundReturn
[
'orderGoodsId'
],
$this
->
getGoodsDetailField
()),
\Our\ApiConst
::
oneDaySecond
);
$this
->
orderCommon
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'findByOrderId'
),
array
(
$refundReturn
[
'orderId'
],
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
);
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\RefundReasonRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'findByRecId'
),
array
(
$refundReturn
[
'orderGoodsId'
],
$this
->
getGoodsDetailField
()),
\Our\ApiConst
::
oneDaySecond
,
array
(
$refundReturn
[
'orderId'
])
);
$this
->
orderCommon
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'findByOrderId'
),
array
(
$refundReturn
[
'orderId'
],
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$refundReturn
[
'orderId'
])
);
// $this->store=$storeDao->get($refundReturn['storeId']);
// $this->store=Common::convertUnderline($this->store[0]);
$order
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'findByOrderId'
),
array
(
$refundReturn
[
'orderId'
],
$orderDao
->
getOrderDetailField
()),
\Our\ApiConst
::
oneDaySecond
,
array
(
$refundReturn
[
'orderId'
]));
...
...
application/models/Business/Store/DeliveryService.php
View file @
60e6cc9c
...
...
@@ -60,6 +60,7 @@ class DeliveryServiceModel extends \Business\AbstractModel
$orderDao
->
db
->
doRollback
();
ErrorModel
::
throwException
(
CodeConfigModel
::
selectDeliveryFail
);
}
$orderDao
->
deleteOrderCache
(
null
,
$data
[
'orderId'
],
$data
[
'storeId'
],
true
);
$orderDao
->
db
->
doCommit
();
return
$res
;
}
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
60e6cc9c
...
...
@@ -469,10 +469,10 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$where
[
'order_id'
]
=
$orderId
;
$where
[
'store_id'
]
=
$storeId
;
$count
=
$orderDao
->
getCountByWhere
(
$where
);
$orderDao
->
deleteOrderCache
(
$memberId
,
$orderId
,
$storeId
);
if
(
$count
){
$data
[
'is_receive_payment'
]
=
TIMESTAMP
;
$updateId
=
$orderDao
->
updateByOrderId
(
$data
,
$orderId
);
$orderDao
->
deleteOrderCache
(
$memberId
,
false
,
$storeId
);
return
$updateId
;
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
notExsitOrder
);
...
...
@@ -492,7 +492,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$diliverymanDao
=
\DAO\Order\DiliverymanModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$storeDao
=
\DAO\StoreModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$qmDeliveryManDao
=
\DAO\Order\QmDeliverymanLogModel
::
getInstance
();
$qmDeliveryManLogDao
=
\DAO\Order\QmDeliverymanLogModel
::
getInstance
();
//订单
$order
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'findByOrderId'
),
array
(
$orderId
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$orderId
));
if
(
$order
[
'store_id'
]
!=
$storeId
)
{
...
...
@@ -503,7 +504,11 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
//收货人地址
//收货人信息
$this
->
orderCommon
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'findByOrderId'
),
array
(
$orderId
,
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
);
$this
->
orderCommon
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'findByOrderId'
),
array
(
$orderId
,
$orderCommonDao
->
orderCommonField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$orderId
));
$qmDeliveryManLogWhere
[
'order_id'
]
=
$orderId
;
$qmDeliveryManLogWhere
[
'order_type'
]
=
ApiConst
::
orderTypeBuy
;
$qmDeliveryManLog
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'find'
),
array
(
$qmDeliveryManLogWhere
,
$qmDeliveryManLogDao
->
fieldDetail
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$orderId
));
//$this->orderCommon = $orderCommonDao->findByOrderId($orderId, $this->orderCommonField);
$reciverInfo
=
$this
->
orderCommon
[
'reciverInfo'
];
$reciverInfo
=
unserialize
(
$reciverInfo
);
...
...
@@ -539,6 +544,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
}
if
(
$returnData
[
'diliverymanId'
])
{
$returnData
[
'deliveryman'
]
=
$diliverymanDao
->
convert
(
$this
->
diliveryman
,
$diliverymanDao
->
getDeliveryManFields
());
$returnData
[
'deliveryman'
][
'distributionFee'
]
=
$qmDeliveryManLog
[
'distributionFee'
];
}
else
{
$returnData
[
'diliverymanId'
]
=
ApiConst
::
zero
;
$returnData
[
'deliveryman'
]
=
new
\stdClass
();
...
...
application/models/DAO/Order/Order.php
View file @
60e6cc9c
...
...
@@ -855,7 +855,9 @@ class OrderModel extends \DAO\AbstractModel
}
public
function
deleteStoreOrderListCacheByStoreId
(
$storeId
){
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$this
,
'getList'
),
array
(),
array
(
$storeId
));
if
(
!
empty
(
$storeId
)){
\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
)
...
...
application/models/DAO/Order/RefundReturn.php
View file @
60e6cc9c
...
...
@@ -553,6 +553,8 @@ class RefundReturnModel extends \DAO\AbstractModel {
return
self
::
$_instance
;
}
/**
* @param $storeId
* @param $orderState
...
...
application/models/DAO/Store.php
View file @
60e6cc9c
...
...
@@ -231,6 +231,30 @@ class StoreModel extends \DAO\AbstractModel
return
$result
;
}
public
function
deleteStoreRefundCache
(
$storeId
,
$orderId
=
ApiConst
::
zero
){
if
(
!
empty
(
$storeId
)){
$refundReturnDao
=
\DAO\Order\RefundReturnModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(),
array
(
$storeId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByRecIds'
),
array
(),
array
(
$storeId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(),
array
(
$storeId
));
}
if
(
!
empty
(
$orderId
)){
$orderCommonDao
=
\DAO\Order\OrderCommonModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'findByRecId'
),
array
(),
array
(
$orderId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderCommonDao
,
'findByOrderId'
),
array
(),
array
(
$orderId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'findByOrderId'
),
array
(),
array
(
$orderId
));
}
}
public
function
deleteStoreCache
(
$storeId
){
if
(
!
empty
(
$storeId
)){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$this
,
'getList'
),
array
(),
array
(
$storeId
));
}
}
public
function
getStoresByCityCode
(
$cityCode
,
$field
=
'store_id,store_longitude,store_latitude,max_sign_rang,max_sales_rang,store_sales_scope'
)
{
$storeClassCondition
=
" store_citycode = '"
.
$cityCode
.
"' "
;
...
...
application/modules/Client/controllers/Delivery.php
View file @
60e6cc9c
...
...
@@ -29,11 +29,13 @@ class DeliveryController extends \Our\Controller_AbstractClient {
*/
public
function
selectDeliveryAction
(){
$deliveryService
=
\Business\Store\DeliveryServiceModel
::
getInstance
();
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$data
=
$this
->
req
[
'data'
];
$data
[
'storeId'
]
=
$this
->
storeId
;
unset
(
$data
[
'key'
]);
$result
=
$deliveryService
->
selectDeliveryMan
(
$data
);
if
(
$result
!==
false
){
$this
->
success
(
$result
,
\Our\DescribeConst
::
successMessage
,
\Our\DescribeConst
::
successMessage
);
}
ErrorModel
::
throwException
(
CodeConfigModel
::
commonError
);
...
...
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