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
78b790f9
Commit
78b790f9
authored
Nov 22, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
order
parent
3b0ce628
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+7
-3
Order.php
application/models/DAO/Order/Order.php
+27
-4
No files found.
application/models/Business/Store/ShopkeeperService.php
View file @
78b790f9
...
...
@@ -388,6 +388,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
{
$order
=
array
(
'gmt_update'
=>
'desc'
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$storeId
=
$this
->
_getStoreByMemberId
(
$memberId
);
if
(
empty
(
$storeId
))
{
ErrorModel
::
throwException
(
CodeConfigModel
::
paramsError
);
...
...
@@ -411,13 +412,16 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$where
=
'han_order.store_id='
.
$storeId
;
if
(
$orderState
==
ApiConst
::
oneHandred
||
(
int
)
$orderState
==
ApiConst
::
oneHandredOne
)
{
if
(
$orderState
==
ApiConst
::
oneHandred
)
{
$where
.=
' and han_order.shipping_type='
.
ApiConst
::
bySelf
;
// $where=$orderDao->getWaitDeliveryCondition();
// $where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
$where
=
$orderDao
->
getByselfCondition
(
$storeId
);
}
else
{
$order
=
array
(
'diliveryman_id'
=>
'asc'
,
'gmt_update'
=>
'asc'
);
$where
.=
' and han_order.shipping_type='
.
ApiConst
::
bySeller
;
// $where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
$where
=
$orderDao
->
getWaitDeliveryCondition
(
$storeId
);
}
}
else
{
...
...
@@ -916,7 +920,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeId
=
$memberDao
->
getInfo
(
$memberId
,
'store_id'
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$waitReceiveCount
=
$orderDao
->
getCountByOrderState
(
$storeId
,
ApiConst
::
orderStateWaitConfirm
);
$waitDeliveryCount
=
$orderDao
->
getCountByShippingTypeAndOrderState
(
$storeId
,
ApiConst
::
bySeller
,
ApiConst
::
orderStateWaitRecieve
);
$waitDeliveryCount
=
$orderDao
->
getCountByShippingTypeAndOrderState
(
$storeId
,
ApiConst
::
bySeller
,
array
(
ApiConst
::
orderStateWaitSend
,
ApiConst
::
orderStateWaitRecieve
)
);
$waitGetCount
=
$orderDao
->
getCountByShippingTypeAndOrderState
(
$storeId
,
ApiConst
::
bySelf
,
ApiConst
::
orderStateWaitRecieve
);
$orderCount
=
$waitReceiveCount
+
$waitDeliveryCount
+
$waitGetCount
;
return
array
(
'waitReceiveCount'
=>
$waitReceiveCount
,
'waitDeliveryCount'
=>
$waitDeliveryCount
,
'waitGetCount'
=>
$waitGetCount
,
'orderCount'
=>
$orderCount
);
...
...
application/models/DAO/Order/Order.php
View file @
78b790f9
...
...
@@ -1128,10 +1128,33 @@ class OrderModel extends \DAO\AbstractModel
$count
=
$this
->
getCountByWhere
(
$where
);
return
$count
;
}
public
function
getCountByShippingTypeAndOrderState
(
$storeId
,
$shippingType
,
$orderState
){
$where
[
'store_id'
]
=
$storeId
;
$where
[
'shipping_type'
]
=
$shippingType
;
$where
[
'order_state'
]
=
$orderState
;
//获得店铺待配送或者待自提订单条件
public
function
getWaitDeliveryCondition
(
$id
,
$memberType
=
'seller'
){
if
(
$memberType
==
'seller'
){
$where
[
'store_id'
]
=
$id
;
}
else
{
$where
[
'member_id'
]
=
$id
;
}
$where
[
'shipping_type'
]
=
ApiConst
::
bySeller
;
$where
[
'order_state'
]
=
array
(
'in'
,
array
(
ApiConst
::
orderStateWaitSend
,
ApiConst
::
orderStateWaitRecieve
));
}
public
function
getByselfCondition
(
$id
,
$memberType
=
'seller'
){
if
(
$memberType
==
'seller'
){
$where
[
'store_id'
]
=
$id
;
}
else
{
$where
[
'member_id'
]
=
$id
;
}
$where
[
'shipping_type'
]
=
ApiConst
::
bySelf
;
$where
[
'order_state'
]
=
ApiConst
::
orderStateWaitRecieve
;
}
public
function
getCountByShippingTypeAndOrderState
(
$storeId
,
$type
=
'bySeller'
){
if
(
$type
==
'bySeller'
){
$where
=
$this
->
getWaitDeliveryCondition
(
$storeId
);
}
if
(
$type
==
'bySelf'
){
$where
=
$this
->
getByselfCondition
(
$storeId
);
}
$count
=
$this
->
getCountByWhere
(
$where
);
return
$count
;
}
...
...
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