作者 耿培杰

修改退款接口提示语

@@ -1526,7 +1526,7 @@ class Order extends Api @@ -1526,7 +1526,7 @@ class Order extends Api
1526 $wuliu = $kdniao->getOrderTracesByJson($company, $code); 1526 $wuliu = $kdniao->getOrderTracesByJson($company, $code);
1527 $wuliu = json_decode($wuliu, true); 1527 $wuliu = json_decode($wuliu, true);
1528 $wuliu = isset($wuliu['Traces']) && count($wuliu['Traces']) ? array_reverse($wuliu['Traces']) : [['AcceptStation' => '暂无物流信息', 'AcceptTime' => date('Y-m-d H:i:s', time())]]; 1528 $wuliu = isset($wuliu['Traces']) && count($wuliu['Traces']) ? array_reverse($wuliu['Traces']) : [['AcceptStation' => '暂无物流信息', 'AcceptTime' => date('Y-m-d H:i:s', time())]];
1529 - $data['company_name'] = Db::name('kdniao')->where(['code' => $data['logistic_code']])->value('company'); 1529 + $data['company_name'] = Db::name('kdniao')->where(['code' => $data['shipper_code']])->value('company');
1530 $data['wuliu'] = $wuliu; 1530 $data['wuliu'] = $wuliu;
1531 $this->success('SUCCESS', $data); 1531 $this->success('SUCCESS', $data);
1532 } 1532 }
@@ -1610,7 +1610,7 @@ class Order extends Api @@ -1610,7 +1610,7 @@ class Order extends Api
1610 $userModel = new \app\api\model\User(); 1610 $userModel = new \app\api\model\User();
1611 if ($orderInfo['pay_type'] == 1){ 1611 if ($orderInfo['pay_type'] == 1){
1612 //微信退款 1612 //微信退款
1613 - $result = $pay->refundGoods($orderInfo['order_num'],$orderInfo['pay_total'],$orderInfo['id'],$refund_note,$orderInfo['goods_total']); 1613 + $result = $pay->refundGoods($order['order_num'],$orderInfo['pay_total'],$orderInfo['id'],$refund_note,$orderInfo['goods_total']);
1614 }else{ 1614 }else{
1615 //余额退款 1615 //余额退款
1616 $result = $userModel->refundGoods($orderInfo['user_id'],$orderInfo['goods_total'],$orderInfo['id'],$refund_note); 1616 $result = $userModel->refundGoods($orderInfo['user_id'],$orderInfo['goods_total'],$orderInfo['id'],$refund_note);
@@ -95,7 +95,7 @@ class Pay extends Api @@ -95,7 +95,7 @@ class Pay extends Api
95 // 用户是否支付成功 95 // 用户是否支付成功
96 if ($successful) { 96 if ($successful) {
97 $orderInfoModel = new OrderInfo(); 97 $orderInfoModel = new OrderInfo();
98 - $goodsList = $orderInfoModel->where('order_id', $order['id'])->field('goods_id,number,ch_goods_name,type,score')->select(); 98 + $goodsList = $orderInfoModel->where('order_id', $order['id'])->field('goods_id,number,ch_goods_name,type,score,depot_id')->select();
99 $orderModel->notify($order['id'],$order['user_id'],$order['pay_total'],$goodsList); 99 $orderModel->notify($order['id'],$order['user_id'],$order['pay_total'],$goodsList);
100 } 100 }
101 return true; // 返回处理完成 101 return true; // 返回处理完成
@@ -216,7 +216,7 @@ class Pay extends Api @@ -216,7 +216,7 @@ class Pay extends Api
216 // $orderNo = "2020060610056519";//商户系统内部的订单号(out_trade_no) 216 // $orderNo = "2020060610056519";//商户系统内部的订单号(out_trade_no)
217 $refundNo = get_order_num().'3';//退款单号 217 $refundNo = get_order_num().'3';//退款单号
218 if ($refundFee){ 218 if ($refundFee){
219 - $result = json_decode($payment->refund($orderNo, $refundNo, $total*100,$refundFee),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款) 219 + $result = json_decode($payment->refund($orderNo, $refundNo, $total*100,$refundFee*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款)
220 }else { 220 }else {
221 $result = json_decode($payment->refund($orderNo, $refundNo, $total*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款) 221 $result = json_decode($payment->refund($orderNo, $refundNo, $total*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款)
222 } 222 }
@@ -240,7 +240,7 @@ class Pay extends Api @@ -240,7 +240,7 @@ class Pay extends Api
240 // $orderNo = "2020060610056519";//商户系统内部的订单号(out_trade_no) 240 // $orderNo = "2020060610056519";//商户系统内部的订单号(out_trade_no)
241 $refundNo = get_order_num().'3';//退款单号 241 $refundNo = get_order_num().'3';//退款单号
242 if ($refundFee){ 242 if ($refundFee){
243 - $result = json_decode($payment->refund($orderNo, $refundNo, $total*100,$refundFee),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款) 243 + $result = json_decode($payment->refund($orderNo, $refundNo, $total*100,$refundFee*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款)
244 }else { 244 }else {
245 $result = json_decode($payment->refund($orderNo, $refundNo, $total*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款) 245 $result = json_decode($payment->refund($orderNo, $refundNo, $total*100),true); // 总金额 100, 退款 80,refundFee可选(为空时全额退款)
246 } 246 }
@@ -463,7 +463,7 @@ class Order extends Model @@ -463,7 +463,7 @@ class Order extends Model
463 $res1 = $orderInfoModel->where('id', $order_info_id)->update($data); 463 $res1 = $orderInfoModel->where('id', $order_info_id)->update($data);
464 $res2 = $orderRefundModel->save($refundData); 464 $res2 = $orderRefundModel->save($refundData);
465 465
466 - $goods = $orderInfoModel->where('id', $order_info_id)->field('goods_id,depot_id,number,ch_goods_name,type,score')->select(); 466 + $goods = $orderInfoModel->where('id', $order_info_id)->field('goods_id,depot_id,number,ch_goods_name,type,score')->find();
467 Db::name('depot_goods')->where(['type' => $goods['type'], 'goods_id' => $goods['goods_id'], 'depot_id' => $goods['depot_id']])->setInc('stock_num', $goods['number']); 467 Db::name('depot_goods')->where(['type' => $goods['type'], 'goods_id' => $goods['goods_id'], 'depot_id' => $goods['depot_id']])->setInc('stock_num', $goods['number']);
468 //判断商品类型减销量 加库存 468 //判断商品类型减销量 加库存
469 if ($goods['type'] == 2) { 469 if ($goods['type'] == 2) {