Commit 73a2ac70 authored by wwccw0591's avatar wwccw0591

pc

parent b67de8dc
......@@ -383,10 +383,17 @@ class OrderModel extends \DAO\AbstractModel
public function getSumAmountCountByMemberAndStoreId($storeIds,$memberIds)
{
$this->setDb($this->dbName);
$where['store_id']=array('in',$storeIds);
$where['member_ids']=array('in',$memberIds);
$where['order_state']=array('notin','-1,0');
$where=getSqlWhereByArray($where);
if(is_array($storeIds)){
$storeIds=implode(',',$storeIds);
}
if(is_array($memberIds)){
$memberIds=implode(',',$memberIds);
}
$where=Common::format(" store_id in({0}) and buyer_id in({1}) and order_state not in({2})",$storeIds,$memberIds,'-1,0');
// $where['store_id']=array('in',$storeIds);
// $where['buyer_id']=array('in',$memberIds);
// $where['order_state']=array('notin','-1,0');
// $where=$this->db->getSqlWhereByArray($where);
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(order_amount)-SUM(refund_amount)) AS orderTotal")->group('buyer_id')->group('store_id')->fetchAll();
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