Commit c7fc933b authored by wwccw0591's avatar wwccw0591

pc

parent ead94d6a
...@@ -90,11 +90,11 @@ class OrderModel extends \DAO\AbstractModel ...@@ -90,11 +90,11 @@ class OrderModel extends \DAO\AbstractModel
$where = Common::format(" store_id={0} and order_state not in ({1})", $storeId,$notInState); $where = Common::format(" store_id={0} and order_state not in ({1})", $storeId,$notInState);
$orderTotal = $this->getOrderCounts($where, $this->countField); $orderTotal = $this->getOrderCounts($where, $this->countField);
$refundAmount=$refundReturnDao->getRefundSuccessMoneyByStoreId($storeId); $refundAmount=$refundReturnDao->getRefundSuccessMoneyByStoreId($storeId);
$orderTotal=$orderTotal-$refundAmount; $orderTotal['orderTotal']=$orderTotal['orderTotal']-$refundAmount;
$where .= Common::format(" and gmt_update between {0} and {1}", $begin, $end); $where .= Common::format(" and gmt_update between {0} and {1}", $begin, $end);
$todayTotal = $this->getOrderCounts($where, $this->countField); $todayTotal = $this->getOrderCounts($where, $this->countField);
$todayRefund=$refundReturnDao->getRefundSuccessMoneyByStoreId($storeId,$begin,$end); $todayRefund=$refundReturnDao->getRefundSuccessMoneyByStoreId($storeId,$begin,$end);
$todayTotal=$todayTotal-$todayRefund; $todayTotal['orderTotal']=$todayTotal['orderTotal']-$todayRefund;
$total['todayOrderTotal'] = isset($todayTotal['orderTotal']) ? $todayTotal['orderTotal'] : ApiConst::zero; $total['todayOrderTotal'] = isset($todayTotal['orderTotal']) ? $todayTotal['orderTotal'] : ApiConst::zero;
$total['todayOrderCount'] = isset($todayTotal['orderCount']) ? $todayTotal['orderCount'] : ApiConst::zero; $total['todayOrderCount'] = isset($todayTotal['orderCount']) ? $todayTotal['orderCount'] : ApiConst::zero;
$total['orderTotal'] = isset($orderTotal['orderTotal']) ? (int)$orderTotal['orderTotal'] : ApiConst::zero; $total['orderTotal'] = isset($orderTotal['orderTotal']) ? (int)$orderTotal['orderTotal'] : ApiConst::zero;
......
...@@ -52,12 +52,12 @@ class RefundReturnModel extends \DAO\AbstractModel { ...@@ -52,12 +52,12 @@ class RefundReturnModel extends \DAO\AbstractModel {
public function getRefundSuccessMoneyByStoreId($storeId,$beginTime=false,$endTime=false){ public function getRefundSuccessMoneyByStoreId($storeId,$beginTime=false,$endTime=false){
$this->setDb($this->dbName); $this->setDb($this->dbName);
if($beginTime){ if($beginTime){
$where=\Our\Common::format(" store_id={0} and refund_state={1} and between {2} and {3}",$storeId,ApiConst::refundSuccess,$beginTime,$endTime); $where=\Our\Common::format(" store_id={0} and is_suc_refund={1} and gmt_update between {2} and {3}",$storeId,ApiConst::refundSuccess,$beginTime,$endTime);
}else{ }else{
$where=\Our\Common::format(" store_id={0} and refund_state={1}",$storeId); $where=\Our\Common::format(" store_id={0} and is_suc_refund={1}",$storeId,ApiConst::refundSuccess);
} }
$res=$this->db->from($this->_tableName)->select($this->sumRefundAmount)->where($where)->fetchValue(); $res=$this->db->from($this->_tableName)->select($this->sumRefundAmount)->where($where)->fetchValue();
return $res?$res:ApiConst::zero; return !empty($res)?$res:ApiConst::zero;
} }
/** /**
......
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