Commit d1716b73 authored by zhz's avatar zhz

goods

parent 36e32176
......@@ -123,7 +123,7 @@ class IndexController extends \Our\Controller_Abstract {
$goodsCommonId=(int)$this->getRequest()->getQuery()['goodsCommonId'];
if($goodsCommonId > 0) {
$commonGoodsInstance = \DAO\GoodsCommonModel::getInstance();
$commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonGoodsInstance, 'getOneById'),array($goodsCommonId),0,array($goodsCommonId));
$commonInfo = $commonGoodsInstance->getOneByIdCache($goodsCommonId);
}
$this->_view->assign('commonInfo',$commonInfo);
}
......
......@@ -24,7 +24,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyCommonId);
}
$commonGoodsInstance = \DAO\GoodsCommonModel::getInstance();
$commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonGoodsInstance, 'getOneById'),array($goodsCommonId),0,array($goodsCommonId));
$commonInfo = $this->getOneByIdCache($goodsCommonId);
$saleNum = $commonGoodsInstance->getGoodsSaleNumFromCache($goodsCommonId);
$commonInfo['sale_num'] = $saleNum;
if(!$commonInfo){
......@@ -1060,7 +1060,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
public function getRealPriceByGoodsCommonId($goodsCommon,$memberId = null,$activities = null){
if(!is_array($goodsCommon)){
$commonGoodsInstance = \DAO\GoodsCommonModel::getInstance();
$goodsCommon = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonGoodsInstance, 'getOneById'),array($goodsCommon),0,array($goodsCommon));
$goodsCommon = $commonGoodsInstance->getOneByIdCache($goodsCommon);
}
$storeId = $goodsCommon['store_id'];
//该用户是否有参加这个店铺销售活动
......
......@@ -146,10 +146,12 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeDetailImg = unserialize($storeInfo['store_detail_image']);
if($storeDetailImg && is_array($storeDetailImg)){
foreach ($storeDetailImg as $v){
if($v) {
$detailImg[] = \DAO\StoreModel::getInstance()->getStoreLabelSrc($v, \Our\ImageConst::storeQualificationImg);
}
}
}
}
//地址
$address = '';
if($storeInfo['area_info']){
......
......@@ -29,7 +29,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
$this->setDb($this->dbName);
return $this->db->select($field)->from($this->_tableName)->where(array('goods_commonid'=>$goodsCommonId))->fetchOne();
}
public function getOneByIdCache($goodsCommonId) {
$commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$this, 'getOneById'),array($goodsCommonId),0,array($goodsCommonId));
return $commonInfo;
}
public function getOne($where,$field = \Our\NameConst::allField){
$this->setDb($this->dbName);
if(is_array($where)){
......
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