From e693c86fb7d430510b5d0f8852f2653d3b0ef845 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 21 Oct 2021 17:51:23 +0800 Subject: [PATCH] admin_order_1021 --- admin/controllers/receiver/Orders.php | 4 +- admin/controllers/receiver/order/Refund.php | 98 +++++++++++++++++++ admin/libraries/OrdersList.php | 6 +- .../receiver/order/Receiver_orders_model.php | 2 +- 4 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 admin/controllers/receiver/order/Refund.php diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index 03b23cb3..7a785fc5 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -46,8 +46,8 @@ class Orders extends HD_Controller $where_c = ["$t2.id>" => 0]; $where_c["{$t2}.brand_id<>3"] = null;//狸车品牌不显示 $where_c["{$t2}.biz_id<>1"] = null;//biz_id=1不显示 - if ($key == 6) { - $count1 = $this->orders_model->count(array("status" => 6, "brand_id<>3" => null)); + if ($key == 6 || $key==7) { + $count1 = $this->orders_model->count(array("status" => $key, "brand_id<>3" => null)); } else { if ($key == 0) { $t1 = 'lc_receiver_order_signs'; diff --git a/admin/controllers/receiver/order/Refund.php b/admin/controllers/receiver/order/Refund.php new file mode 100644 index 00000000..30e3dba5 --- /dev/null +++ b/admin/controllers/receiver/order/Refund.php @@ -0,0 +1,98 @@ +lists(); + } + + public function lists() + { + $params = $this->input->get(); + $this->load->library('OrdersList'); + $result = $this->orderslist->lists($this->status_pid, $params); + $this->data = $result; + return $this->show_view($result['view'], true); + } + + public function get() + { + } + + //添加单条数据 + public function add() + { + } + + //编辑单条数据 + public function edit() + { + } + + //删除单条数据 + public function del() + { + + } + + //批量操作(默认修改状态) + public function batch() + { + + } + + //导出数据列表 + public function export() + { + $params = $this->input->get(); + $params['page'] = 1; + $params['size'] = 10000; + $this->load->library('OrdersList'); + $result = $this->orderslist->lists($this->status_pid, $params); + $fileName = $result['_title']; + foreach ($result['lists'] as $key => $value) { + $temp['name'] = $value['name']; + $temp['mobile'] = $value['mobile']; + $temp['car_name'] = $value['car_name']; + $temp['biz_name'] = $value['biz_name']; + $temp['price'] = $value['price']; + $temp['deposit'] = $value['deposit']; + $temp['payway_name'] = $value['payway_name']; + $temp['cf_title'] = $value['cf_title']; + $temp['status_name'] = $value['status_name']; + $temp['c_time'] = $value['c_time']; + $data[] = $temp; + } + $indexs = [ + 'name' => '客户姓名', + 'mobile' => '客户电话', + 'car_name' => '车辆', + 'biz_name' => '门店', + 'price' => '车辆平台价', + 'deposit' => '定金', + 'payway_name' => '付款方式', + 'cf_title' => '客户来源', + 'status_name' => '状态', + 'c_time' => '订单时间' + ]; + array_unshift($data, $indexs); + $this->load->library('excel'); + return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis')); + } + +} diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index fa66ec4d..87a80e6e 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -29,9 +29,9 @@ class OrdersList !$params['qdjl_id'] && $params['qdjl_id'] = ''; //渠道经理 $qdjl_lists = $this->ci->mdLichebUsers->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name'); - if (!strlen($status_pid) || $status_pid == 6) { - if ($status_pid == 6) { - $params['status'] = 6; + if (!strlen($status_pid) || $status_pid == 6 || $status_pid == 7) { + if ($status_pid) { + $params['status'] = $status_pid; } $result = $this->orders($params); $result['qdjl_lists'] = $qdjl_lists; diff --git a/common/models/receiver/order/Receiver_orders_model.php b/common/models/receiver/order/Receiver_orders_model.php index 3523f037..86de79c2 100644 --- a/common/models/receiver/order/Receiver_orders_model.php +++ b/common/models/receiver/order/Receiver_orders_model.php @@ -41,7 +41,7 @@ class Receiver_orders_model extends HD_Model $status_ary[5] = array('name' => '交付车辆', 'show' => true, 'list' => array(0 => '待用户确认', 1 => '用户已确认', 2 => '销售已确认'), 'menu_list' => array(0 => '待用户确认', 1 => '用户已确认', 2 => '销售已确认'), 'menu_default' => 0); $status_ary[6] = array('name' => '交易完成', 'show' => true, 'list' => array(), 'menu_list' => array()); - $status_ary[7] = array('name' => '申请退款', 'show' => false, 'list' => array(), 'menu_list' => array()); + $status_ary[7] = array('name' => '退款', 'show' => true, 'list' => array(), 'menu_list' => array()); if (strlen($status)) { $return_status = $status_ary[$status]; } else {