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
3a93a200
Commit
3a93a200
authored
Aug 23, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
34adc603
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
Shopkeeper.php
application/controllers/Shopkeeper.php
+0
-3
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+3
-3
StoreStatisticsDay.php
application/models/DAO/Store/StoreStatisticsDay.php
+7
-0
No files found.
application/controllers/Shopkeeper.php
View file @
3a93a200
...
...
@@ -31,9 +31,6 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
public
function
indexAction
()
{
$result
=
$this
->
shopkeeperService
->
getShopkeeper
(
$this
->
memberId
);
$this
->
success
(
$result
);
if
(
$result
){
$this
->
success
(
array
(),
\Our\DescribeConst
::
successMessage
,
\Our\DescribeConst
::
successMessage
);
}
}
/**
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
3a93a200
...
...
@@ -45,7 +45,6 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
public
function
getStatistics
(
$memberId
)
{
$storeId
=
$this
->
_getStoreByMemberId
(
$memberId
);
$storeStatisticsDayDao
=
\DAO\Store\StoreStatisticsDayModel
::
getInstance
();
$storeStatisticsDao
=
\DAO\StoreStatisticsModel
::
getInstance
();
$condition
[
'store_id'
]
=
$storeId
;
...
...
@@ -54,7 +53,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
//获取店铺数据统计
$storeStats
=
$storeStatisticsDao
->
find
(
$condition
);
//获取店铺今日销售额和订单量
$storeTodayStats
=
$storeStatisticsDayDao
->
getById
(
$storeId
);
$today
=
date
(
'Y-m-d'
,
TIMESTAMP
);
$storeTodayStats
=
$storeStatisticsDayDao
->
getByStoreIdAndGmtCreate
(
$storeId
,
$today
);
$data
[
'storeId'
]
=
$store
[
'store_id'
];
$data
[
'storeName'
]
=
$store
[
'store_name'
];
$data
[
'storeLabel'
]
=
$store
[
'store_label'
];
...
...
@@ -96,7 +96,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
public
function
getShopkeeper
(
$memberId
)
{
$data
=
$this
->
getStatistics
(
$memberId
);
$data
[
'storeClassStats'
]
=
$this
->
getSalaList
(
$data
[
'storeId'
]);
//
$data['storeClassStats'] = $this->getSalaList($data['storeId']);
return
$data
;
}
...
...
application/models/DAO/Store/StoreStatisticsDay.php
View file @
3a93a200
...
...
@@ -44,6 +44,12 @@ class StoreStatisticsDayModel extends \DAO\AbstractModel {
return
$data
;
}
public
function
getByStoreIdAndGmtCreate
(
$storeId
,
$gmtCreate
){
$where
[
'store_id'
]
=
$storeId
;
$where
[
'gmt_create'
]
=
$gmtCreate
;
$res
=
$this
->
find
(
$where
);
return
$res
;
}
public
function
getById
(
$id
){
$where
[
'id'
]
=
$id
;
...
...
@@ -160,6 +166,7 @@ class StoreStatisticsDayModel extends \DAO\AbstractModel {
return
self
::
$_instance
;
}
/**
* 获取字段
* @return array
...
...
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