92 lines
2.2 KiB
PHP
92 lines
2.2 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
/**
|
|
* Notes:交付车辆
|
|
* Created on: 2021/9/28 14:11
|
|
* Created by: dengbw
|
|
*/
|
|
class Delivery extends HD_Controller
|
|
{
|
|
private $status_pid = 5;
|
|
|
|
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);
|
|
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
|
|
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'));
|
|
}
|
|
|
|
}
|