admin_order_1029

This commit is contained in:
dengbw
2021-10-29 17:55:53 +08:00
committed by lccsw
parent 3a5131d6b7
commit a605d811ea
14 changed files with 1143 additions and 385 deletions
+1
View File
@@ -205,6 +205,7 @@ class Customer extends HD_Controller
$qdjl_lists = $this->app_licheb_users_model->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name');
$show_info['levelAry'] = $this->customers_model->get_sdata('level');
$show_info['cfCluesAry'] = $this->customers_model->get_sdata('cfrom_clues');
$show_info['cfTitleAry'] = $this->customers_model->get_sdata('cfrom');
$this->data['show_info'] = $show_info;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
+41 -53
View File
@@ -43,11 +43,11 @@ class Orders extends HD_Controller
}
$cate = $where = array();
$t2 = 'lc_receiver_orders';
$where_c = ["$t2.id>" => 0];
$where_c = ["$t2.status>=" => 0];
$where_c["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
$where_c["{$t2}.biz_id<>1"] = null;//biz_id=1不显示
if ($key == 6 || $key==7) {
$count1 = $this->orders_model->count(array("status" => $key, "brand_id<>3" => null));
if ($key == 6 || $key == 7) {
$count1 = $this->orders_model->count(array("status" => $key, "biz_id<>" => 1, "brand_id<>" => 3));
} else {
if ($key == 0) {
$t1 = 'lc_receiver_order_signs';
@@ -82,7 +82,7 @@ class Orders extends HD_Controller
}
$status_arr[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
$params['count_all'] = $this->orders_model->count(array("brand_id<>3" => null));//全部
$params['count_all'] = $this->orders_model->count(array("status>=" => 0, "biz_id<>" => 1, "brand_id<>" => 3));//全部
$this->load->library('OrdersList');
$params['list_type'] = 'all';
$result = $this->orderslist->lists($params['status_pid'], $params);
@@ -139,13 +139,13 @@ class Orders extends HD_Controller
$row['delry_time'] = $row['delry_time'] != '0000-00-00 00:00:00'
? str_replace(" 00:00:00", "", $row['delry_time']) : '';
//获取车辆服务费
$srv_info = $this->orders_entity->order_srv_money($row['id'],1);
$srv_info['total'] = number_format($srv_info['total'],2);
$srv_info = $this->orders_entity->order_srv_money($row['id'], 1);
$srv_info['total'] = number_format($srv_info['total'], 2);
$srv_detail = "";
if($srv_info['list']){
foreach($srv_info['list'] as $key => $val){
$d = $srv_detail ? ',':'';
$srv_detail .= $d.$val['title'].":".number_format($val['money'],2);
if ($srv_info['list']) {
foreach ($srv_info['list'] as $key => $val) {
$d = $srv_detail ? ',' : '';
$srv_detail .= $d . $val['title'] . ":" . number_format($val['money'], 2);
}
}
$srv_info['detail'] = $srv_detail;
@@ -339,7 +339,7 @@ class Orders extends HD_Controller
$upd = array(
'cardidA' => $cardidA,
'cardidB' => $cardidB,
'status' => 1
'status' => 1
);
$result = $this->order_bills_model->update($upd, ['o_id' => $o_id]);
if ($result) {
@@ -364,37 +364,25 @@ class Orders extends HD_Controller
//导出数据列表
public function export()
{
$this->load->library('OrdersList');
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($params['status_pid'], 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$this->load->library('OrdersList');
$result = $this->orderslist->lists($params['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['status_name'] = $value['status_name'];
$temp['cf_title'] = $value['cf_title'];
$temp['c_time'] = $value['c_time'];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '车辆平台价',
'deposit' => '定金',
'payway_name' => '付款方式',
'status_name' => '状态',
'cf_title' => '客户来源',
'c_time' => '订单时间',
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
@@ -409,7 +397,7 @@ class Orders extends HD_Controller
$file = $_FILES['file'];
$row = $this->order_loans_model->get(['o_id' => $oid]);
if (!$row) {
$this->order_loans_model->add(['o_id'=>$oid,'c_time'=>time()]);
$this->order_loans_model->add(['o_id' => $oid, 'c_time' => time()]);
$row = $this->order_loans_model->get(['o_id' => $oid]);
}
$update = [];
@@ -471,8 +459,8 @@ class Orders extends HD_Controller
$update['loan_time'] = date('Y-m-d H:i:s', strtotime($loan_time));
}
$result = $this->order_loans_model->update($update, ['id' => $row['id']]);
if($result){
if($params['status']==2){ //设置等待放款
if ($result) {
if ($params['status'] == 2) { //设置等待放款
$this->orders_model->update(['status' => 2], ['id' => $row['o_id']]);
$ckcar = $this->order_ckcars_model->get(['o_id' => $row['o_id']]);
$replace = [
@@ -482,14 +470,14 @@ class Orders extends HD_Controller
];
$ckcar && $replace['id'] = $ckcar['id'];
$this->order_ckcars_model->replace($replace);
}elseif($params['status']==3){ //设置完成按揭
$order_row = $this->orders_model->get(['id'=>$row['o_id']],'status');
if($order_row['status']==4){ //完成代办
} elseif ($params['status'] == 3) { //设置完成按揭
$order_row = $this->orders_model->get(['id' => $row['o_id']], 'status');
if ($order_row['status'] == 4) { //完成代办
$this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
}
}else{
} else {
$this->orders_model->update(['status' => 2], ['id' => $row['o_id']]);
$ckcar = $this->order_ckcars_model->get(['o_id' => $row['o_id']]);
$replace = [
@@ -556,7 +544,7 @@ class Orders extends HD_Controller
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$bill && $row['status']>=3) {
if (!$bill && $row['status'] >= 3) {
$add_data = [
'o_id' => $row['id'],
'c_time' => time()
@@ -674,16 +662,16 @@ class Orders extends HD_Controller
$this->order_agents_model->update(['status' => 1], ['o_id' => $oid]);
$loan = $this->order_loans_model->get(['o_id' => $oid]);
if($loan && !$row['payway']){ //分期
if($loan['status']==3){ //判断是否完成代办
if ($loan && !$row['payway']) { //分期
if ($loan['status'] == 3) { //判断是否完成代办
$this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
}
}else{
} else {
return $this->show_json(SYS_CODE_FAIL, '修改失败,请先完成按揭');
}
}else{
} else {
$this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
@@ -732,19 +720,19 @@ class Orders extends HD_Controller
'pay_price!=' => 0
];
$count = $this->app_liche_orders_model->count($where);
if($count){
$rows = $this->app_liche_orders_model->select($where,'id desc',$page,$size,'id,total_price,type,pay_time,mch_id,descrip');
if ($count) {
$rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time,mch_id,descrip');
$type_arr = $this->app_liche_orders_model->get_type_arr();
foreach($rows as $item){
foreach ($rows as $item) {
$company = '';
if($item['mch_id']){
$company = $this->sys_company_model->get(['wx_mchid'=>$item['mch_id']],'short');
if ($item['mch_id']) {
$company = $this->sys_company_model->get(['wx_mchid' => $item['mch_id']], 'short');
}
$list[] = [
'money' => $item['total_price'],
'type_cn' => $type_arr[$item['type']],
'pay_time' => $item['pay_time'],
'company' => $company ? $company['short']:'',
'company' => $company ? $company['short'] : '',
'descrip' => $item['descrip']
];
}
@@ -768,7 +756,7 @@ class Orders extends HD_Controller
$pay_time = $this->input->post('pay_time');
$wx_mchid = $this->input->post('wx_mchid');
$descrip = $this->input->post('descrip');
if(!$money || !$pay_time ||!$row || !$wx_mchid){
if (!$money || !$pay_time || !$row || !$wx_mchid) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->load->helper('order');
@@ -796,7 +784,7 @@ class Orders extends HD_Controller
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
$companys = $this->sys_company_model->select(['status'=>1,'wx_mchid!='=>''],'id desc','','','id,wx_mchid,short');
$companys = $this->sys_company_model->select(['status' => 1, 'wx_mchid!=' => ''], 'id desc', '', '', 'id,wx_mchid,short');
$this->data['companys'] = $companys;
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orders/add_paylog');
+10 -21
View File
@@ -12,6 +12,7 @@ class Agent extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->library('OrdersList');
}
public function index(){
@@ -20,7 +21,6 @@ class Agent extends HD_Controller{
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);
@@ -53,32 +53,21 @@ class Agent extends HD_Controller{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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 = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '车辆平台价',
'deposit' => '定金',
'payway_name' => '付款方式',
'cf_title' => '客户来源',
'status_name' => '状态'
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+10 -21
View File
@@ -12,6 +12,7 @@ class Bill extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -23,7 +24,6 @@ class Bill extends HD_Controller
{
$params = $this->input->get();
!strlen($params['status']) && $params['status'] = 1;
$this->load->library('OrdersList');
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
@@ -61,32 +61,21 @@ class Bill extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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['biz_name'] = $value['biz_name'];
$temp['car_name'] = $value['car_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 = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '车辆平台价',
'deposit' => '定金',
'payway_name' => '付款方式',
'cf_title' => '客户来源',
'status_name' => '状态'
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+10 -21
View File
@@ -13,6 +13,7 @@ class Ckcar extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -23,7 +24,6 @@ class Ckcar extends HD_Controller
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);
@@ -61,32 +61,21 @@ class Ckcar extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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 = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '车辆平台价',
'deposit' => '定金',
'payway_name' => '付款方式',
'cf_title' => '客户来源',
'status_name' => '状态'
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+10 -23
View File
@@ -14,6 +14,7 @@ class Deal extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -24,7 +25,6 @@ class Deal extends HD_Controller
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);
@@ -62,34 +62,21 @@ class Deal extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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'];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$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'));
+10 -21
View File
@@ -13,6 +13,7 @@ class Delivery extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -23,7 +24,6 @@ class Delivery extends HD_Controller
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);
@@ -61,32 +61,21 @@ class Delivery extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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 = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '车辆平台价',
'deposit' => '定金',
'payway_name' => '付款方式',
'cf_title' => '客户来源',
'status_name' => '状态',
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+10 -19
View File
@@ -13,6 +13,7 @@ class Loan extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -23,7 +24,6 @@ class Loan extends HD_Controller
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);
@@ -61,30 +61,21 @@ class Loan extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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['title'] = $value['title'];
$temp['year'] = $value['year'];
$temp['first_price'] = $value['first_price'];
$temp['c_time'] = $value['c_time'];
$temp['cf_title'] = $value['cf_title'];
$temp['status_name'] = $value['status_name'];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'title' => '分期产品',
'year' => '年限',
'first_price' => '首付金额',
'c_time' => '分期时间',
'cf_title' => '客户来源',
'status_name' => '状态'
];
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+10 -23
View File
@@ -14,6 +14,7 @@ class Refund extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -24,7 +25,6 @@ class Refund extends HD_Controller
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);
@@ -62,34 +62,21 @@ class Refund extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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'];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$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'));
+10 -26
View File
@@ -13,6 +13,7 @@ class Sign extends HD_Controller
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
@@ -23,7 +24,6 @@ class Sign extends HD_Controller
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);
@@ -61,39 +61,23 @@ class Sign extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$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['admin_name'] = $value['admin_name'];
$temp['cf_title'] = $value['cf_title'];
$temp['status_name'] = $value['status_name'];
$temp['c_time'] = $value['c_time'];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
$indexs = [
'name' => '客户姓名',
'mobile' => '客户电话',
'car_name' => '车辆',
'biz_name' => '门店',
'price' => '合同价',
'deposit' => '定金',
'payway_name' => '付款',
'admin_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'));
}
}
+314 -111
View File
@@ -5,11 +5,9 @@
*/
class OrdersList
{
private $ci;
private $searchTpAry = array('name' => '客户姓名', 'mobile' => '客户手机号', 'sid' => '订单号');
private $paywayAry = array(0 => '贷款', 1 => '全款');
private $cfTitleAry = array('平台分配', '自有资源');
public function __construct()
{
@@ -17,6 +15,7 @@ class OrdersList
$this->ci->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
$this->ci->load->model("biz/biz_model");
$this->ci->load->model('auto/auto_series_model');
$this->ci->load->model('auto/auto_brand_model');
@@ -25,18 +24,25 @@ class OrdersList
public function lists($status_pid, $params = array())
{
$result = array();
$result = $show_info = array();
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['cf_clues'] && $params['cf_clues'] = '';
!$params['payway'] && $params['payway'] = '';
$fieldAry = $this->get_fields($status_pid);
$show_info['cfTitleAry'] = $this->ci->mdCustomers->get_sdata('cfrom');//来源类型
$show_info['cfCluesAry'] = $this->ci->mdCustomers->get_sdata('cfrom_clues');//线下来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
//渠道经理
$qdjl_lists = $this->ci->mdLichebUsers->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name');
$show_info['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 || $status_pid == 7) {
if ($status_pid) {
$params['status'] = $status_pid;
}
$result = $this->orders($params);
$result['qdjl_lists'] = $qdjl_lists;
$result['paywayAry'] = $this->paywayAry;
$result['cfTitleAry'] = $this->cfTitleAry;
$result['show_info'] = $show_info;
$result['fieldAry'] = $fieldAry;
return $result;
}
if ($status_pid == 0) {
@@ -58,9 +64,8 @@ class OrdersList
$this->ci->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
$result = $this->delivery($status_pid, $params);
}
$result['qdjl_lists'] = $qdjl_lists;
$result['paywayAry'] = $this->paywayAry;
$result['cfTitleAry'] = $this->cfTitleAry;
$result['show_info'] = $show_info;
$result['fieldAry'] = $fieldAry;
return $result;
}
@@ -76,22 +81,45 @@ class OrdersList
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$status_arr = $this->ci->mdOrders->statusAry();
$view_type = 'orders';
if ($params['status']) {
$where = ["status" => $params['status']];
$_title = $status_arr[$params['status']]['name'];
$view = 'receiver/order/deal/lists';
$view = 'receiver/order/lists';
if ($params['status'] == 6) {
$view_type = 'deal';
} else if ($params['status'] == 7) {
$view_type = 'refund';
}
} else {
$where = ["status>=" => 0];
$_title = '全部订单';
$view = 'receiver/orders/lists';
}
$where['biz_id!='] = 1;
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
$where['biz_id<>'] = 1;
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where['rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where['rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["payway"] = $params['payway'];
@@ -206,26 +234,31 @@ class OrdersList
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['price'] = number_format($val['price'], 2);
$val['deposit'] = number_format($val['deposit'], 2);
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']]['name'];
$val['biz_name'] = $bizs[$val['biz_id']];
$val['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($val['price'], 2);
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']]['name'];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $_title : $_title . '列表';
$view_type != 'orders' && $status_arr = [];
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => $view, '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => $view, 'view_type' => $view_type, '_title' => $_title);
}
/**
@@ -246,12 +279,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -346,7 +396,6 @@ class OrdersList
$where['admin_id'] = -1;
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
@@ -403,28 +452,32 @@ class OrdersList
}
}
foreach ($rows as $key => $val) {
$fields = array();
$admin = $map_admin[$val['admin_id']];
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']];
$val['admin_name'] = $admin ? $admin['uname'] : '';
$val['price'] = $val['price'] > 1 ? number_format($val['price']) : number_format($val['price'], 2);
$val['deposit'] = $val['deposit'] > 1 ? number_format($val['deposit']) : number_format($val['deposit'], 2);
$val['biz_name'] = $map_biz[$admin['biz_id']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['admin_name'] = $admin ? $admin['uname'] : '';
$fields['price'] = $val['price'] > 1 ? number_format($val['price']) : number_format($val['price'], 2);
$fields['deposit'] = $val['deposit'] > 1 ? number_format($val['deposit']) : number_format($val['deposit'], 2);
$fields['biz_name'] = $map_biz[$admin['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/sign/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'sign', '_title' => $_title);
}
/**
@@ -445,12 +498,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -564,20 +634,24 @@ class OrdersList
$finance_arr = array_column($rows, 'finance_id');
$finance_rows = $this->ci->sys_finance_model->get_map_by_ids($finance_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$money_json = json_decode($val['money_json'], true);
$price_loan = $money_json['price_loan'] ? $money_json['price_loan'] : 0;
$val['title'] = $finance_rows[$val['finance_id']] ? $finance_rows[$val['finance_id']][0]['title'] : '';
$val['price_loan'] = number_format($price_loan, 2);
$val['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$val['status_name'] = $status_arr[$val['status']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['title'] = $finance_rows[$val['finance_id']] ? $finance_rows[$val['finance_id']][0]['title'] : '';
$fields['price_loan'] = number_format($price_loan, 2);
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['status_name'] = $status_arr[$val['status']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/loan/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'loan', '_title' => $_title);
}
/**
@@ -598,12 +672,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -730,25 +821,29 @@ class OrdersList
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['price'] = number_format($val['price'], 2);
$val['deposit'] = number_format($val['deposit'], 2);
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']];
$val['biz_name'] = $bizs[$val['biz_id']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['o_id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($val['price'], 2);
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/ckcar/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'ckcar', '_title' => $_title);
}
/**
@@ -769,12 +864,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -901,25 +1013,29 @@ class OrdersList
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['price'] = number_format($val['price'], 2);
$val['deposit'] = number_format($val['deposit'], 2);
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']];
$val['biz_name'] = $bizs[$val['biz_id']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['o_id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($val['price'], 2);
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/bill/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'bill', '_title' => $_title);
}
/**
@@ -940,12 +1056,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -1072,25 +1205,29 @@ class OrdersList
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['price'] = number_format($val['price'], 2);
$val['deposit'] = number_format($val['deposit'], 2);
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']];
$val['biz_name'] = $bizs[$val['biz_id']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['o_id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($val['price'], 2);
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/agent/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'agent', '_title' => $_title);
}
/**
@@ -1111,12 +1248,29 @@ class OrdersList
"$t2.status>=" => 0,
"$t2.biz_id!=" => 1,
];
if($_SESSION['admin_info']['biz_id']){
$biz_ids = implode(',',$_SESSION['admin_info']['biz_id']);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["$t2.biz_id in ($biz_ids)"] = null;
}
if ($params['cf_title']) {
$where[$t2.'.rid in (select id from lc_receiver_customers where cf_title = "' . $params['cf_title'] . '")'] = null;
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$t2}.payway"] = $params['payway'];
@@ -1243,27 +1397,76 @@ class OrdersList
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$val['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$val['price'] = number_format($val['price'], 2);
$val['deposit'] = number_format($val['deposit'], 2);
$val['payway_name'] = $this->paywayAry[$val['payway']];
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$val['status_name'] = $status_arr[$val['status']];
$val['biz_name'] = $bizs[$val['biz_id']];
$val['cf_title'] = $customers[$val['rid']];
$lists[] = $val;
$fields['mobile'] = $val['mobile'];
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="/receiver/orders/get?id=' . $val['o_id'] . '">' . $val['name'] . '<br>' . $val['mobile'] . '</a>';
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($val['price'], 2);
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $statusAry['name'] : $statusAry['name'] . '列表';
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/delivery/lists', '_title' => $_title);
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/lists', 'view_type' => 'delivery', '_title' => $_title);
}
/**
* Notes:获取字段
* Created on: 2021/10/29 15:38
* Created by: dengbw
* @param $status_pid
* @param int $export
* @return array
*/
public function get_fields($status_pid, $export = 0)
{
$fields1 = $fields2 = [];
if ($export) {
$fields1['name'] = ['title' => '客户姓名'];
$fields1['mobile'] = ['title' => '客户电话'];
} else {
$fields1['name'] = ['title' => '客户', 'width' => '14%'];
}
if (strlen($status_pid) && $status_pid == 0) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '22%'],
'biz_name' => ['title' => '门店', 'width' => '10%'], 'price' => ['title' => '合同价', 'width' => '7%'],
'deposit' => ['title' => '定金', 'width' => '7%'], 'payway_name' => ['title' => '付款', 'width' => '5%'],
'admin_name' => ['title' => '销售员', 'width' => '7%'], 'cf_title' => ['title' => '来源类型', 'width' => '8%'],
'status_name' => ['title' => '合同状态', 'width' => '7%'], 'c_time' => ['title' => '订单时间', 'width' => '12%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 1) {
$fields2 = ['title' => ['title' => '分期产品', 'width' => '15%'],
'price_loan' => ['title' => '贷款金额', 'width' => '10%'], 'c_time' => ['title' => '分期时间', 'width' => '7%'],
'cf_title' => ['title' => '来源类型', 'width' => '10%'], 'status_name' => ['title' => '状态', 'width' => '10%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 2 || $status_pid == 3 || $status_pid == 4 || $status_pid == 5) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'deposit' => ['title' => '定金', 'width' => '8%'], 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'status_name' => ['title' => '状态', 'width' => '9%']];
$fields = array_merge($fields1, $fields2);
} else {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'deposit' => ['title' => '定金', 'width' => '8%'], 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'status_name' => ['title' => '状态', 'width' => '9%'],
'c_time' => ['title' => '订单时间', 'width' => '9%']];
$fields = array_merge($fields1, $fields2);
}
return $fields;
}
}
+4 -5
View File
@@ -37,11 +37,9 @@
<div class="am-form-group fl">
<label class="am-para-label w100">来源类型:</label>
<div class="am-form-group am-para-inline w120">
<select name="cf_title" id="cf_time">
<option value="">全部类型</option>
<option value="平台分配" <?= $params['cf_title'] == '平台分配' ? 'selected' : '' ?>>平台分配</option>
<option value="自有资源" <?= $params['cf_title'] == '自有资源' ? 'selected' : '' ?>>自有资源</option>
<option value="素材推广" <?= $params['cf_title'] == '素材推广' ? 'selected' : '' ?>>素材推广</option>
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
@@ -355,6 +353,7 @@
that.cfrom_id2 = 0;
that.params.city_id_admin = '';
that.params.cf_clues = '';
that.params.cf_title = '';
$('#cf_time').val('');
$(".order-times").map(function () {
var id = this.value;
+598
View File
@@ -0,0 +1,598 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<? if ($params['list_type'] == 'all') { ?>
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/orders">
全部
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
</a>
</li>
<? foreach ($status_arr as $v) { ?>
<li role="presentation"
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
<? if ($v['cate']) { ?>
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
</a>
<ul class="dropdown-menu">
<? if ($v['cate']) { ?>
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
全部
</a>
</li>
<? } ?>
<? foreach ($v['cate'] as $v2) { ?>
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
<?= $v2['name'] ?>
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
</a>
</li>
<? } ?>
</ul>
<? } else { ?>
<a href="javascript:void (0);"
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
</a>
<? } ?>
</li>
<? } ?>
</ul>
</div>
<? } else if ($status_arr && count($status_arr) > 1) { ?>
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($status_arr as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/order/<?= $view_type ?>?status=<?= $key ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<? } ?>
<div class="coms-table-wrap mt10">
<? if ($params['list_type'] == 'all') { ?>
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/receiver/orders">
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
<? } else { ?>
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/receiver/order/<?= $view_type ?>">
<? } ?>
<input type="hidden" name="status" value="<?= $params['status'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w260">
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">订单时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
placeholder="订单时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">来源类型:</label>
<div class="am-para-inline w100">
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线下来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_clues" v-model="params.cf_clues">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线上来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">付款方式:</label>
<div class="am-para-inline w100">
<select name="payway" v-model="params.payway">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.paywayAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select name="brand_id" v-model="params.brand_id">
<option value="">选择品牌</option>
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="s_id" v-model="params.s_id">
<option value="">选择车系</option>
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="v_id" v-model="params.v_id">
<option value="">选择车型</option>
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="cor_id" v-model="params.cor_id">
<option value="">车身颜色</option>
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">销售员:</label>
<div class="am-para-inline w120">
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="biz_id_admin" v-model="params.biz_id_admin">
<option value="">门店</option>
<template v-for="(v,i) in admins.bizAry">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-para-inline w120">
<select name="admin_id" v-model="params.admin_id">
<option value="">销售员</option>
<template v-for="(v,i) in admins.list">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out" class="am-btn am-btn-success am-btn-sm w100">导出
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="am-form-group fr mr10">
<span>共<?= intval($pager['totle']) ?>个订单</span>
</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<? foreach ($fieldAry as $v) { ?>
<th width="<?= $v['width'] ?>"><span><?= $v['title'] ?></span></th>
<? } ?>
</tr>
</thead>
<tbody>
<? foreach ($lists as $v) { ?>
<tr>
<? foreach ($fieldAry as $key => $val) { ?>
<td><?= $v[$key] ?></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
}
$('#id-create-time').val(date);
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: [],
searchTpAry: [],
brandAry: [],
seryAry: [],
attrvAry: [],
attrcorAry: [],//车身颜色选项
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
lists: [],
show_info: {cfTitleAry: [], qdjl_lists: []},
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.getCfroms();
vm.init_brands();
vm.init_citys();
},
methods: {
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
export_out: function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
<? if ($params['list_type'] == 'all') { ?>
href = href.replace("orders?", "order/<?= $view_type ?>/export?") + "<?='&list_type=' . $params['list_type']?>";
<?}else{?>
href = href.replace("<?= $view_type ?>?", "<?= $view_type ?>/export?");
<?}?>
window.location.href = href;
},
init_brands: function () {
var vm = this;
$.ajax({
url: '/auto/brand/json_lists',
type: 'post',
dataType: 'json',
data: {status: 1},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
vm.brandAry = data.data.list;
}
},
complete: function () {
}
});
},
init_citys: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: '350',
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
vm.admins.cityAry = JSON.parse(JSON.stringify(response.data));
}
}
});
},
reset: function () {
var that = this;
$("#search_tp").val('name');
$("#title").val('');
$("#id-create-time").val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.cf_title = '';
that.params.cf_clues = '';
that.params.payway = '';
that.params.brand_id = '';
that.params.city_id_admin = '';
that.params.qdjl_id = '';
}
},
watch: {
'cfrom_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
} else {
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
}
},
'params.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
if (nv > 0) {
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id: nv},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
for (var i in lists) {
var row = lists[i];
seryAry[row.id] = row.name;
}
vm.seryAry = lists;
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
vm.params.s_id = '';
}
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
} else {
vm.params.s_id = '';
}
},
'params.s_id': function (nv, ov) {
var vm = this;
if (nv > 0) {
//车身颜色
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: nv,
status: 1,
type: 0
},
success: function (response) {
if (response.code == 1) {
vm.attrcorAry = response.data.list;
}
}
});
//型号
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: nv,
status: 1,
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.attrvAry = response.data.list;
}
}
});
} else {
vm.attrcorAry = [];
vm.attrvAry = [];
vm.params.cor_id = '';
vm.params.v_id = '';
}
},
'params.city_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.countyAry = [];
that.params.county_id_admin = '';
} else {
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
that.params.county_id_admin = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.countyAry = response.data;
}
}
});
}
},
'params.county_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.bizAry = [];
that.params.biz_id_admin = '';
} else {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
city_id: that.params.city_id_admin,
county_id: that.params.county_id_admin,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.bizAry = response.data.list;
if (that.params.biz_id_admin > 0) {
var biz_id = '';
for (var i in that.admins.bizAry) {
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
biz_id = that.params.biz_id_admin;
break;
}
}
that.params.biz_id_admin = biz_id;
}
}
}
});
}
},
'params.biz_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.list = [];
that.params.admin_id = '';
} else {
$.ajax({
type: 'post',
url: '/app/licheb/member/json_lists',
dataType: 'json',
data: {
biz_id: nv,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.list = response.data.list;
if (that.params.admin_id > 0) {
var admin_id = '';
for (var i in that.admins.list) {
if (that.params.admin_id == that.admins.list[i].id) {
admin_id = that.params.admin_id;
break;
}
}
that.params.admin_id = admin_id;
}
}
}
});
}
}
}
});
<?php page_script($pager) ?>
});
</script>
+105 -41
View File
@@ -86,6 +86,62 @@
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">来源类型:</label>
<div class="am-para-inline w100">
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线下来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_clues" v-model="params.cf_clues">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线上来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">付款方式:</label>
<div class="am-para-inline w100">
<select name="payway" v-model="params.payway">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.paywayAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
@@ -113,30 +169,6 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">付款方式:</label>
<div class="am-para-inline w100">
<select name="payway" id="payway">
<option value="">全部</option>
<?php foreach ($paywayAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= strlen($params['payway']) && $key == $params['payway'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">客户来源:</label>
<div class="am-para-inline w100">
<select name="cf_title" id="cf_title">
<option value="">全部</option>
<?php foreach ($cfTitleAry as $key => $value) { ?>
<option value="<?= $value ?>"
<?= strlen($params['cf_title']) && $value == $params['cf_title'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">销售员:</label>
@@ -169,15 +201,6 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
@@ -196,7 +219,7 @@
<div class="coms-table-bd">
<div class="am-form-group fr mr10">
<span>共<?= intval($pager['totle']) ?>个客户</span>
<span>共<?= intval($pager['totle']) ?>个订单</span>
</div>
<table class="am-table am-table-bordered">
<thead>
@@ -216,9 +239,7 @@
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['id'] ?>">
<?= $v['name'] . '<br>' . $v['mobile'] ?></a>
</td>
<td><?= $v['name'] ?></td>
<td><?= $v['car_name'] ?></td>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['price'] ?></td>
@@ -280,17 +301,34 @@
attrcorAry: [],//车身颜色选项
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
lists: [],
qdjl_lists: []
show_info: {cfTitleAry: [], qdjl_lists: []},
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.getCfroms();
vm.init_brands();
vm.init_citys();
},
methods: {
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
export_out: function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
@@ -343,14 +381,40 @@
$("#search_tp").val('name');
$("#title").val('');
$("#id-create-time").val('');
$("#payway").val('');
$("#cf_title").val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.cf_title = '';
that.params.cf_clues = '';
that.params.payway = '';
that.params.brand_id = '';
that.params.city_id_admin = '';
that.params.qdjl_id = '';
}
},
watch: {
'cfrom_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
} else {
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
}
},
'params.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};