Commit 189ccef8 authored by christ's avatar christ

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

parents 33fc6430 9d39dd70
...@@ -496,12 +496,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -496,12 +496,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$lng = $param['lng']; $lng = $param['lng'];
$lat = $param['lat']; $lat = $param['lat'];
} }
$in_store_service_flag=0; $storeInfo = \DAO\StoreModel::getInstance()->get($commonInfo['store_id'],false);
if($lng && $lat){ $in_store_service_flag = \DAO\StoreModel::getInstance()->checkAddressInServiceArea(array('lng'=>$lng,'lat'=>$lat),$storeInfo);
$location = array('lat'=>$lat,'lng'=>$lng);
$in_store_service = \Store\StoreUtil::getInstance()->checkAddressInServiceArea($location,$commonInfo['store_id']);
$in_store_service && $in_store_service_flag = 1;
}
//所在地 //所在地
$area = ''; $area = '';
if($commonInfo['areaid_1'] && $commonInfo['areaid_2']){ if($commonInfo['areaid_1'] && $commonInfo['areaid_2']){
...@@ -542,7 +538,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -542,7 +538,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId)); $productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId));
$html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>\Our\Common::getBaseUrl().'/index/goodsDetail?goodsCommonId='.$goodsCommonId); $html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>\Our\Common::getBaseUrl().'/index/goodsDetail?goodsCommonId='.$goodsCommonId);
if($commonInfo['is_del'] == 1) $commonInfo['goods_state'] = 0; if($commonInfo['is_del'] == 1 || $commonInfo['goods_state'] == 10) $commonInfo['goods_state'] = 0;
unset($attrs['commonInfo']); unset($attrs['commonInfo']);
return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url'],'subheading'=>$commonInfo['goods_jingle'],'inStoreService'=>$in_store_service_flag),$attrs); return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url'],'subheading'=>$commonInfo['goods_jingle'],'inStoreService'=>$in_store_service_flag),$attrs);
} }
......
...@@ -38,12 +38,14 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -38,12 +38,14 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$lng = $param['lng']; $lng = $param['lng'];
$lat = $param['lat']; $lat = $param['lat'];
} }
$in_store_service_flag=0; // $in_store_service_flag=0;
if($lng && $lat){ // if($lng && $lat){
$location = array('lat'=>$lat,'lng'=>$lng); // $location = array('lat'=>$lat,'lng'=>$lng);
$in_store_service = \Store\StoreUtil::getInstance()->checkAddressInServiceArea($location,$data['store_id']); // $in_store_service = \Store\StoreUtil::getInstance()->checkAddressInServiceArea($location,$data['store_id']);
$in_store_service && $in_store_service_flag = 1; // $in_store_service && $in_store_service_flag = 1;
} // }
$storeInfo = \DAO\StoreModel::getInstance()->get($data['store_id'],false);
$in_store_service_flag = \DAO\StoreModel::getInstance()->checkAddressInServiceArea(array('lng'=>$lng,'lat'=>$lat),$storeInfo);
$data['inStoreService'] = $in_store_service_flag; $data['inStoreService'] = $in_store_service_flag;
$data['state'] = \Our\ApiConst::cartGoodsOnline; $data['state'] = \Our\ApiConst::cartGoodsOnline;
......
...@@ -271,10 +271,10 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -271,10 +271,10 @@ class GoodsModel extends \DAO\AbstractModel {
} }
if($fromCart){ if($fromCart){
$sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$goodsCommonIds)); $sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$goodsCommonIds));
$field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify,is_transport,transport_id,gc_id,gc_id_1,gc_id_2,gc_id_3,snapshot_id,goods_image,goods_freight,goods_free,delivery_template_id'; $field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify,is_transport,transport_id,gc_id,gc_id_1,gc_id_2,gc_id_3,snapshot_id,goods_image,goods_freight,goods_free,delivery_template_id,is_del';
}else if($noRedisGoodsCommonIds){ }else if($noRedisGoodsCommonIds){
$sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$noRedisGoodsCommonIds)); $sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$noRedisGoodsCommonIds));
$field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify'; $field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify,is_del';
} }
if($sql&&$field){ if($sql&&$field){
$goodsArray = $this->getList($sql,$field); $goodsArray = $this->getList($sql,$field);
...@@ -294,7 +294,7 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -294,7 +294,7 @@ class GoodsModel extends \DAO\AbstractModel {
foreach($goodsCommonList[$goodsCommonId] as $goodsId){ foreach($goodsCommonList[$goodsCommonId] as $goodsId){
$goods = $goodsList[$goodsId]; $goods = $goodsList[$goodsId];
$data = array('goodsStorage'=>$goods['goods_storage']); $data = array('goodsStorage'=>$goods['goods_storage']);
if($goods['goods_state']==\Our\ApiConst::onlineGoodsState&&$goods['goods_verify']==\Our\ApiConst::onlineGoodsVerify){ if($goods['goods_state']==\Our\ApiConst::onlineGoodsState&&$goods['goods_verify']==\Our\ApiConst::onlineGoodsVerify&&$goods['is_del']==\Our\ApiConst::zero){
$data['onlineFlag'] = \Our\ApiConst::one; $data['onlineFlag'] = \Our\ApiConst::one;
}else{ }else{
$data['onlineFlag'] = \Our\ApiConst::zero; $data['onlineFlag'] = \Our\ApiConst::zero;
......
...@@ -178,7 +178,8 @@ class StoreModel extends \DAO\AbstractModel ...@@ -178,7 +178,8 @@ class StoreModel extends \DAO\AbstractModel
public function getOnlineStores($where = null, $field = '*', $limit = []) public function getOnlineStores($where = null, $field = '*', $limit = [])
{ {
$conditionSql = 'store_state =1 and open_flag =1 and (store_end_time >=' . TIMESTAMP . ' or store_end_time =0 ) '; //$conditionSql = 'store_state =1 and open_flag =1 and (store_end_time >=' . TIMESTAMP . ' or store_end_time =0 ) ';
$conditionSql = 'store_state =1 and open_flag =1 ';
if ($where) { if ($where) {
$conditionSql = $where . ' and ' . $conditionSql; $conditionSql = $where . ' and ' . $conditionSql;
} }
...@@ -424,12 +425,12 @@ class StoreModel extends \DAO\AbstractModel ...@@ -424,12 +425,12 @@ class StoreModel extends \DAO\AbstractModel
public function checkAddressInServiceArea($address, $store) public function checkAddressInServiceArea($address, $store)
{ {
$inAreaFlag = \Our\ApiConst::zero; $inAreaFlag = \Our\ApiConst::zero;
if ($store['buyer_distribution'] || $store['express_distribution']) {//如果店铺开启了到店自提和快递配送,则认为存在可用配送方式 if ($store['express_distribution']) {//如果店铺开启了到店自提和快递配送,则认为存在可用配送方式
$inAreaFlag = \Our\ApiConst::one; $inAreaFlag = \Our\ApiConst::one;
return $inAreaFlag; return $inAreaFlag;
} }
if ($store['seller_distribution'] && $address) { if ($store['seller_distribution'] && $address) {
$result = \Store\StoreUtil::getInstance()->checkAddressInServiceArea(array('lng' => $address['lng'], 'lat' => $address['lat']), $store['store_id']); $result = \Store\StoreUtil::getInstance()->checkAddressInServiceAreaByStore(array('lng' => $address['lng'], 'lat' => $address['lat']),$store);
if ($result) { if ($result) {
$inAreaFlag = \Our\ApiConst::one; $inAreaFlag = \Our\ApiConst::one;
} }
......
...@@ -179,7 +179,7 @@ class CodeConfigModel ...@@ -179,7 +179,7 @@ class CodeConfigModel
const editCartUploadCartFailed = 50042; const editCartUploadCartFailed = 50042;
const wrongAddCartForSelfStore = 50043; const wrongAddCartForSelfStore = 50043;
const pbundingGoodsCannotMoveToFavouites = 50044; const pbundingGoodsCannotMoveToFavouites = 50044;
const wrongGoodsForEditGoods = 50045;
//订单相关错误码 //订单相关错误码
const orderNotExist = 30001; const orderNotExist = 30001;
...@@ -607,6 +607,7 @@ class CodeConfigModel ...@@ -607,6 +607,7 @@ class CodeConfigModel
self::editCartUploadCartFailed => '编辑购物车更新购物车时间失败', self::editCartUploadCartFailed => '编辑购物车更新购物车时间失败',
self::wrongAddCartForSelfStore => '店主不能添加自己店铺的商品到购物车', self::wrongAddCartForSelfStore => '店主不能添加自己店铺的商品到购物车',
self::pbundingGoodsCannotMoveToFavouites => '组合商品暂不支持移入收藏夹', self::pbundingGoodsCannotMoveToFavouites => '组合商品暂不支持移入收藏夹',
self::wrongGoodsForEditGoods => '编辑的商品错误',
self::addressNotExist => '地址不存在', self::addressNotExist => '地址不存在',
self::emptyAddressId => '地址主键参数不能为空', self::emptyAddressId => '地址主键参数不能为空',
......
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