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
8e6e1e28
Commit
8e6e1e28
authored
Sep 21, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
f1f35e2e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
ArrayConst.php
application/library/Our/ArrayConst.php
+5
-0
Order.php
application/models/DAO/Order/Order.php
+14
-0
OrderGoods.php
application/models/DAO/Order/OrderGoods.php
+9
-0
No files found.
application/library/Our/ArrayConst.php
100755 → 100644
View file @
8e6e1e28
...
@@ -118,6 +118,11 @@ class ArrayConst
...
@@ -118,6 +118,11 @@ class ArrayConst
'href'
=>
''
,
'href'
=>
''
,
'price'
=>
0
'price'
=>
0
);
);
const
orderCloseAndCancel
=
array
(
0
,
-
1
);
//确认收货按钮0为未操作过,1为操作过,
//确认收货按钮0为未操作过,1为操作过,
const
reachRemindButtons
=
array
(
const
reachRemindButtons
=
array
(
array
(
array
(
...
...
application/models/DAO/Order/Order.php
View file @
8e6e1e28
...
@@ -386,6 +386,20 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -386,6 +386,20 @@ class OrderModel extends \DAO\AbstractModel
}
}
}
}
public
function
getFieldByWhere
(
$where
,
$filed
){
$this
->
setDb
(
$this
->
dbName
);
if
(
is_array
(
$where
)){
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
}
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$filed
)
->
where
(
$where
)
->
fetchAll
();
if
(
$res
){
$fie
=
array_column
(
$res
,
$filed
);
return
$fie
;
}
else
{
return
[];
}
}
public
function
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
)
public
function
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
)
{
{
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
...
...
application/models/DAO/Order/OrderGoods.php
View file @
8e6e1e28
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
DAO\Order
;
namespace
DAO\Order
;
use
Our\ApiConst
;
use
Our\ApiConst
;
use
Our\ArrayConst
;
use
Our\Common
;
use
Our\Common
;
use
Our\DbNameConst
;
use
Our\DbNameConst
;
use
Our\ImageConst
;
use
Our\ImageConst
;
...
@@ -235,9 +236,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
...
@@ -235,9 +236,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
}
public
function
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
){
public
function
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
){
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$whereOrder
[
'store_id'
]
=
array
(
'in'
,
$storeIds
);
$whereOrder
[
'buyer_id'
]
=
array
(
'in'
,
$memberIds
);
$whereOrder
[
'order_state'
]
=
array
(
'notin'
,
ArrayConst
::
orderCloseAndCancel
);
$orderIds
=
$orderDao
->
getFieldByWhere
(
$whereOrder
,
'order_id'
);
$where
[
'store_id'
]
=
array
(
'in'
,
$storeIds
);
$where
[
'store_id'
]
=
array
(
'in'
,
$storeIds
);
$where
[
'buyer_id'
]
=
array
(
'in'
,
$memberIds
);
$where
[
'buyer_id'
]
=
array
(
'in'
,
$memberIds
);
$where
[
'is_refund'
]
=
array
(
'neq'
,
ApiConst
::
refundSuccess
);
$where
[
'is_refund'
]
=
array
(
'neq'
,
ApiConst
::
refundSuccess
);
if
(
$orderIds
){
$where
[
'order_id'
]
=
array
(
'notin'
,
$orderIds
);
}
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$this
->
sumGoodsNum
)
->
where
(
$where
)
->
group
(
"buyer_id"
)
->
group
(
"store_id"
)
->
fetchAll
();
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$this
->
sumGoodsNum
)
->
where
(
$where
)
->
group
(
"buyer_id"
)
->
group
(
"store_id"
)
->
fetchAll
();
return
$res
;
return
$res
;
...
...
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