Commit 86fd58d6 authored by chenchuanwen's avatar chenchuanwen

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd

parents 2fb93195 7f132f3b
...@@ -161,7 +161,7 @@ class CartController extends \Our\Controller_AbstractApi{ ...@@ -161,7 +161,7 @@ class CartController extends \Our\Controller_AbstractApi{
$sess=\Yaf\Session::getInstance(); $sess=\Yaf\Session::getInstance();
$currentAddress = $sess->get('currentAddress'); $currentAddress = $sess->get('currentAddress');
$result = $cartService->addOrder($data,$this->memberId,$currentAddress); $result = $cartService->addOrder($data, $this->memberId,$currentAddress);
$this->success($result); $this->success($result);
} }
......
...@@ -145,10 +145,10 @@ class OrderConfirmUtil { ...@@ -145,10 +145,10 @@ class OrderConfirmUtil {
$cartList = $pBundlingService->getFormatCartListForOrder($storeCartList,$this->memberId,true,$dbName); $cartList = $pBundlingService->getFormatCartListForOrder($storeCartList,$this->memberId,true,$dbName);
$gcIds = isset($cartList['gcIds'])?$cartList['gcIds']:array(); $gcIds = isset($cartList['gcIds'])?$cartList['gcIds']:array();
$storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>array_keys($cartList['list']),'goodsIds'=>$storeCartList['goodsIds'],'goodsCommonIds'=>$storeCartList['goodsCommonIds'],'blIds'=>$storeCartList['blIds'],'gcIds'=>$gcIds); $storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>array_keys($cartList['list']),'goodsIds'=>$storeCartList['goodsIds'],'goodsCommonIds'=>$storeCartList['goodsCommonIds'],'blIds'=>$storeCartList['blIds'],'gcIds'=>$gcIds);
} }
if($this->storeCouponIds&&$this->couponIds){ if ($this->storeCouponIds&&$this->couponIds) {
$storeCartData = $this->checkCouponForOrder($storeCartData,$this->memberId); $storeCartData = $this->checkCouponForOrder($storeCartData, $this->memberId);
} }
return $storeCartData; return $storeCartData;
...@@ -1259,4 +1259,4 @@ class OrderConfirmUtil { ...@@ -1259,4 +1259,4 @@ class OrderConfirmUtil {
return self::$_instance; return self::$_instance;
} }
} }
\ No newline at end of file
...@@ -312,6 +312,7 @@ class ApiConst ...@@ -312,6 +312,7 @@ class ApiConst
const signClassStyle = 2; const signClassStyle = 2;
const isEffective=0; const isEffective=0;
const notEffectiveAllRefund=3;
const defaultAddressCount = 3; const defaultAddressCount = 3;
......
...@@ -603,7 +603,7 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -603,7 +603,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){ foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
$storeCarts = $storeCartData['cartList'][$storeId]; $storeCarts = $storeCartData['cartList'][$storeId];
$deliverySetting['onelinePay'] = $store['wx_pay'];//是否支持线上支付 $deliverySetting['onelinePay'] = $store['wx_pay']&&$store['onlinepay_flag']?\Our\ApiConst::one:\Our\ApiConst::zero;//是否支持线上支付
$deliverySetting['offlinePay'] = $store['offline_pay']; $deliverySetting['offlinePay'] = $store['offline_pay'];
if($deliverySetting['offlinePay']){ if($deliverySetting['offlinePay']){
...@@ -680,7 +680,7 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -680,7 +680,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){ foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
$storeCarts = $storeCartData['cartList'][$storeId]; $storeCarts = $storeCartData['cartList'][$storeId];
$deliverySetting['onelinePay'] = $store['wx_pay'];//是否支持线上支付 $deliverySetting['onelinePay'] = $store['wx_pay']&&$store['onlinepay_flag']?\Our\ApiConst::one:\Our\ApiConst::zero;//是否支持线上支付
$deliverySetting['offlinePay'] = $store['offline_pay']; $deliverySetting['offlinePay'] = $store['offline_pay'];
$deliverySetting['offlinePayway'] = array('payway'=>'','imageUrls'=>array()); $deliverySetting['offlinePayway'] = array('payway'=>'','imageUrls'=>array());
if($deliverySetting['offlinePay']){ if($deliverySetting['offlinePay']){
......
...@@ -319,32 +319,37 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -319,32 +319,37 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$endTime = TIMESTAMP; $endTime = TIMESTAMP;
$where = 'goods_edittime > '.$beginTime.' and goods_edittime<=' . $endTime . ' and goods_id in (select sg.goods_id from han_stat_goods sg)'; $where = 'goods_edittime > '.$beginTime.' and goods_edittime<=' . $endTime . ' and goods_id in (select sg.goods_id from han_stat_goods sg)';
$field = 'goods_id,is_del,goods_name,goods_storage,goods_price,store_id'; $field = 'goods_id,goods_commonid,is_del,goods_name,goods_storage,goods_price,store_id';
$result = true; $result = true;
$goodsDao = \DAO\GoodsModel::getInstance(); $goodsDao = \DAO\GoodsModel::getInstance();
$storeDao = \DAO\StoreModel::getInstance(); $storeDao = \DAO\StoreModel::getInstance();
$statGoodsDao = \DAO\StatGoodsModel::getInstance(DbNameConst::masterDBConnectName); $statGoodsDao = \DAO\StatGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$store_tmp = array(); $store_tmp = array();
if($datas = $goodsDao->getList($where, $field)) { //更新商品报表 $count = $statGoodsDao->getCountByWhere('1=1');
echo 'in:'.count($datas); if($count > 0) {
foreach ($datas as $key=>$val) { if($datas = $goodsDao->getList($where, $field)) { //更新商品报表
if(isset($store_tmp[$val['store_id']])) { echo 'in:'.count($datas);
$store_info = $store_tmp[$val['store_id']]; foreach ($datas as $key=>$val) {
} else { if(isset($store_tmp[$val['store_id']])) {
$store_info = $storeDao->getFieldsInfo(array('store_id'=>$val['store_id']), 'province_id, city_id, area_id'); $store_info = $store_tmp[$val['store_id']];
} } else {
$update_stat_goods = $val; $store_info = $storeDao->getFieldsInfo(array('store_id'=>$val['store_id']), 'province_id, city_id, area_id');
$update_stat_goods['upd_time'] = $endTime; }
$update_stat_goods['province_id'] = $store_info['province_id']; $update_stat_goods = $val;
$update_stat_goods['city_id'] = $store_info['city_id']; $update_stat_goods['upd_time'] = $endTime;
$update_stat_goods['area_id'] = $store_info['area_id']; $update_stat_goods['province_id'] = $store_info['province_id'];
unset($update_stat_goods['goods_id']); $update_stat_goods['city_id'] = $store_info['city_id'];
$where = 'goods_id='.$val['goods_id']. ' and upd_time <'.$beginTime; $update_stat_goods['area_id'] = $store_info['area_id'];
if(!$statGoodsDao->update($where, $update_stat_goods)){ unset($update_stat_goods['goods_id']);
$result = false; $where = 'goods_id='.$val['goods_id']. ' and upd_time <'.$beginTime;
if(!$statGoodsDao->update($where, $update_stat_goods)){
$result = false;
}
} }
} }
} else {
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, '0');
} }
$where = 'goods_id not in (select sg.goods_id from han_stat_goods sg)'; $where = 'goods_id not in (select sg.goods_id from han_stat_goods sg)';
...@@ -368,9 +373,13 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -368,9 +373,13 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
} }
} }
} }
echo "\n";
if($result) { //商品报表更新成功 if($result) { //商品报表更新成功
file_put_contents($this->baseDir . \Our\PathConst::goodsStatTime, $endTime); file_put_contents($this->baseDir . \Our\PathConst::goodsStatTime, $endTime);
echo "upd goods succ";
} else {
echo "upd goods fail";
} }
return $result; return $result;
} }
...@@ -382,7 +391,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -382,7 +391,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* Time: 下午 6:19 * Time: 下午 6:19
*/ */
public function updateStatGoodsSell(){ public function updateStatGoodsSell(){
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, '');
$beginTime = file_get_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, TIMESTAMP); $beginTime = file_get_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, TIMESTAMP);
$beginTime = $beginTime ? $beginTime : ApiConst::zero; $beginTime = $beginTime ? $beginTime : ApiConst::zero;
$endTime = TIMESTAMP; $endTime = TIMESTAMP;
...@@ -419,8 +427,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -419,8 +427,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
} }
} }
if(!$result) { if(!$result) {
echo "\n";
echo 'upd sell fail';
$statGoodsDao->db->doRollback(); $statGoodsDao->db->doRollback();
} else { //商品报表更新成功 } else { //商品报表更新成功
echo "\n";
echo 'upd sell succ';
$statGoodsDao->db->doCommit(); $statGoodsDao->db->doCommit();
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, $endTime); file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, $endTime);
} }
......
...@@ -1257,6 +1257,7 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1257,6 +1257,7 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArray['add_time'] = TIMESTAMP; $refundArray['add_time'] = TIMESTAMP;
$refundArray['refund_type']=$refund['refundType']; $refundArray['refund_type']=$refund['refundType'];
$refundArray['refund_shipping_type']=isset($refund['refundShippingType'])?$refund['refundShippingType']:ApiConst::zero; $refundArray['refund_shipping_type']=isset($refund['refundShippingType'])?$refund['refundShippingType']:ApiConst::zero;
$refundArray['payment_type']=$orderInfo['paymentType'];
$refundArrayUnLine=Common::convertUnderline($refundArray); $refundArrayUnLine=Common::convertUnderline($refundArray);
$state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods); $state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods);
......
...@@ -76,7 +76,7 @@ class DeliveryServiceModel extends \Business\AbstractModel ...@@ -76,7 +76,7 @@ class DeliveryServiceModel extends \Business\AbstractModel
$qmDeliveryManLogData['distribution_fee'] =$data['distributionFee']; $qmDeliveryManLogData['distribution_fee'] =$data['distributionFee'];
$qmDeliveryManLogData['order_type'] = $data['orderType']; $qmDeliveryManLogData['order_type'] = $data['orderType'];
if($data['orderType']==ApiConst::orderTypeRefund){ if($data['orderType']==ApiConst::orderTypeRefund){
$qmDeliveryManLogData['shipping_fee']=$orderD['need_shipping_fee']; $qmDeliveryManLogData['shipping_fee']=$orderD['needShippingFee'];
}else{ }else{
$qmDeliveryManLogData['shipping_fee'] = $orderD['shippingFee']; $qmDeliveryManLogData['shipping_fee'] = $orderD['shippingFee'];
} }
......
...@@ -963,8 +963,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -963,8 +963,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
{ {
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName); $refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
// $storeMemberStatisticDao = \DAO\StoreMemberStatisticsModel::getInstance(DbNameConst::masterDBConnectName); // $storeMemberStatisticDao = \DAO\StoreMemberStatisticsModel::getInstance(DbNameConst::masterDBConnectName);
// $orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName); $orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
// $orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::masterDBConnectName); $orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::masterDBConnectName);
$gmtUpdate = file_get_contents($this->baseDir . PathConst::refundRetrunGmtUpdate); $gmtUpdate = file_get_contents($this->baseDir . PathConst::refundRetrunGmtUpdate);
$gmtUpdate = $gmtUpdate ? $gmtUpdate : ApiConst::zero; $gmtUpdate = $gmtUpdate ? $gmtUpdate : ApiConst::zero;
$this->taskIndex = PageConst::taskPageBegin; $this->taskIndex = PageConst::taskPageBegin;
...@@ -974,14 +974,28 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -974,14 +974,28 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$this->taskIndex++; $this->taskIndex++;
$refundReturns = isset($refundReturns['list']) ? $refundReturns['list'] : false; $refundReturns = isset($refundReturns['list']) ? $refundReturns['list'] : false;
$reduceDatasDistinct=array(); $reduceDatasDistinct=array();
if (!empty($refundReturns)) { if (!empty($refundReturns)) {
foreach ($refundReturns as $refundReturn) { foreach ($refundReturns as $refundReturn) {
$res = $orderGoodsDao->getCountByOrderId($refundReturn['orderId']);
if($res){
$refundReturnWhere['order_id']=$refundReturn['orderId'];
$refundReturnWhere['is_suc_refund']=ApiConst::refundSuccess;
$refundCount= $refundReturnDao->getCount($refundReturnWhere);
if($res==$refundCount){
$orderWhere['order_id']=$refundReturn['orderId'];
$updateData['is_effective']=ApiConst::notEffectiveAllRefund;
$orderDao->update($orderWhere,$updateData);
}
}
$key=$refundReturn['storeId'].'+'.$refundReturn['buyerId']; $key=$refundReturn['storeId'].'+'.$refundReturn['buyerId'];
$reduceDatasDistinct[$key]=$refundReturn; $reduceDatasDistinct[$key]=$refundReturn;
} }
} }
$this->insertStoreMemberStaticsDistinct($reduceDatasDistinct); $this->insertStoreMemberStaticsDistinct($reduceDatasDistinct);
} while ($refundReturns); } while ($refundReturns);
//$storeMemberStatisticDao->addAllReduce($refundReturns); //$storeMemberStatisticDao->addAllReduce($refundReturns);
file_put_contents($this->baseDir . PathConst::refundRetrunGmtUpdate, TIMESTAMP); file_put_contents($this->baseDir . PathConst::refundRetrunGmtUpdate, TIMESTAMP);
......
...@@ -213,14 +213,9 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -213,14 +213,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeMember['fav_type'] = \Our\ApiConst::one; $storeMember['fav_type'] = \Our\ApiConst::one;
$storeMembers[] = $storeMember; $storeMembers[] = $storeMember;
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance(); $favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$one = $favoritesStoreDao->getOne('store_id',array('store_id'=>$storeId,'member_id'=>$memberId,'fav_type'=>\Our\ApiConst::one,'fav_from'=>\Our\ApiConst::scanFavor),''); $result = $favoritesStoreDao->insertAll($storeMembers);
if(!$one) { if($result) {
$result = $favoritesStoreDao->insertAll($storeMembers); $favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
if($result) {
$favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
}
$favoritesDao = \DAO\FavoritesStoreModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$favoritesDao, 'getOne'),array(),array($memberId));
} }
}else{ }else{
......
...@@ -376,8 +376,6 @@ class MemberServiceModel extends \Business\AbstractModel ...@@ -376,8 +376,6 @@ class MemberServiceModel extends \Business\AbstractModel
return false; return false;
} }
$favoritesStoreDao->updateStoreCollecitonsCache($storeIds,$memberId,2); $favoritesStoreDao->updateStoreCollecitonsCache($storeIds,$memberId,2);
$favoritesDao = \DAO\FavoritesStoreModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$favoritesDao, 'getOne'),array(),array($memberId));
} }
} }
......
...@@ -205,6 +205,8 @@ class FavoritesStoreModel extends \DAO\AbstractModel { ...@@ -205,6 +205,8 @@ class FavoritesStoreModel extends \DAO\AbstractModel {
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getOne'),array(),array($memberId)); \Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getOne'),array(),array($memberId));
} }
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getFavoritesStores'),array(),array($memberId)); \Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getFavoritesStores'),array(),array($memberId));
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(), array(&$this, 'selectList'), array(),array($memberId));
//更新个人中心首页数量 //更新个人中心首页数量
\DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::storeCollection,$memberId,$type == 1 ? -(count($storeIds)) : count($storeIds)); \DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::storeCollection,$memberId,$type == 1 ? -(count($storeIds)) : count($storeIds));
return true; return true;
......
...@@ -492,9 +492,9 @@ class OrderModel extends \DAO\AbstractModel ...@@ -492,9 +492,9 @@ class OrderModel extends \DAO\AbstractModel
$where= $this->db->getSqlWhereByArray($where); $where= $this->db->getSqlWhereByArray($where);
} }
if($today){ if($today){
$refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId,$today); $refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId,$today,true);
}else{ }else{
$refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId); $refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId,false,true);
} }
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,order_amount as orderTotalOnline")->fetchOne(); $res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,order_amount as orderTotalOnline")->fetchOne();
if(!$res){ if(!$res){
......
...@@ -37,7 +37,16 @@ class OrderGoodsModel extends \DAO\AbstractModel ...@@ -37,7 +37,16 @@ class OrderGoodsModel extends \DAO\AbstractModel
{ {
} }
public function getCountByWhere($where){
$this->setDb($this->dbName);
$goodsCount = $this->db->select("count(*) as cou")->from($this->_tableName)->where($where)->fetchNum();
return $goodsCount?$goodsCount:ApiConst::zero;
}
public function getCountByOrderId($orderId){
$this->setDb($this->dbName);
$where['order_id']=$orderId;
return $this->getCountByWhere($where);
}
public function getOrderGoodsList($where, $field, $group = null, $limit = []) public function getOrderGoodsList($where, $field, $group = null, $limit = [])
{ {
$this->setDb(); $this->setDb();
......
...@@ -7,6 +7,7 @@ use Error\CodeConfigModel; ...@@ -7,6 +7,7 @@ use Error\CodeConfigModel;
use Error\ErrorModel; use Error\ErrorModel;
use OSS\Common; use OSS\Common;
use Our\ApiConst; use Our\ApiConst;
use Our\ArrayConst;
use Our\DbNameConst; use Our\DbNameConst;
use Our\DescribeConst; use Our\DescribeConst;
use Our\ImageConst; use Our\ImageConst;
...@@ -43,8 +44,8 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -43,8 +44,8 @@ class RefundReturnModel extends \DAO\AbstractModel
public function getCount($where) public function getCount($where)
{ {
$this->setDb(); $this->setDb($this->dbName);
return $this->db->from($this->_tableName)->where($where)->fetchNum(); return $this->db->from($this->_tableName)->where($where)->select()->fetchNum();
} }
public function getAll($where, $field, $db = DbNameConst::salveDBConnectName) public function getAll($where, $field, $db = DbNameConst::salveDBConnectName)
...@@ -55,13 +56,26 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -55,13 +56,26 @@ class RefundReturnModel extends \DAO\AbstractModel
} }
public function getRefundSuccessMoneyByStoreId($storeId, $beginTime = false, $endTime = false) public function getRefundSuccessMoneyByStoreId($storeId, $beginTime = false, $endTime = false,$online=false)
{ {
$this->setDb($this->dbName); $this->setDb($this->dbName);
if ($beginTime) { if ($beginTime) {
$where = \Our\Common::format(" store_id={0} and is_suc_refund={1} and gmt_update between {2} and {3}", $storeId, ApiConst::refundSuccess, $beginTime, $endTime); $where['store_id']=$storeId;
$where['is_suc_refund']=ApiConst::refundSuccess;
if($online){
$where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
}
$where['gmt_update']=array('between',$beginTime,$endTime);
} else { } else {
$where = \Our\Common::format(" store_id={0} and is_suc_refund={1}", $storeId, ApiConst::refundSuccess); $where['store_id']=$storeId;
$where['is_suc_refund']=ApiConst::refundSuccess;
if($online){
$where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
}
//$where = \Our\Common::format(" store_id={0} and is_suc_refund={1}", $storeId, ApiConst::refundSuccess);
}
if(is_array($where)){
$where = $this->db->getSqlWhereByArray($where);
} }
$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 !empty($res) ? $res : ApiConst::zero; return !empty($res) ? $res : ApiConst::zero;
...@@ -729,13 +743,13 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -729,13 +743,13 @@ class RefundReturnModel extends \DAO\AbstractModel
return $res?$res:array(); return $res?$res:array();
} }
public function getSumRefundAmountByStoreId($storeId,$today=false){ public function getSumRefundAmountByStoreId($storeId,$today=false,$isOnline=false){
$this->setDb($this->dbName); $this->setDb($this->dbName);
if($today){ if($today){
$todayBegin=\Our\Common::getTodayBeginTimpSpan(); $todayBegin=\Our\Common::getTodayBeginTimpSpan();
$res=$this->getRefundSuccessMoneyByStoreId($storeId,$todayBegin,TIMESTAMP); $res=$this->getRefundSuccessMoneyByStoreId($storeId,$todayBegin,TIMESTAMP,$isOnline);
}else{ }else{
$res=$this->getRefundSuccessMoneyByStoreId($storeId); $res=$this->getRefundSuccessMoneyByStoreId($storeId,false,false,$isOnline);
} }
return $res?$res:ApiConst::zero; return $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