Commit 631f580c authored by liuyuzhen's avatar liuyuzhen

组合销售上下架问题

parent 033d1cd5
...@@ -10,7 +10,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -10,7 +10,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
private $pBundingGoodsField = 'bl_count_price AS discountPrice,num,goods_id,bl_id'; private $pBundingGoodsField = 'bl_count_price AS discountPrice,num,goods_id,bl_id';
private $pBundingGoodsDetailField = 'goods_id,goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image,goods_spec,goods_storage AS goodsStorage,goods_price AS goodsPrice'; private $pBundingGoodsDetailField = 'goods_id,goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image,goods_spec,goods_storage AS goodsStorage,goods_price AS goodsPrice,goods_state,goods_verify,is_del';
public function init(){ public function init(){
} }
...@@ -145,7 +145,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -145,7 +145,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if (!$pBundling) { if (!$pBundling) {
$tempObj['goodsState'] = \Our\ApiConst::cartGoodsOffline; $tempObj['goodsState'] = \Our\ApiConst::cartGoodsOffline;
} else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))) { } else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))||!$pBundling['goodsCountFlag']) {
$tempObj['goodsState'] = \Our\ApiConst::cartGoodsOffline; $tempObj['goodsState'] = \Our\ApiConst::cartGoodsOffline;
} else { } else {
if($pBundling['bl_storage']<=\Our\ApiConst::zero){ if($pBundling['bl_storage']<=\Our\ApiConst::zero){
...@@ -447,7 +447,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -447,7 +447,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if($bundlingGoodsList){ if($bundlingGoodsList){
$blGoodsIds = array(); $blGoodsIds = array();
$goodsIds = array_column($bundlingGoodsList,'goods_id'); $goodsIds = array_column($bundlingGoodsList,'goods_id');
$goodsList = $goodsDao->getOnlineList('goods_id in ('.implode(',',$goodsIds).')',$this->pBundingGoodsDetailField); $goodsList = $goodsDao->getList('goods_id in ('.implode(',',$goodsIds).')',$this->pBundingGoodsDetailField);
if($goodsList){ if($goodsList){
$bundlingRedis = \Redis\Db4\PBundlingRedisModel::getInstance(); $bundlingRedis = \Redis\Db4\PBundlingRedisModel::getInstance();
$pBundlingGoodsArray = array(); $pBundlingGoodsArray = array();
...@@ -480,10 +480,16 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -480,10 +480,16 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
//unset($goods_temp['goods_image']); //unset($goods_temp['goods_image']);
//unset($goods_temp['bl_id']); //unset($goods_temp['bl_id']);
//$goodsArray[] =$goods_temp; //unset($goods_temp['goods_image']); //$goodsArray[] =$goods_temp; //unset($goods_temp['goods_image']);
if(!$goods_temp['goods_state']==\Our\ApiConst::onlineGoodsState&&$goods_temp['goods_verify']==\Our\ApiConst::onlineGoodsVerify&&$goods_temp['is_del']==\Our\ApiConst::onlineGoodsDel){
$tempGroup['goodsCountFlag'] = false;
}
if($tempGroup['bl_storage']>0&&floor($goods_temp['goodsStorage']/$goods_temp['num'])<$tempGroup['bl_storage']){ if($tempGroup['bl_storage']>0&&floor($goods_temp['goodsStorage']/$goods_temp['num'])<$tempGroup['bl_storage']){
$tempGroup['bl_storage'] = floor($goods_temp['goodsStorage']/$goods_temp['num']); $tempGroup['bl_storage'] = floor($goods_temp['goodsStorage']/$goods_temp['num']);
} }
$goods_temp['goodsImagePath'] = $goods_temp['goods_image']; $goods_temp['goodsImagePath'] = $goods_temp['goods_image'];
unset($goods_temp['goods_state']);
unset($goods_temp['goods_verify']);
unset($goods_temp['is_del']);
$tempGroup['goodsList'][] = $goods_temp; $tempGroup['goodsList'][] = $goods_temp;
}else{ }else{
$tempGroup['goodsCountFlag'] = false; $tempGroup['goodsCountFlag'] = false;
...@@ -576,7 +582,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -576,7 +582,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
//$pBundling = $this->getOnePBundingCache($tempCart['goods_id']); //$pBundling = $this->getOnePBundingCache($tempCart['goods_id']);
if (!$pBundling) { if (!$pBundling) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::bundlingGoodsNotExist); \Error\ErrorModel::throwException(\Error\CodeConfigModel::bundlingGoodsNotExist);
} else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))) { } else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))||!$pBundling['goodsCountFlag']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::bundlingGoodsOfflineForCartOrOrder); \Error\ErrorModel::throwException(\Error\CodeConfigModel::bundlingGoodsOfflineForCartOrOrder);
} else { } else {
if($pBundling['bl_storage']<=\Our\ApiConst::zero){ if($pBundling['bl_storage']<=\Our\ApiConst::zero){
...@@ -769,7 +775,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -769,7 +775,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if (!$pBundling) { if (!$pBundling) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPBundlingdForOrder); \Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPBundlingdForOrder);
} else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))) { } else if (!($pBundling['bl_state'] == \Our\ApiConst::one && ($pBundling['bl_quota_starttime'] < time() && $pBundling['endTime'] >= time()))||!$pBundling['goodsCountFlag']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::pBundlingOfflineForOrder); \Error\ErrorModel::throwException(\Error\CodeConfigModel::pBundlingOfflineForOrder);
} elseif($pBundling['bl_storage']<=\Our\ApiConst::zero){ } elseif($pBundling['bl_storage']<=\Our\ApiConst::zero){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::pBundlingNoStorageForOrder); \Error\ErrorModel::throwException(\Error\CodeConfigModel::pBundlingNoStorageForOrder);
......
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