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
faaa7f73
Commit
faaa7f73
authored
Dec 07, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage
parent
a5cb9817
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
4 deletions
+55
-4
Abstract.php
application/library/Our/Controller/Abstract.php
+1
-0
NameConst.php
application/library/Our/NameConst.php
+1
-1
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+47
-2
Order.php
application/models/DAO/Order/Order.php
+6
-1
No files found.
application/library/Our/Controller/Abstract.php
View file @
faaa7f73
<?php
<?php
namespace
Our
;
namespace
Our
;
use
OSS\Common
;
/**
/**
* 控制器抽象类
* 控制器抽象类
...
...
application/library/Our/NameConst.php
View file @
faaa7f73
...
@@ -181,7 +181,7 @@ class NameConst {
...
@@ -181,7 +181,7 @@ class NameConst {
const
logOut
=
'logOut'
;
const
logOut
=
'logOut'
;
const
versionOne
=
'1.0.
1
'
;
const
versionOne
=
'1.0.
0
'
;
const
versionDefault
=
'1.0'
;
const
versionDefault
=
'1.0'
;
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
faaa7f73
...
@@ -649,8 +649,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
...
@@ -649,8 +649,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
}
}
return
$results
;
return
$results
;
}
}
//任务脚本原来的方法是下面那个
//任务脚本原来的方法是下面那个
public
function
insertStoreMemberStatics
()
public
function
insertStoreMemberStatics
()
{
{
$orderGoodDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$orderGoodDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
...
@@ -696,6 +695,52 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
...
@@ -696,6 +695,52 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
file_put_contents
(
$this
->
baseDir
.
PathConst
::
orderGoodsCreateTime
,
TIMESTAMP
);
file_put_contents
(
$this
->
baseDir
.
PathConst
::
orderGoodsCreateTime
,
TIMESTAMP
);
}
}
//任务脚本原来的方法是下面那个
// public function insertStoreMemberStatics()
// {
// $orderGoodDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::salveDBConnectName);
// $orderDao = \DAO\Order\OrderModel::getInstance();
// $storeMemberStatisticDao = \DAO\StoreMemberStatisticsModel::getInstance(DbNameConst::masterDBConnectName);
// $reufndReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::masterDBConnectName);
// $gmtCreate = file_get_contents($this->baseDir . PathConst::orderGoodsCreateTime);
// $gmtCreate = $gmtCreate ? $gmtCreate : ApiConst::zero;
// $beginTime = $gmtCreate;
// $this->taskIndex = PageConst::taskPageBegin;
// $this->taskSize = PageConst::taskPageSize;
// do {
// $storeMemberStatisticData = $orderGoodDao->getMemberStoreStaticsByCreateTime($beginTime, $this->taskIndex, $this->taskSize);
// $storeMemberStatisticData = isset($storeMemberStatisticData['list']) ? $storeMemberStatisticData['list'] : false;
// if ($storeMemberStatisticData) {
// $this->taskIndex++;
// $storeId = array_column($storeMemberStatisticData, 'storeId');
// $memberId = array_column($storeMemberStatisticData, 'buyerId');
// $storeIds = array_unique($storeId);
// $memberIds = array_unique($memberId);
// $goodsNumCount = $orderGoodDao->getMemberStoreOrderGoodsCount($storeIds, $memberIds);
// $ordersCount = $orderDao->getSumAmountCountByMemberAndStoreId($storeIds, $memberIds);
// $refundLists = $reufndReturnDao->getRefundSuccessMoneyByStoreIdAndMemberId($storeIds, $memberIds);
// if (!empty($ordersCount) && !empty($refundLists)) {
// foreach ($ordersCount as &$order) {
// foreach ($refundLists as $refund) {
// if ($order['buyerId'] == $refund['buyerId'] && $order['storeId'] == $refund['storeId']) {
// $order['orderTotal'] = $order['orderTotal'] - $refund['refundTotal'];
// }
// }
// }
// }
// if (!empty($goodsNumCount)) {
// $storeMemberStatisticDao->addAll($goodsNumCount, 'orderGoodsCount');
// }
// if (!empty($ordersCount)) {
// $storeMemberStatisticDao->addAll($ordersCount, 'orderTotal');
// }
// }
//
//
// } while ($storeMemberStatisticData);
// file_put_contents($this->baseDir . PathConst::orderGoodsCreateTime, TIMESTAMP);
//
// }
//任务脚本
//任务脚本
// public function insertStoreMemberStatics()
// public function insertStoreMemberStatics()
// {
// {
...
...
application/models/DAO/Order/Order.php
View file @
faaa7f73
...
@@ -419,7 +419,12 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -419,7 +419,12 @@ class OrderModel extends \DAO\AbstractModel
return
[];
return
[];
}
}
}
}
public
function
getMemberStoreStaticsByCreateTime
(
$gmtCreate
,
$pageIndex
,
$pageSize
){
$this
->
setDb
(
$this
->
dbName
);
$where
=
\Our\Common
::
format
(
' gmt_update>={0} and gmt_update<{1} and order_state={2}'
,
$gmtCreate
,
TIMESTAMP
,
ApiConst
::
orderStateWaitRecieve
);
$res
=
$this
->
lists
(
$where
,
array
(
'gmt_update'
=>
'asc'
),
$this
->
sumField
,
$pageIndex
,
$pageSize
);
return
$res
[
'list'
]
?
$res
:
false
;
}
public
function
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
)
public
function
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
)
{
{
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
...
...
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