Commit 17d7adab authored by wwccw0591's avatar wwccw0591

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

parents 622a6f46 d02df1a5
...@@ -240,6 +240,9 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -240,6 +240,9 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($validReturnData as $goods){ foreach($validReturnData as $goods){
$newCart = array(); $newCart = array();
$store = $storeDao->get($goods['store_id'],false); $store = $storeDao->get($goods['store_id'],false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongAddCartForSelfStore);
}
if(!($storeIds&&in_array($goods['store_id'],$storeIds))){ if(!($storeIds&&in_array($goods['store_id'],$storeIds))){
$storeIds[]=$goods['store_id']; $storeIds[]=$goods['store_id'];
} }
...@@ -263,6 +266,9 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -263,6 +266,9 @@ class CartServiceModel extends \Business\AbstractModel{
}else{ }else{
$goods = $validReturnData; $goods = $validReturnData;
$store = $storeDao->get($goods['store_id'],false); $store = $storeDao->get($goods['store_id'],false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongAddCartForSelfStore);
}
$storeIds[]=$goods['store_id']; $storeIds[]=$goods['store_id'];
$newCart['store_id'] = $goods['store_id']; $newCart['store_id'] = $goods['store_id'];
$newCart['goods_id'] = $goods['goods_id']; $newCart['goods_id'] = $goods['goods_id'];
...@@ -291,6 +297,9 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -291,6 +297,9 @@ class CartServiceModel extends \Business\AbstractModel{
public function getPBundlingGoodsCartData($blNum,$memberId,$pBundling){ public function getPBundlingGoodsCartData($blNum,$memberId,$pBundling){
$storeDao = \DAO\StoreModel::getInstance(\Our\DbNameConst::masterDBConnectName); $storeDao = \DAO\StoreModel::getInstance(\Our\DbNameConst::masterDBConnectName);
$store = $storeDao->get($pBundling['store_id'],false); $store = $storeDao->get($pBundling['store_id'],false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongAddCartForSelfStore);
}
$newCart['store_id'] = $pBundling['store_id']; $newCart['store_id'] = $pBundling['store_id'];
$newCart['goods_id'] = $pBundling['blId']; $newCart['goods_id'] = $pBundling['blId'];
$newCart['goods_commonid'] = \Our\ApiConst::zero; $newCart['goods_commonid'] = \Our\ApiConst::zero;
......
...@@ -757,6 +757,9 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -757,6 +757,9 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
} }
if(isset($storeCarts)&&count($storeCarts)>\Our\ApiConst::zero){ if(isset($storeCarts)&&count($storeCarts)>\Our\ApiConst::zero){
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::selfGoodsForStoreOrder);
}
$temp['storeName'] = $store['store_name']; $temp['storeName'] = $store['store_name'];
$temp['storeId'] = $storeId; $temp['storeId'] = $storeId;
$temp['storeCarts'] = $storeCarts; $temp['storeCarts'] = $storeCarts;
...@@ -790,6 +793,10 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -790,6 +793,10 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$cartRedis->update($memberStoreCartsKey,$temp,\Our\ApiConst::oneHour);*/ $cartRedis->update($memberStoreCartsKey,$temp,\Our\ApiConst::oneHour);*/
} }
}else{ }else{
$store = $storeDao->get($storeId,false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::selfGoodsForStoreOrder);
}
$result[$storeId]=$returnStoreCartsObj['storeCarts']; $result[$storeId]=$returnStoreCartsObj['storeCarts'];
} }
} }
...@@ -954,6 +961,9 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -954,6 +961,9 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
} }
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
if($store['member_id']==$memberId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::selfGoodsForStoreOrder);
}
$tempObj['goodsMid'] = $store['member_id']; $tempObj['goodsMid'] = $store['member_id'];
$storeCarts[] = $tempObj; $storeCarts[] = $tempObj;
$temp['goodsFreight'] = $goodsFreight; $temp['goodsFreight'] = $goodsFreight;
......
...@@ -167,6 +167,7 @@ class CodeConfigModel { ...@@ -167,6 +167,7 @@ class CodeConfigModel {
const pBundlingNoStorageForOrder = 50040; const pBundlingNoStorageForOrder = 50040;
const editDelCartFailed = 50041; const editDelCartFailed = 50041;
const editCartUploadCartFailed = 50042; const editCartUploadCartFailed = 50042;
const wrongAddCartForSelfStore = 50043;
//订单相关错误码 //订单相关错误码
...@@ -283,6 +284,8 @@ class CodeConfigModel { ...@@ -283,6 +284,8 @@ class CodeConfigModel {
const noEnoughStorageForBundlingGoods = 30118; const noEnoughStorageForBundlingGoods = 30118;
const noOrderWaitToPay = 30119; const noOrderWaitToPay = 30119;
const wrongEvaluation = 30120; const wrongEvaluation = 30120;
const selfGoodsForStoreOrder = 30121;
//店铺相关错误码 //店铺相关错误码
//商品分类 //商品分类
...@@ -563,6 +566,7 @@ class CodeConfigModel { ...@@ -563,6 +566,7 @@ class CodeConfigModel {
self::pBundlingNoStorageForOrder => '组合销售商品库存不足', self::pBundlingNoStorageForOrder => '组合销售商品库存不足',
self::editDelCartFailed => '编辑购物车时删除数据失败', self::editDelCartFailed => '编辑购物车时删除数据失败',
self::editCartUploadCartFailed => '编辑购物车更新购物车时间失败', self::editCartUploadCartFailed => '编辑购物车更新购物车时间失败',
self::wrongAddCartForSelfStore => '店主不能添加自己店铺的商品到购物车',
self::addressNotExist=>'地址不存在', self::addressNotExist=>'地址不存在',
self::emptyAddressId=>'地址主键参数不能为空', self::emptyAddressId=>'地址主键参数不能为空',
...@@ -760,6 +764,7 @@ class CodeConfigModel { ...@@ -760,6 +764,7 @@ class CodeConfigModel {
self::noEnoughStorageForBundlingGoods =>'组合销售库存紧张,您购买的数量太多啦', self::noEnoughStorageForBundlingGoods =>'组合销售库存紧张,您购买的数量太多啦',
self::noOrderWaitToPay => '您的订单已支付,请勿重复支付', self::noOrderWaitToPay => '您的订单已支付,请勿重复支付',
self::wrongEvaluation => '商品评论应在6-500字之间', self::wrongEvaluation => '商品评论应在6-500字之间',
self::selfGoodsForStoreOrder => '店主不能购买自己的商品',
//销售员 //销售员
self::emptySaleGoodsId=>'商品id不能为空', self::emptySaleGoodsId=>'商品id不能为空',
self::emptySaleGoods=>'销售商品不存在', self::emptySaleGoods=>'销售商品不存在',
......
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