Commit 51e8932d authored by liuyuzhen's avatar liuyuzhen

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

parents 31fcf7f8 e09c9756
...@@ -53,6 +53,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -53,6 +53,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
// $storeStatisticsDao = \DAO\StoreStatisticsModel::getInstance(); // $storeStatisticsDao = \DAO\StoreStatisticsModel::getInstance();
$orderDao=\DAO\Order\OrderModel::getInstance(); $orderDao=\DAO\Order\OrderModel::getInstance();
$favoritesStoreDao=\DAO\FavoritesStoreModel::getInstance(); $favoritesStoreDao=\DAO\FavoritesStoreModel::getInstance();
$orderGoodsDao=\DAO\Order\OrderGoodsModel::getInstance();
$goodsCount=\Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsCountByStoreId'), array($storeId), ApiConst::tenDaySecond, array($storeId));
$condition['store_id'] = $storeId; $condition['store_id'] = $storeId;
//获取店铺信息 //获取店铺信息
$store = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this->storeDao, 'getInfo'), array($condition), ApiConst::tenDaySecond, array($storeId)); $store = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this->storeDao, 'getInfo'), array($condition), ApiConst::tenDaySecond, array($storeId));
...@@ -64,7 +66,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -64,7 +66,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$data['storeId'] = $store['store_id']; $data['storeId'] = $store['store_id'];
$data['storeName'] = $store['store_name']; $data['storeName'] = $store['store_name'];
$data['storeLabel'] = $store['store_label']; $data['storeLabel'] = $store['store_label'];
$data['goodsCount'] = ApiConst::zero; $data['goodsCount'] = $goodsCount;
$data['orderCount'] =$storeStats['orderCount']; $data['orderCount'] =$storeStats['orderCount'];
$data['orderTotal'] = $storeStats['orderTotal']; $data['orderTotal'] = $storeStats['orderTotal'];
$data['favCount'] = $storeFavariteCount['favCount']; $data['favCount'] = $storeFavariteCount['favCount'];
......
...@@ -800,7 +800,10 @@ class OrderModel extends \DAO\AbstractModel ...@@ -800,7 +800,10 @@ class OrderModel extends \DAO\AbstractModel
if ($deleteGetFavoritesCountByStoreId) { if ($deleteGetFavoritesCountByStoreId) {
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance(); $favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$favoritesStoreDao->deleteGetFavoritesCountByStoreId($stroeId); $favoritesStoreDao->deleteGetFavoritesCountByStoreId($stroeId);
} }
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoodsDao->deleteOrderGoodsCache($memberId, $orderId,$stroeId);
} }
if(!empty($diliverymanId)){ if(!empty($diliverymanId)){
......
...@@ -28,6 +28,7 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -28,6 +28,7 @@ class OrderGoodsModel extends \DAO\AbstractModel {
*/ */
protected $_primaryKey = 'rec_id'; protected $_primaryKey = 'rec_id';
public $orderGoodsGoodsNumCountField=" sum(goods_num) as goodsNum";
public function init(){ public function init(){
...@@ -57,10 +58,16 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -57,10 +58,16 @@ class OrderGoodsModel extends \DAO\AbstractModel {
} }
public function getOrderGoods($where,$field,$db=DbNameConst::salveDBConnectName){ public function getOrderGoods($where,$field,$db=DbNameConst::salveDBConnectName){
$this->setDb($db); $this->setDb($this->dbName);
$list = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll(); $list = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
return $list; return $list;
} }
public function getOrderGoodsCountByStoreId($storeId){
$this->setDb($this->dbName);
$where['storeId']=$storeId;
$goodsCount = $this->db->select($this->orderGoodsGoodsNumCountField)->from($this->_tableName)->where($where)->fetchNum();
return $goodsCount;
}
/** /**
* 获取单条数据 * 获取单条数据
* @param $where * @param $where
...@@ -100,13 +107,16 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -100,13 +107,16 @@ class OrderGoodsModel extends \DAO\AbstractModel {
return $this->getOrderGoods($where,$field); return $this->getOrderGoods($where,$field);
} }
public function deleteOrderGoodsCache($memberId,$orderIds){ public function deleteOrderGoodsCache($memberId,$orderIds,$storeId=false){
if($memberId){ if($memberId){
return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsByOrderIds'), array($memberId)); return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsByOrderIds'), array($memberId));
} }
if($orderIds){ if($orderIds){
return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsByOrderIds'), array($orderIds)); return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsByOrderIds'), array($orderIds));
} }
if(!empty($storeId)){
return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsCountByStoreId'), array($storeId));
}
} }
public function getIsRefundMoney($orderGoodses,$promotionsId){ public function getIsRefundMoney($orderGoodses,$promotionsId){
$isRefundMoney=ApiConst::zero; $isRefundMoney=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