Commit 9cd06a48 authored by wwccw0591's avatar wwccw0591

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

parents 1926e9cd 40acfd02
...@@ -83,7 +83,8 @@ class MemberController extends \Our\Controller_AbstractApi { ...@@ -83,7 +83,8 @@ class MemberController extends \Our\Controller_AbstractApi {
* @throws Exception * @throws Exception
*/ */
public function logOutAction(){ public function logOutAction(){
$result = $this->memberService->logOut($this->key); $key = $this->req[\Our\NameConst::data]['key'];
$result = $this->memberService->logOut($key);
if($result){ if($result){
$this->success(new stdClass()); $this->success(new stdClass());
} }
......
...@@ -104,5 +104,9 @@ class ImageConst{ ...@@ -104,5 +104,9 @@ class ImageConst{
const storeQualificationImg = 188; const storeQualificationImg = 188;
const storeCollectionImg = 112; const storeCollectionImg = 112;
const homeIndexHotGoodsImageSize =250; const homeIndexHotGoodsImageSize =250;
const goodsStoreImg = 100; //商品详情页的店铺头像
const goodsGroupImg = 182;//商品/组合详情页的其他搭配图片
const groupGoodsImg = 160; //组合详情页的搭配商品
const storeGroupImg = 186; //店铺促销
const storeGroupGoodsImg = 130;
} }
...@@ -126,10 +126,17 @@ class ImageUtil { ...@@ -126,10 +126,17 @@ class ImageUtil {
//$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334'; //$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
} }
$goodsImg = \Our\Common::getStaticFile($goodsImg,$directory); $goodsImg = \Our\Common::getStaticFile($goodsImg,$directory);
if($width > 0) {
$goodsImg .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}"; $goodsImg .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}";
}
return $goodsImg; return $goodsImg;
} }
public function getGoodsImgWithUrl($goodsImgUrl,$width=\Our\ImageConst::goodsListImgSize, $height = 0) {
$width = $width * \Our\ImageConst::sizeScale;
$height ? $height = $height * \Our\ImageConst::sizeScale : $height = $width;
$goodsImgUrl .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}";
return $goodsImgUrl;
}
public static function getTopClassAdvImageUrl($gcId){ public static function getTopClassAdvImageUrl($gcId){
$fileName = \Our\ImageConst::topClassAdvImagePrefis.$gcId.\Our\NameConst::jpgSuffix; $fileName = \Our\ImageConst::topClassAdvImagePrefis.$gcId.\Our\NameConst::jpgSuffix;
$gcImageUrl = \Our\Common::getStaticFile($fileName,\Our\ImageConst::defaultPath); $gcImageUrl = \Our\Common::getStaticFile($fileName,\Our\ImageConst::defaultPath);
......
...@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonInstance = \DAO\GoodsCommonModel::getInstance(); $commonInstance = \DAO\GoodsCommonModel::getInstance();
$count = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonInstance, 'getCount'),array(array('store_id'=>$storeId)),\Our\ApiConst::oneDaySecond); $count = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonInstance, 'getCount'),array(array('store_id'=>$storeId)),\Our\ApiConst::oneDaySecond);
return array('storeId'=>$storeId,'storeName'=>$storeInfo['store_name'],'storeLabel'=>$label,'goodsTotal'=>$count,'isQuality'=>$storeInfo['store_zhping'],'freeShippingPrice'=>$storeInfo['free_shipping_price'],'shareDesc'=>$storeInfo['store_share_desc']); return array('storeId'=>$storeId,'storeName'=>$storeInfo['store_name'],'storeLabel'=>\DAO\StoreModel::getInstance()->getStoreLabelSrc($storeInfo['store_label'],\Our\ImageConst::goodsStoreImg),'goodsTotal'=>$count,'isQuality'=>$storeInfo['store_zhping'],'freeShippingPrice'=>$storeInfo['free_shipping_price'],'shareDesc'=>$storeInfo['store_share_desc']);
} }
/** /**
...@@ -1057,7 +1057,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -1057,7 +1057,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
} }
public function checkRemoveOnlineGoodsClass($goodsClass){ public function checkRemoveOnlineGoodsClass($goodsClass){
$goodsCommonDao = \DAO\GoodsCommonModel::getInstance();
$storeOnlineGoodsClassDao = \DAO\GoodsClass\StoreOnlineGoodsClassModel::getInstance();
if($goodsClass){
$gcFrom = $goodsClass['gc_from'];
$where['gc_id_1'] = $goodsClass['gc_id_1'];
$where['gc_id_2'] = $goodsClass['gc_id_2'];
$where['gc_id_3'] = $goodsClass['gc_id_3'];
$where['store_id'] = $goodsClass['store_id'];
$where['goods_state'] = \Our\ApiConst::onlineGoodsState;
$where['goods_verify'] = \Our\ApiConst::onlineGoodsVerify;
if($gcFrom==\Our\ApiConst::one){
$where['goods_class_t_id'] = $goodsClass['gc_id_3'];
}
$tempOne = $goodsCommonDao->getOne($where,'goods_commonid');
if(!$tempOne){
$storeOnlineGoodsClassDao->del($goodsClass);
}
}
} }
private static $_instance = null; private static $_instance = null;
......
...@@ -44,12 +44,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -44,12 +44,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data['image'] = []; $data['image'] = [];
if($blImg = unserialize($data['bl_image'])){ if($blImg = unserialize($data['bl_image'])){
foreach ($blImg as $v){ foreach ($blImg as $v){
if($v) {
$data['image'][] = \Our\ImageUtil::getGoodsImgUrl($v,\Our\ImageConst::goodsDetailImgSize); $data['image'][] = \Our\ImageUtil::getGoodsImgUrl($v,\Our\ImageConst::goodsDetailImgSize);
} }
} }
}
$data['goods'] = []; $data['goods'] = [];
if($data['goodsList'] && is_array($data['goodsList'])){ if($data['goodsList'] && is_array($data['goodsList'])){
foreach ($data['goodsList'] as $v){ foreach ($data['goodsList'] as $v){
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgWithUrl($v['goodsImage'],\Our\ImageConst::groupGoodsImg);
unset($v['goods_id']); unset($v['goods_id']);
unset($v['goodsStorage']); unset($v['goodsStorage']);
unset($v['goodsAttr']); unset($v['goodsAttr']);
...@@ -227,7 +230,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -227,7 +230,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if($groupList){ if($groupList){
foreach ($groupList as $k=>$v){ foreach ($groupList as $k=>$v){
$v['groupId'] = $v['blId']; $v['groupId'] = $v['blId'];
$v['image'] = ImageUtil::getGoodsImgUrl($v['image']); $v['image'] = ImageUtil::getGoodsImgUrl($v['image'],\our\ImageConst::goodsGroupImg);
unset($v['goodsList']); unset($v['goodsList']);
unset($v['bl_title']); unset($v['bl_title']);
unset($v['store_id']); unset($v['store_id']);
...@@ -295,7 +298,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -295,7 +298,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach ($group as $k=>$v){ foreach ($group as $k=>$v){
if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){ if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){
$v['groupId'] = $v['blId']; $v['groupId'] = $v['blId'];
$v['image'] = ImageUtil::getGoodsImgUrl($v['image']); $v['image'] = ImageUtil::getGoodsImgUrl($v['image'],\Our\ImageConst::goodsGroupImg);
unset($v['goodsList']); unset($v['goodsList']);
unset($v['bl_title']); unset($v['bl_title']);
unset($v['store_id']); unset($v['store_id']);
...@@ -346,7 +349,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -346,7 +349,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach ($groupList as $k=>$v){ foreach ($groupList as $k=>$v){
if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){ if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){
$v['groupId'] = $v['blId']; $v['groupId'] = $v['blId'];
$v['image'] = ImageUtil::getGoodsImgUrl($v['image']); $v['image'] = ImageUtil::getGoodsImgUrl($v['image'],\Our\ImageConst::storeGroupImg);
unset($v['bl_title']); unset($v['bl_title']);
unset($v['store_id']); unset($v['store_id']);
unset($v['store_name']); unset($v['store_name']);
...@@ -365,6 +368,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -365,6 +368,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods = []; $goods = [];
if($v['goodsList']){ if($v['goodsList']){
foreach ($v['goodsList'] as $v2){ foreach ($v['goodsList'] as $v2){
$v2['goodsImage'] = ImageUtil::getGoodsImgWithUrl($v2['goodsImage'],\our\ImageConst::storeGroupGoodsImg);
unset($v2['goods_id']); unset($v2['goods_id']);
unset($v2['goodsStorage']); unset($v2['goodsStorage']);
unset($v2['bl_id']); unset($v2['bl_id']);
...@@ -469,7 +473,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -469,7 +473,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods_temp = array_merge($goods,$goodsArray[$goods['goods_id']]); $goods_temp = array_merge($goods,$goodsArray[$goods['goods_id']]);
$blSumPrice += $goods_temp['goodsPrice']*$goods_temp['num']; $blSumPrice += $goods_temp['goodsPrice']*$goods_temp['num'];
$goods_temp['goodsAttr'] = $goodsDao->getFormatGoodsAttr($goods_temp['goods_spec']); $goods_temp['goodsAttr'] = $goodsDao->getFormatGoodsAttr($goods_temp['goods_spec']);
$goods_temp['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goods_temp['goods_image']); $goods_temp['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goods_temp['goods_image'], 0);
//unset($goods_temp['goods_spec']); //unset($goods_temp['goods_spec']);
//unset($goods_temp['goods_image']); //unset($goods_temp['goods_image']);
//unset($goods_temp['bl_id']); //unset($goods_temp['bl_id']);
......
...@@ -209,9 +209,7 @@ class MemberServiceModel extends \Business\AbstractModel ...@@ -209,9 +209,7 @@ class MemberServiceModel extends \Business\AbstractModel
* 退出登录 * 退出登录
*/ */
public function logOut($key){ public function logOut($key){
$this->memberDb0Redis->tableDel($key); $this->clearKey($key);
$sess=\Yaf\Session::getInstance();
$sess->del('member_id');
return true; return true;
} }
......
...@@ -44,6 +44,16 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{ ...@@ -44,6 +44,16 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{
return $result ; return $result ;
} }
public function del($where){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$temp = $this->findByWhere($where);
$result = $this->db->delete($this->_tableName)->where($where)->execute();
return $result;
}
public function getList($where,$field = \Our\NameConst::allField){ public function getList($where,$field = \Our\NameConst::allField){
$this->setDb($this->dbName); $this->setDb($this->dbName);
$result = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll(); $result = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
......
...@@ -30,6 +30,10 @@ class GoodsCommonModel extends \DAO\AbstractModel { ...@@ -30,6 +30,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
return $this->db->select($field)->from($this->_tableName)->where(array('goods_commonid'=>$goodsCommonId))->fetchOne(); return $this->db->select($field)->from($this->_tableName)->where(array('goods_commonid'=>$goodsCommonId))->fetchOne();
} }
public function getOne($where,$field = \Our\NameConst::allField){
$this->setDb($this->dbName);
return $this->db->select($field)->from($this->_tableName)->where($where)->fetchOne();
}
public function getGoodsSaleNumFromCache($goodsCommonId){ public function getGoodsSaleNumFromCache($goodsCommonId){
$goodsCommonRedis = \Redis\Db4\GoodsCommonRedisModel::getInstance(); $goodsCommonRedis = \Redis\Db4\GoodsCommonRedisModel::getInstance();
$onlineGoodsCommonSaleNumKey = \Our\NameConst::onlineGoodsCommonSaleNumPrefix; $onlineGoodsCommonSaleNumKey = \Our\NameConst::onlineGoodsCommonSaleNumPrefix;
......
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