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
dba8c7eb
Commit
dba8c7eb
authored
Sep 15, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
9fc60fc7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+1
-13
OrderGoods.php
application/models/DAO/Order/OrderGoods.php
+8
-1
No files found.
application/models/Business/Store/ShopkeeperService.php
100755 → 100644
View file @
dba8c7eb
...
@@ -499,19 +499,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
...
@@ -499,19 +499,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$memberIds
=
array_unique
(
$memberId
);
$memberIds
=
array_unique
(
$memberId
);
$goodsNumCount
=
$orderGoodDao
->
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
);
$goodsNumCount
=
$orderGoodDao
->
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
);
$ordersCount
=
$orderDao
->
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
);
$ordersCount
=
$orderDao
->
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
);
$arr
=
array
();
if
(
!
empty
(
$goodsNumCount
)
&&!
empty
(
$ordersCount
)){
foreach
(
$goodsNumCount
as
$k
=>
$r
){
$arr
[]
=
array_merge
(
$r
,
$ordersCount
[
$k
]);
}
$addDatas
=
$arr
;
}
else
{
if
(
!
empty
(
$goodsNumCount
)){
$addDatas
=
$goodsNumCount
;
}
else
{
$addDatas
=
$goodsNumCount
;
}
}
if
(
!
empty
(
$goodsNumCount
)){
if
(
!
empty
(
$goodsNumCount
)){
$storeMemberStatisticDao
->
addAll
(
$goodsNumCount
,
'orderGoodsCount'
);
$storeMemberStatisticDao
->
addAll
(
$goodsNumCount
,
'orderGoodsCount'
);
}
}
...
...
application/models/DAO/Order/OrderGoods.php
View file @
dba8c7eb
...
@@ -230,10 +230,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
...
@@ -230,10 +230,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
}
public
function
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
){
public
function
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
){
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
// if(is_array($storeIds)){
// $storeIds=implode(',',$storeIds);
// }
// if(is_array($memberIds)){
// $memberIds=implode($memberIds);
// }
$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
::
one
);
$where
[
'is_refund'
]
=
array
(
'neq'
,
ApiConst
::
one
);
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$this
->
sumGoodsNum
)
->
group
(
"buyer_id"
)
->
group
(
"store_id"
)
->
fetchAll
();
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
$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