Commit e06683b1 authored by wwccw0591's avatar wwccw0591

pc

parent 6e9adccc
......@@ -22,7 +22,7 @@ use Our\ImageUtil;
class RefundServiceModel extends \Business\AbstractModel
{
private $orderField = "buyer_id as buyerId,buyer_name as buyerName,order_id as orderId,order_sn as orderSn,store_name as storeName,add_time as AddTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,need_shipping_fee as needShippingFee,payment_code as paymentCode,delay_time as delayTime";
private $orderGoodsField = "commis_rate as commisRate,goods_type as goodsType,order_id as orderId,rec_id as recId,goods_id as goodsId,goods_name as goodsName,goods_price as goodsPrice,goods_num as goodsNum,goods_image as goodsImage,goods_pay_price as goodsPayPrice,sale_act_id as saleActId,sale_id as saleId,comment_state as commentState,is_refund as isRefund,goods_spec as goodsSpec,goods_group as goodsGroup";
private $orderGoodsField = "commis_rate as commisRate,goods_type as goodsType,order_id as orderId,rec_id as recId,goods_id as goodsId,goods_name as goodsName,goods_price as goodsPrice,goods_num as goodsNum,goods_image as goodsImage,goods_pay_price as goodsPayPrice,sale_act_id as saleActId,sale_id as saleId,comment_state as commentState,is_refund as isRefund,goods_spec as goodsSpec,goods_group as goodsGroup,refund_id as refundId";
private $addressField = " mob_phone as MobPhone,tel_phone as TelPhone,address as address,area_info as areaInfo,lng,lat,address_id as addressId,subaddress as subAddress";
private $daddressField = "address_id as addressId,store_id as storeId,seller_name as sellerName,area_id as areaId,city_id as cityId,area_info as areaInfo,address,telphone,company,is_store_address as isStoreAddress,is_default as isDefault";
......@@ -337,6 +337,12 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderLogDao = \DAO\Order\OrderLogModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoods = $orderGoodsDao->getOneByOrderIdAndGoodsId($refund['orderId'], $refund['goodsId'], $this->orderGoodsField);
if(empty($orderGoods)){
ErrorModel::throwException(CodeConfigModel::notExistOrderGoods);
}
if($orderGoods['refundId']>ApiConst::zero){
ErrorModel::throwException(CodeConfigModel::alreadyExsitRefundGoods);
}
$refundAmount = $refund['refundAmount'];//退款金额
if ($orderInfo['paymentTime']) {
if (($refundAmount < ApiConst::zero) || ($refundAmount > $orderGoods['goodsPayPrice'])) {
......
......@@ -261,6 +261,7 @@ class CodeConfigModel {
const notExistOrderGoods=300110;
const notExsitDeliver=300111;
const notExsitOrder=300112;
const alreadyExsitRefundGoods=300113;
//店铺相关错误码
//商品分类
......@@ -652,6 +653,7 @@ class CodeConfigModel {
self::deliverError=>'快递跟踪失败,订单状态有误',
self::notExsitDeliver=>'配送单不存在',
self::notExsitOrder=>'订单不存在',
self::alreadyExsitRefundGoods=>'退款订单已经存在',
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