Files
liche/api/controllers/wxapp/licheb/Protocol.php
T
2021-08-06 17:22:31 +08:00

113 lines
5.3 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim
* User: lcc
* Date: 2021/07/07
* Time: 14:08
*/
class Protocol extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model('receiver/order/receiver_orders_model','orders_model');
$this->load->model('receiver/order/receiver_order_contracts_model','contracts_model');
$this->load->model('receiver/order/receiver_order_agents_model','agents_model');
$this->load->model('receiver/order/receiver_order_loans_model','loans_model');
$this->load->model('receiver/order/receiver_order_ckcars_model','ckcars_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model("items/items_model");
}
//整车合同
public function car(){
$wxapp = $this->input->get('wxapp');
//$id = $this->input->get('id');
//$row = $this->orders_model->get(['id'=>$id]);
//$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>0]);
//if($row){
// $brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
// $series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
// $car_json = json_decode($row['car_json'],true);
// $color = isset($car_json['color']) ? $car_json['color']['title'] : '';
// $version = isset($car_json['version']) ? $car_json['version']['title'] : '';
// $row['brand_name'] = $brand['name'].$series['name'].' '.$version;
// $row['color'] = $color;
//}
//$row['day'] = $contract ? date('Y年m月d日',$contract['c_time']):date('Y年m月d日');
//$row['price_rmb'] = num_to_rmb($row['price']);
//$row['cid'] = $contract['cid'];
$folder = $wxapp ? 'protocol' : 'html2pdf';
$this->load->view("wxapp/licheb/{$folder}/car",$row);
}
//代理合同
public function agent(){
$wxapp = $this->input->get('wxapp');
//$id = $this->input->get('id');
//$row = $this->orders_model->get(['id'=>$id]);
//$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>1]);
//$row['day'] = $contract ? date('Y年m月d日',$contract['c_time']):date('Y年m月d日');
//$row['cid'] = $contract['cid'];
$folder = $wxapp ? 'protocol' : 'html2pdf';
$this->load->view("wxapp/licheb/{$folder}/agent",$row);
}
//车辆信息确认单
public function car_ck(){
$wxapp = $this->input->get('wxapp');
//$id = $this->input->get('id');
//$row = $this->orders_model->get(['id'=>$id]);
//if($row){
// $brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
// $series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
// $car_json = json_decode($row['car_json'],true);
// $version = isset($car_json['version']) ? $car_json['version']['title'] : '';
// $row['brand_name'] = $brand['name'].$series['name'].' '.$version;
//}
//$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>2]);
//$items = $this->items_model->get(['id'=>$row['item_id']],'vin');
//$row['day'] = $contract ? date('Y年m月d日',$contract['c_time']):date('Y年m月d日');
//$row['cid'] = $contract['cid'];
//$row['vin'] = $items['vin'];
$folder = $wxapp ? 'protocol' : 'html2pdf';
$this->load->view("wxapp/licheb/{$folder}/car_ck",$row);
}
//车辆交接信息
public function car_fh(){
$this->load->model('app/licheb/app_licheb_users_model');
$wxapp = $this->input->get('wxapp');
//$id = $this->input->get('id');
//$row = $this->orders_model->get(['id'=>$id]);
//$agent = $this->agents_model->get(['o_id'=>$id]);
//$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>3]);
//$items = $this->items_model->get(['id'=>$row['item_id']],'vin');
//if($row){
// //贷款
// if(!$row['payway']){
// $row['loan'] = $this->loans_model->get(['o_id'=>$id]);
// }
// $brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
// $series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
// $car_json = json_decode($row['car_json'],true);
// $info_json = json_decode($row['info_json'],true);
// $color = isset($car_json['color']) ? $car_json['color']['title'] : '';
// $version = isset($car_json['version']) ? $car_json['version']['title'] : '';
// $row['brand_name'] = $brand['name'].$series['name'].' '.$version;
// $row['color'] = $color;
// $row['cardid'] = $info_json['cardid'];
// //获取销售
// $admin = $this->app_licheb_users_model->get(['id'=>$row['admin_id']],'uname');
// $row['uname'] = $admin['uname'];
//}
//$row['agent'] = $agent;
//$row['day'] = $contract ? date('Y年m月d日',$contract['c_time']):date('Y年m月d日');
//$row['cid'] = $contract['cid'];
//$row['vin'] = $items['vin'];
$folder = $wxapp ? 'protocol' : 'html2pdf';
$this->load->view("wxapp/licheb/{$folder}/car_fh",$row);
}
}