Commit ab22b1d9 authored by christ's avatar christ

temp

parent a8029130
......@@ -666,27 +666,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$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');
foreach($storeMemberStatisticData as $storeMemberStatics){
}
}
......
......@@ -421,7 +421,7 @@ class OrderModel extends \DAO\AbstractModel
}
public function getMemberStoreStaticsByCreateTime($gmtCreate,$pageIndex,$pageSize){
$this->setDb($this->dbName);
$where =\Our\Common::format(' gmt_update>={0} and gmt_update<{1} and order_state not in({2},{3},{4})',$gmtCreate,TIMESTAMP,ApiConst::orderStateWaitRecieve);
$where =\Our\Common::format(' gmt_update>={0} and gmt_update<{1} and order_state not in({2},{3},{4})',$gmtCreate,TIMESTAMP,ApiConst::orderStateWaitPay,ApiConst::orderStateWaitConfirm,ApiConst::orderStateComplete);
$res=$this->lists($where,array('gmt_update'=>'asc'),$this->sumField,$pageIndex,$pageSize);
return $res['list']?$res:false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment