|
@@ -785,13 +785,23 @@ class Order extends Base
|
|
|
if ($order['have_paid'] == 0) {
|
|
|
$this->error(__('订单未支付,可直接取消,无需申请售后'));
|
|
|
}
|
|
|
+ if($order->status == 0){
|
|
|
+ $this->error('当前订单不能申请退款');
|
|
|
+ }
|
|
|
+ if($order->status == -1){
|
|
|
+ $this->error('当前订单已经申请过退款');
|
|
|
+ }
|
|
|
|
|
|
- $amount = input('amount', 0);
|
|
|
- $serviceType = input('service_type');
|
|
|
- $receivingStatus = input('receiving_status');
|
|
|
- $reasonType = input('reason_type');
|
|
|
- $refundExplain = input('refund_explain');
|
|
|
- $orderProductId = input('order_product_id');
|
|
|
+ //$amount = input('amount', 0);
|
|
|
+ $amount = $order->total_price;
|
|
|
+ $serviceType = input('service_type',1);
|
|
|
+ $receivingStatus = input('receiving_status',1);
|
|
|
+ $reasonType = input('reason_type','');
|
|
|
+ $refundExplain = input('refund_explain','');
|
|
|
+ $images = input('images','');
|
|
|
+// $orderProductId = input('order_product_id');
|
|
|
+ $orderProductId = Db::name('unishop_order_product')->where('order_id',$order_id)->column('product_id');
|
|
|
+ $orderProductId = implode(',', $orderProductId);
|
|
|
|
|
|
if (!$orderProductId) {
|
|
|
$this->error(__('Please select goods'));
|
|
@@ -819,6 +829,7 @@ class Order extends Base
|
|
|
$orderRefund->reason_type = $reasonType;
|
|
|
$orderRefund->amount = $amount;
|
|
|
$orderRefund->refund_explain = $refundExplain;
|
|
|
+ $orderRefund->images = $images;
|
|
|
$orderRefund->save();
|
|
|
|
|
|
$productIdArr = explode(',', $orderProductId);
|
|
@@ -928,4 +939,12 @@ class Order extends Base
|
|
|
'company' => $expressInfo['name'] ?? '快递单号'
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 申请退货原因
|
|
|
+ * */
|
|
|
+ public function refund_reason(){
|
|
|
+ $list = Db::name('unishop_refundreason')->order('weigh asc')->select();
|
|
|
+ $this->success(1,$list);
|
|
|
+ }
|
|
|
}
|