Commit b2b5fd79 authored by wwccw0591's avatar wwccw0591

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

parents 7b5356e4 b8e366d0
......@@ -18,6 +18,9 @@ class HomeController extends \Our\Controller_AbstractIndex{
//获取地址相关信息
$currentAddress = $this->setAddressAction(true);
if(!isset($currentAddress['addresses'])){
$currentAddress['addresses'] = array();
}
$returnData['currentAddress'] = $currentAddress;
$currentAddress = $this->sess->get('currentAddress');
......
......@@ -39,6 +39,8 @@ class OrderConfirmUtil {
private $saleGoodsIds = array(); //参与销售活动结算的goodsId 列表
private $storeMemos = array();
public function addOrder($data,$memberId,$currentAddress){
$storeCartData = $this->checkPostData($data,$memberId,$currentAddress);
$storeCartData = $this->checkDeliveryTypeAndPayway($storeCartData);
......@@ -84,6 +86,7 @@ class OrderConfirmUtil {
$gcIds = isset($cartList['gcIds'])?$cartList['gcIds']:array();
$storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>array_keys($cartList['list']),'goodsIds'=>$cartList['goodsIds'],'goodsCommonIds'=>$cartList['goodsCommonIds'],'blIds'=>$cartList['blIds'],'gcIds'=>$gcIds);
$this->storeIds= array_keys($cartList['list']);
$this->storeMemos[$this->postData['storeId']] = isset($this->postData['storeMemo'])?$this->postData['storeMemo']:\Our\NameConst::emptyString;
}else{
foreach($this->postData as $temp){
$this->checkOneStoreData($temp);
......@@ -98,6 +101,7 @@ class OrderConfirmUtil {
$this->storeIds[]= $temp['storeId'];
$this->storeCartIds[$temp['storeId']] =$temp['cartIds'];
$this->postFormatData[$temp['storeId']] = $temp;
$this->storeMemos[$temp['storeId']] = isset($temp['storeMemo'])?$temp['storeMemo']:\Our\NameConst::emptyString;
}
if($this->couponIds){
if(count($this->couponIds)!= count(array_unique($this->couponIds))){
......@@ -216,8 +220,8 @@ class OrderConfirmUtil {
if($temp['expressDistribution']!=\Our\ApiConst::one){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder);
}
if(!($tempStore['is_transport']&&$tempStore['transport_id']>\Our\ApiConst::zero&&isset($temp['shippingFee']))){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder);
if($tempStore['goodsFreight']==\Our\ApiConst::zero&&!($tempStore['is_transport']&&$tempStore['transport_id']>\Our\ApiConst::zero&&isset($temp['shippingFee']))){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder1);
}
$deliveryFee = $temp['shippingFee'];
}
......@@ -411,7 +415,7 @@ class OrderConfirmUtil {
$orderCommon = array();
$orderCommon['order_id'] = $orderId;
$orderCommon['store_id'] = $storeId;
$orderCommon['order_message'] = isset($this->postFormatData[$storeId]['storeMemo'])?$this->postFormatData[$storeId]['storeMemo']:\Our\NameConst::emptyString;
$orderCommon['order_message'] = isset($this->storeMemos[$storeId])?$this->storeMemos[$storeId]:\Our\NameConst::emptyString;
$orderCommon['reciver_info'] = $reciverInfo;
$orderCommon['reciver_name'] = $reciverName;
$orderCommon['reciver_city_id'] = $this->address['city_id'];
......
......@@ -59,9 +59,15 @@ class StoreServiceModel extends \Business\AbstractModel{
if($param['sid']) {
$sale = \DAO\SaleModel::getInstance()->getOne(array('sale_id'=>$param['sid']),'sale_act_id,member_id');
if($sale) {
\DAO\SaleMemberModel::getInstance()->insertOrUpdate(array('sale_id'=>$sale['member_id'],'sale_act_id'=>$sale['sale_act_id'],'member_id'=>$memberId,'storeId'=>$storeId));
\DAO\SaleMemberModel::getInstance()->insertOrUpdate(array('sale_id'=>$sale['member_id'],'sale_act_id'=>$sale['sale_act_id'],'member_id'=>$memberId,'store_id'=>$storeId));
}
}
// $storeMember['storeId'] = $storeId;
// $storeMember['memberId'] = $memberId;
// $storeMember['type'] = \Our\ApiConst::storeQrcodeMember;
// $storeMembers[] = $storeMember;
// $storeMemberDao = \DAO\StoreMemberModel::getInstance(\Our\DbNameConst::masterDBConnectName);
// $result = $storeMemberDao->addBatch($storeMembers);
}else{
$sess=\Yaf\Session::getInstance();
$scan_store_ids = $sess->get('scan_store_ids');
......
......@@ -75,6 +75,9 @@ class AddressServiceModel extends \Business\AbstractModel {
$address['address'] = $currentAddress['address'];
$address['name'] = $currentAddress['name'];
$address['tagType'] = $currentAddress['tagType'];
$address['lat'] = $currentAddress['lat'];
$address['lng'] = $currentAddress['lng'];
$address['cityCode'] = $currentAddress['cityCode'];
$addresses[] = $address;
$returnAddress = array('returnAddressId'=>$currentAddress['addressId'],'choosedAddressFlag'=>$currentAddress['chooseFlag'],'addresses'=>$addresses);
}else{
......@@ -118,12 +121,12 @@ class AddressServiceModel extends \Business\AbstractModel {
$newAddress['address'] = $address['address'];
$newAddress['name'] = $address['name'];
$newAddress['tagType'] = $address['tagType'];
$returnAddresses[] = $newAddress;
$choosedAddressId = $address['addressId'];
$newAddress = $address;
$newAddress['lng'] = $address['lng'];
$newAddress['lat'] = $address['lat'];
$newAddress['cityCode'] = $address['cityCode'];
$returnAddresses[] = $newAddress;
$choosedAddressId = $address['addressId'];
$newAddress = $address;
$newAddress['chooseFlag'] = \Our\ApiConst::one;
$sess['currentAddress'] = $newAddress;
return array('returnAddressId'=>$choosedAddressId,'choosedAddressFlag'=>\Our\ApiConst::one,'addresses'=>$returnAddresses);
......@@ -196,11 +199,11 @@ class AddressServiceModel extends \Business\AbstractModel {
$address['address']= $newAddressList[$pos]['address'];
$address['name'] = $newAddressList[$pos]['name'];
$address['tagType']= $newAddressList[$pos]['tag_type'];
$address['lng'] = $newAddressList[$pos]['lng'];
$address['lat'] = $newAddressList[$pos]['lat'];
$address['cityCode'] = $newAddressList[$pos]['citycode'];
$choosedAddressId = $address['addressId'];
$newAddress = $address;
$newAddress['lng'] = $newAddressList[$pos]['lng'];
$newAddress['lat'] = $newAddressList[$pos]['lat'];
$newAddress['cityCode'] = $newAddressList[$pos]['citycode'];
$newAddress['chooseFlag'] = \Our\ApiConst::one;
$sess['currentAddress'] = $newAddress;
$returnAddresses[] = $address;
......@@ -260,6 +263,9 @@ class AddressServiceModel extends \Business\AbstractModel {
$temp['address'] = $tempAddr['address'];
$temp['name'] = $tempAddr['name'];
$temp['tagType'] = $tempAddr['tagType'];
$temp['cityCode'] = $tempAddr['citycode'];
$temp['lat'] = $tempAddr['lat'];
$temp['lng'] = $tempAddr['lng'];
$returnAddressList[] = $temp;
}
return array('returnAddressId'=>$choosedAddressId,'choosedAddressFlag'=>$choosedAddressFlag,'addresses'=>$returnAddressList);
......@@ -300,6 +306,9 @@ class AddressServiceModel extends \Business\AbstractModel {
$temp['address'] = $tempAddr['address'];
$temp['name'] = $tempAddr['name'];
$temp['tagType'] = $tempAddr['tagType'];
$temp['lat'] = $tempAddr['lat'];
$temp['lng'] = $tempAddr['lng'];
$temp['cityCode'] = $tempAddr['cityCode'];
$returnAddressList[] = $temp;
}
return $returnAddressList;
......
......@@ -67,6 +67,9 @@ class GoodsCommonModel extends \DAO\AbstractModel {
*/
public function getGoodsList($where,$field,$limit=array(),$order=array(),$attrStr=''){
$this->setDb($this->dbName);
if($attrStr) {
$field = 'DISTINCT '.$field;
}
$str = '$data = $this->db->select($field)->from($this->_tableName)';
if($attrStr){
$str .="->join('han_goods_attribute_value','han_goods_attribute_value.goods_commonid = han_goods_common.goods_commonid')";
......@@ -99,6 +102,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
*/
public function getListWithSale($where,$field,$actIds,$limit=array(),$order=array(),$attrStr='',$online = true){
$this->setDb($this->dbName);
if($attrStr) {
$attrStr = '('.$attrStr.')';
$field = ' DISTINCT '.$field;
}
$str = "select ".$field." FROM ".$this->_tableName." LEFT JOIN (SELECT MIN(discount_price) discount_price,goods_commonid,goods_id FROM han_sale_goods where sale_act_id in(".implode(',',$actIds).") GROUP BY goods_commonid) a on (han_goods_common.goods_commonid = a.goods_commonid)";
if($attrStr){
$str .= "INNER JOIN han_goods_attribute_value ON han_goods_attribute_value.goods_commonid = han_goods_common.goods_commonid ";
......
......@@ -270,7 +270,9 @@ class CodeConfigModel {
const notExsitDeliver=300111;
const notExsitOrder=300112;
const alreadyExsitRefundGoods=300113;
const notAllowDelete=300114;
const notAllowDelete=300114;
const noExpressDeliveryForOrder1 = 300115;
//店铺相关错误码
//商品分类
......@@ -694,7 +696,7 @@ const notAllowDelete=300114;
self::wrongDeliveryTimeRangeForOrder => '下单时配送时间格式',
self::noBuyerDeliveryTypeForOrder => '该店铺配置到店自提',
self::noDeliveryFeeForBuyerType => '到店自提不收取配送费',
self::noExpressDeliveryForOrder => '该店铺配置快递配送',
self::noExpressDeliveryForOrder => '该店铺配置快递配送',
self::wrongPaywayForStoreForOrder => '店铺暂未配置您选择的支付方式',
self::emptyDeliveryFeeForOrder => '下单时配送费不能为空',
self::saveOrderPayFailed => '订单支付信息保存失败',
......@@ -734,6 +736,7 @@ const notAllowDelete=300114;
self::blGoodsStorageToCacheFailedForOrder => '组合销售库存更新失败(cache)',
self::goodsStorageToCacheFailedForOrder => '普通商品库存更新失败(cache)',
self::notExistOrderGoods => '退款商品不存在',
self::noExpressDeliveryForOrder1=>'test123',
//销售员
self::emptySaleGoodsId=>'商品id不能为空',
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