Commit 40d672b3 authored by zhz's avatar zhz

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

parents f05f9f1e 7442bdce
......@@ -111,6 +111,9 @@ class OrderController extends \Our\Controller_AbstractApi {
*/
public function applyPlatformAction(){
$refundService =\Business\Order\RefundServiceModel::getInstance();
if(empty($this->req[\Our\NameConst::data]['refundId'])){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::paramsError);
}
$res=$refundService->platformIn($this->memberId,$this->req[\Our\NameConst::data]['refundId']);
if($res){
$this->success(array(),\Our\DescribeConst::applySuccess);
......
......@@ -246,7 +246,7 @@ class CouponServiceModel extends \Business\AbstractModel{
}
$memberCouponDao = \DAO\Coupon\MemberCouponModel::getInstance($dbName);
if($coupon['is_overlay']){//允许领用多张的优惠券是否存在已经领取的未使用有效优惠券
$whereSql = ' coupon_state ='.\Our\ApiConst::couponUnused.' and member_id ='.$memberId.' and out_time > '.time();
$whereSql = ' coupon_state ='.\Our\ApiConst::couponUnused.' and member_id ='.$memberId.' and coupon_id='.$coupon['id'].' and out_time > '.time();
//$memberCoupons = \Our\RedisHelper::cachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(), array(&$memberCouponDao, 'getList'),array($whereSql),\Our\ApiConst::oneHour,array($where['couponId']));
$memberCoupons = $memberCouponDao->getList($whereSql);
}else{//不允许领用多张的优惠券
......
......@@ -264,9 +264,14 @@ class OrderServiceModel extends \Business\AbstractModel
$returnData['diliverymanId'] = ApiConst::zero;
$returnData['deliveryman'] = new \stdClass();
}
if(empty($returnData['deliveryman']['qrcodePath'])){
$returnData['deliveryman']['qrcodePath']='';
}
$returnData['totalGoodsNum'] = $orderGoodsDao->getGoodsCount($this->orderGoodsList);
$returnData['offlinePayway'] = $this->store['offlinePayway'] ? $this->store['offlinePayway'] : '';
$returnData['reciverInfo'] = $this->address;
$returnData['reciverInfo']['lng']=!empty($returnData['reciverInfo']['lng'])?$returnData['reciverInfo']['lng']:ApiConst::zero;
$returnData['reciverInfo']['lat']=!empty($returnData['reciverInfo']['lat'])?$returnData['reciverInfo']['lat']:ApiConst::zero;
$refundStateName = $orderDao->getRefundText($this->order);
$returnData['orderGoods'] = $goodsDao->convert($this->orderGoodsList, $refundStateName);
return $returnData;
......@@ -889,7 +894,7 @@ class OrderServiceModel extends \Business\AbstractModel
$orderSubTips = \Our\DescribeConst::payFailedSubTips;
$orderState = \Our\ApiConst::zero;
break;
} else if ($order['payment_type'] != \Our\ApiConst::payOnline && $order['order_state'] == \Our\ApiConst::orderStateWaitConfirm) {//已下单的待线上支付订单
} else if (($order['payment_type'] == \Our\ApiConst::payOffline||$order['payment_type'] == \Our\ApiConst::payAog) && $order['order_state'] == \Our\ApiConst::orderStateWaitConfirm) {//已下单的待线上支付订单
$orderTips = \Our\DescribeConst::addOrderSuccessTips;
$store = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($order['store_id']), \Our\ApiConst::oneHour);
$orderContent['storeName'] = $store['store_name'];
......
......@@ -12,6 +12,8 @@ use Our\DbNameConst;
use Our\DescribeConst;
use Our\ImageConst;
use Our\ImageUtil;
use Our\NameConst;
use Our\OrderConst;
/**
* 店铺service
......@@ -495,9 +497,21 @@ class RefundServiceModel extends \Business\AbstractModel
public function platformIn($buyerId, $refundId, $platFormMessage = DescribeConst::unagreeSellerProccess)
{
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::masterDBConnectName);
$res = $refundReturnDao->updateStatusByBuyerIdAndRefundId($buyerId, $refundId, $platFormMessage);
if ($res) {
$orderDao=\DAO\Order\OrderModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoodsDao=\DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$where['buyer_id']=$buyerId;
$where['refund_id']=$refundId;
$res= $refundReturnDao->find($where,$refundReturnDao->refundDetailField);
if(isset($res['isPlatformIn']) && !empty($res['isPlatformIn'])){
ErrorModel::throwException(CodeConfigModel::platFormAreadyIn);
}
$re= $refundReturnDao->updateStatusByBuyerIdAndRefundId($buyerId, $refundId, $platFormMessage);
if ($re) {
$whereOrderGoods['rec_id']=$res['orderGoodsId'];
$updateData['refund_state_name']=OrderConst::platFromProccess;
$orderGoodsDao->update($whereOrderGoods,$updateData);
$refundReturnDao->deleteRefundCache($buyerId,$refundId);
$orderDao->deleteOrderCache($buyerId,$res['orderId'],$res['storeId']);
return true;
} else {
return false;
......
File mode changed from 100755 to 100644
......@@ -95,12 +95,15 @@ class QmDeliverymanLogModel extends \DAO\AbstractModel
}
if ($type == ApiConst::orderTypeRefund) {
$where=Common::format(" diliveryman_id={0} and order_type={1} and (delivery_state={2} or delivery_state={3})",$diliveryId,ApiConst::orderTypeRefund,ApiConst::deliveryStateWait,ApiConst::deliveryStateWaitTen);
// $where['order_type'] = ApiConst::orderTypeRefund;
// $where['delivery_state'] = ApiConst::deliveryStateWait;
$where['order_type'] = ApiConst::orderTypeRefund;
$where['delivery_state'] = ApiConst::deliveryStateWait;
}
if ($type == ApiConst::deliveryStateWait) {
$where['delivery_state'] = ApiConst::deliveryStateComplete;
}
if($type==ApiConst::deliveryStateComplete){
$order = array('finish_time' => 'desc');
}
$list = $this->lists($where, $order, $this->fieldList, $pageIndex, $pageSize);
return $list;
}
......
......@@ -23,7 +23,8 @@ class RefundReturnModel extends \DAO\AbstractModel {
* @var string
*/
protected $_tableName = 'han_refund_return';
private $refundReturnField="seller_state,refund_state,is_platform_in,platform_state";
public $refundDetailField='is_platform_in as isPlatformIn,seller_state as sellerState,platform_state as platformState,refund_id as refundId,order_id as orderId,store_id as storeId,order_goods_id as orderGoodsId';
public $refundReturnField="seller_state,refund_state,is_platform_in,platform_state";
private $sumField="buyer_id as buyerId,store_id as storeId,goods_num as goodsNum,refund_amount as refundAmount,is_suc_refund as isSucRefund,gmt_update as gmtUpdate";
/**
* 主键
......
......@@ -271,6 +271,7 @@ class CodeConfigModel {
const notExsitOrder=300112;
const alreadyExsitRefundGoods=300113;
const notAllowDelete=300114;
const platFormAreadyIn=300115;
//店铺相关错误码
//商品分类
......@@ -668,6 +669,7 @@ class CodeConfigModel {
self::notExsitOrder=>'订单不存在',
self::alreadyExsitRefundGoods=>'退款订单已经存在',
self::notAllowDelete=>'当前订单状态不允许删除',
self::platFormAreadyIn=>'您已经申请过平台介入',
self::deleteError=>'放入回收站失败,订单状态有误',
self::restoreError=>'永久删除、从回收站还原失败,订单状态有误',
self::shareError=>'分享失败,订单状态有误',
......
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