Commit dba8c7eb authored by wwccw0591's avatar wwccw0591

pc

parent 9fc60fc7
...@@ -499,19 +499,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -499,19 +499,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$memberIds=array_unique($memberId); $memberIds=array_unique($memberId);
$goodsNumCount=$orderGoodDao->getMemberStoreOrderGoodsCount($storeIds,$memberIds); $goodsNumCount=$orderGoodDao->getMemberStoreOrderGoodsCount($storeIds,$memberIds);
$ordersCount=$orderDao->getSumAmountCountByMemberAndStoreId($storeIds,$memberIds); $ordersCount=$orderDao->getSumAmountCountByMemberAndStoreId($storeIds,$memberIds);
$arr = array();
if(!empty($goodsNumCount)&&!empty($ordersCount)){
foreach($goodsNumCount as $k=>$r){
$arr[] = array_merge($r,$ordersCount[$k]);
}
$addDatas=$arr;
}else{
if(!empty($goodsNumCount)){
$addDatas=$goodsNumCount;
}else{
$addDatas=$goodsNumCount;
}
}
if(!empty($goodsNumCount)){ if(!empty($goodsNumCount)){
$storeMemberStatisticDao->addAll($goodsNumCount,'orderGoodsCount'); $storeMemberStatisticDao->addAll($goodsNumCount,'orderGoodsCount');
} }
......
...@@ -230,10 +230,17 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -230,10 +230,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
} }
public function getMemberStoreOrderGoodsCount($storeIds,$memberIds){ public function getMemberStoreOrderGoodsCount($storeIds,$memberIds){
$this->setDb($this->dbName); $this->setDb($this->dbName);
// if(is_array($storeIds)){
// $storeIds=implode(',',$storeIds);
// }
// if(is_array($memberIds)){
// $memberIds=implode($memberIds);
// }
$where['store_id']=array('in',$storeIds); $where['store_id']=array('in',$storeIds);
$where['buyer_id']=array('in',$memberIds); $where['buyer_id']=array('in',$memberIds);
$where['is_refund']=array('neq',ApiConst::one); $where['is_refund']=array('neq',ApiConst::one);
$res=$this->db->from($this->_tableName)->select($this->sumGoodsNum)->group("buyer_id")->group("store_id")->fetchAll(); $where=$this->db->getSqlWhereByArray($where);
$res=$this->db->from($this->_tableName)->select($this->sumGoodsNum)->where($where)->group("buyer_id")->group("store_id")->fetchAll();
return $res; return $res;
} }
......
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