Commit b0caebeb authored by liuyuzhen's avatar liuyuzhen

组合销售增加是否在服务范围内

parent 057e80a4
...@@ -89,7 +89,8 @@ class StoreController extends \Our\Controller_AbstractIndex { ...@@ -89,7 +89,8 @@ class StoreController extends \Our\Controller_AbstractIndex {
$pageSize = $this->getPageSize(\Our\PageConst::pBlPage); $pageSize = $this->getPageSize(\Our\PageConst::pBlPage);
$data['pageIndex'] = $pageIndex; $data['pageIndex'] = $pageIndex;
$data['pageSize'] = $pageSize; $data['pageSize'] = $pageSize;
$info = \Business\Goods\GroupSaleServiceModel::getInstance()->getGroupSaleGoodsList($data); $currentAddress = $this->sess->get('currentAddress');
$info = \Business\Goods\GroupSaleServiceModel::getInstance()->getGroupSaleGoodsList($data,$currentAddress);
$this->success($info); $this->success($info);
} }
......
...@@ -429,11 +429,17 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -429,11 +429,17 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
* @throws \Exception * @throws \Exception
* @throws \Our\Exception * @throws \Our\Exception
*/ */
public function getGroupSaleGoodsList($param){ public function getGroupSaleGoodsList($param,$address = array()){
$storeId = (int)$param['storeId']; $storeId = (int)$param['storeId'];
if(!$storeId){ if(!$storeId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyStoreId); \Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyStoreId);
} }
if(!$address){
$inServiceAreaFlag = \Our\ApiConst::one;
}else{
$inAreaFlag = \Store\StoreUtil::getInstance()->checkAddressInServiceArea($address,$storeId);
$inServiceAreaFlag = $inAreaFlag?\Our\ApiConst::one:\Our\ApiConst::zero;
}
$pageSize = (int)$param['pageSize']; $pageSize = (int)$param['pageSize'];
$pageIndex = (int)$param['pageIndex']; $pageIndex = (int)$param['pageIndex'];
if($pageSize === 0){ if($pageSize === 0){
...@@ -488,7 +494,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -488,7 +494,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
}else{ }else{
$totalCount = 0; $totalCount = 0;
} }
return array('totalCount'=>$totalCount,'groupGoods'=>array_values($group)); return array('totalCount'=>$totalCount,'groupGoods'=>array_values($group),'inServiceAreaFlag'=>$inServiceAreaFlag);
} }
public function getPBundlingList($groupList,$dbName = \Our\DbNameConst::salveDBConnectName,$withKeyFlag = false){ public function getPBundlingList($groupList,$dbName = \Our\DbNameConst::salveDBConnectName,$withKeyFlag = false){
......
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