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
// $storeStatisticsDao = \DAO\StoreStatisticsModel::getInstance();
$orderDao=\DAO\Order\OrderModel::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;
//获取店铺信息
$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
$data['storeId'] = $store['store_id'];
$data['storeName'] = $store['store_name'];
$data['storeLabel'] = $store['store_label'];
$data['goodsCount'] = ApiConst::zero;
$data['goodsCount'] = $goodsCount;
$data['orderCount'] =$storeStats['orderCount'];
$data['orderTotal'] = $storeStats['orderTotal'];
$data['favCount'] = $storeFavariteCount['favCount'];
......
......@@ -800,7 +800,10 @@ class OrderModel extends \DAO\AbstractModel
if ($deleteGetFavoritesCountByStoreId) {
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$favoritesStoreDao->deleteGetFavoritesCountByStoreId($stroeId);
}
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoodsDao->deleteOrderGoodsCache($memberId, $orderId,$stroeId);
}
if(!empty($diliverymanId)){
......
......@@ -28,6 +28,7 @@ class OrderGoodsModel extends \DAO\AbstractModel {
*/
protected $_primaryKey = 'rec_id';
public $orderGoodsGoodsNumCountField=" sum(goods_num) as goodsNum";
public function init(){
......@@ -57,10 +58,16 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
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();
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
......@@ -100,13 +107,16 @@ class OrderGoodsModel extends \DAO\AbstractModel {
return $this->getOrderGoods($where,$field);
}
public function deleteOrderGoodsCache($memberId,$orderIds){
public function deleteOrderGoodsCache($memberId,$orderIds,$storeId=false){
if($memberId){
return \Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$this, 'getOrderGoodsByOrderIds'), array($memberId));
}
if($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){
$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