Files
liche/admin/controllers/receiver/order/Refund.php
T
2021-11-23 11:42:02 +08:00

92 lines
2.1 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:退款
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Refund extends HD_Controller
{
private $status_pid = 7;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$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;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}