checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $order_refund_model = new CashierOrderRefundModel(); $params = array ( 'site_id' => $this->site_id,//站点id 'store_id' => $this->store_id, 'order_id' => $this->params[ 'order_id' ] ?? 0, 'refund_array' => $this->params[ 'refund_array' ] ?? '{}',// ['order_goods_id1','order_goods_id2','order_goods_id2'] ); $res = $order_refund_model->getRefundApplyData($params); return $this->response($res); } public function refund() { $token = $this->checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $order_refund_model = new CashierOrderRefundModel(); $data = [ 'site_id' => $this->site_id,//站点id 'store_id' => $this->store_id, 'order_id' => $this->params[ 'order_id' ] ?? 0, 'refund_transfer_type' => $this->params[ 'refund_transfer_type' ] ?? '', 'refund_array' => empty($this->params[ 'refund_array' ]) ? [] : json_decode($this->params[ 'refund_array' ], true),// {'order_goods_id1':{'refund_money':10}}, 'refund_reason' => $this->params[ 'refund_reason' ] ?? '', 'refund_remark' => $this->params[ 'refund_remark' ] ?? '', 'operator' => $this->user_info,//操作人员, ]; $res = $order_refund_model->refund($data); return $this->response($res); } /** * 为维权列表 * @return false|string */ public function lists() { $page_index = $this->params[ 'page' ] ?? 1; $search = $this->params[ 'search' ] ?? ''; $page_size = $this->params[ 'page_size' ] ?? PAGE_LIST_ROWS; $order_refund_model = new OrderRefundModel(); $condition = [ [ 'nop.site_id', '=', $this->site_id ], [ 'no.store_id', '=', $this->store_id ] ]; //商品名称 if (!empty($search)) { $condition[] = [ 'nop.sku_name|no.order_no', 'like', '%' . $search . '%' ]; } $list = $order_refund_model->getRefundOrderGoodsPageList($condition, $page_index, $page_size, 'nop.refund_action_time desc'); return $this->response($list); } /** * 详情 * @return false|string */ public function detail() { $token = $this->checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $order_goods_id = $this->params[ 'order_goods_id' ] ?? 0; $order_refund_model = new OrderRefundModel(); $detail = $order_refund_model->getRefundDetail($order_goods_id, $this->site_id, $this->store_id); return $this->response($detail); } }