Commit 8e6e1e28 authored by wwccw0591's avatar wwccw0591

pc

parent f1f35e2e
......@@ -118,6 +118,11 @@ class ArrayConst
'href'=>'',
'price'=>0
);
const orderCloseAndCancel=array(
0,
-1
);
//确认收货按钮0为未操作过,1为操作过,
const reachRemindButtons=array(
array(
......
......@@ -386,6 +386,20 @@ class OrderModel extends \DAO\AbstractModel
}
}
public function getFieldByWhere($where,$filed){
$this->setDb($this->dbName);
if(is_array($where)){
$where=$this->db->getSqlWhereByArray($where);
}
$res=$this->db->from($this->_tableName)->select($filed)->where($where)->fetchAll();
if($res){
$fie=array_column($res,$filed);
return $fie;
}else{
return [];
}
}
public function getSumAmountCountByMemberAndStoreId($storeIds,$memberIds)
{
$this->setDb($this->dbName);
......
......@@ -2,6 +2,7 @@
namespace DAO\Order;
use Our\ApiConst;
use Our\ArrayConst;
use Our\Common;
use Our\DbNameConst;
use Our\ImageConst;
......@@ -235,9 +236,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
public function getMemberStoreOrderGoodsCount($storeIds,$memberIds){
$this->setDb($this->dbName);
$orderDao=\DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$whereOrder['store_id']=array('in',$storeIds);
$whereOrder['buyer_id']=array('in',$memberIds);
$whereOrder['order_state']=array('notin',ArrayConst::orderCloseAndCancel);
$orderIds=$orderDao->getFieldByWhere($whereOrder,'order_id');
$where['store_id']=array('in',$storeIds);
$where['buyer_id']=array('in',$memberIds);
$where['is_refund']=array('neq',ApiConst::refundSuccess);
if($orderIds){
$where['order_id']=array('notin',$orderIds);
}
$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;
......
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