111 lines
5.3 KiB
PHP
111 lines
5.3 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: lcc
|
|
* Date: 2022/1/10
|
|
* Time: 16:11
|
|
*/
|
|
class Order_datas_entity{
|
|
|
|
private $ci;
|
|
const COLOR_UN_UPLOAD = '#f9394d'; //未传
|
|
const COLOR_IS_UPLOAD = '#fd9737'; //已传
|
|
const COLOR_UN_CHECK = '#f9394d'; //未通过
|
|
const COLOR_CHECK = '#36afa2'; //通过
|
|
|
|
|
|
public function __construct(){
|
|
$this->ci = & get_instance();
|
|
$this->ci->load->model('receiver/order/receiver_order_datas_model');
|
|
$this->ci->load->model('app/app_checkdata_model');
|
|
}
|
|
|
|
public function data_status($o_data){
|
|
$result = [
|
|
'cardida' => ['text'=>'未传','type'=>1,'color'=>self::COLOR_UN_UPLOAD], //身份证
|
|
'register_img' => ['text'=>'未传','type'=>2,'color'=>self::COLOR_UN_UPLOAD], //登记证
|
|
'car_img' => ['text'=>'未传','type'=>3,'color'=>self::COLOR_UN_UPLOAD], //行驶证
|
|
'ins_img' => ['text'=>'未传','type'=>4,'color'=>self::COLOR_UN_UPLOAD], //保单证
|
|
'other_img' => ['text'=>'未传','type'=>5,'color'=>self::COLOR_UN_UPLOAD], //交车合照
|
|
];
|
|
// $where = ['cf_id'=>$o_data['id'],'app_id'=>2,'type in (1,2,3,4,5)'=>null,'datatype'=>'img'];
|
|
// $check_data = $this->ci->app_checkdata_model->map('type','',$where,'','','','id,cf_id,type,ifcheck');
|
|
foreach ($result as $key=>$item) {
|
|
if($o_data[$key]){
|
|
$result[$key]['text'] = '已传';
|
|
$result[$key]['color'] = self::COLOR_IS_UPLOAD;
|
|
// if($check_data[$item['type']][0]['ifcheck']==1){
|
|
// $result[$key]['text'] = '已通过';
|
|
// $result[$key]['color'] = self::COLOR_CHECK;
|
|
// }
|
|
// if($check_data[$item['type']][0]['ifcheck']==-1){
|
|
// $result[$key]['text'] = '未通过';
|
|
// $result[$key]['color'] = self::COLOR_UN_CHECK;
|
|
// }
|
|
}
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
//获取图片审核状态
|
|
public function data_ckinfo($o_data,$main_type=0){
|
|
if($main_type){
|
|
$result = [
|
|
'business_licence' => ['text'=>'营业执照','type'=>1,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs' => []], //公司营业执照
|
|
'register_img' => ['text'=>'登记证','type'=>2,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs' => []], //登记证
|
|
'car_img' => ['text'=>'行驶证','type'=>3,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //行驶证
|
|
'ins_img' => ['text'=>'保单证','type'=>4,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //保单证
|
|
'other_img' => ['text'=>'交车合照','type'=>5,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //交车合照
|
|
];
|
|
}else{
|
|
$result = [
|
|
'cardida' => ['text'=>'身份证正面','type'=>1,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs' => []], //身份证
|
|
'register_img' => ['text'=>'登记证','type'=>2,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs' => []], //登记证
|
|
'car_img' => ['text'=>'行驶证','type'=>3,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //行驶证
|
|
'ins_img' => ['text'=>'保单证','type'=>4,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //保单证
|
|
'other_img' => ['text'=>'交车合照','type'=>5,'up_status'=>0,'status'=>0,'status_cn'=>'未审核','imgs'=>[]], //交车合照
|
|
];
|
|
}
|
|
$where = [
|
|
'cf_id'=>$o_data['id'],
|
|
'app_id'=>2,
|
|
'type in (1,2,3,4,5)'=>null,
|
|
'datatype'=>'img'
|
|
];
|
|
$check_data = $this->ci->app_checkdata_model->map('type','',$where,'','','','id,cf_id,type,ifcheck');
|
|
foreach ($result as $key=>$item) {
|
|
if($o_data[$key] || $o_data['cardidb']){
|
|
$result[$key]['up_status'] = 1;
|
|
$ifcheck = $check_data[$item['type']][0]['ifcheck'];
|
|
$imgs = [];
|
|
if($key=='ins_img'||$key=='other_img'){
|
|
$img_data = json_decode($o_data[$key],true);
|
|
if(is_array($img_data)){
|
|
foreach ($img_data as $v) {
|
|
$imgs[] = build_qiniu_image_url($v);
|
|
}
|
|
}
|
|
}else{
|
|
$imgs[] = build_qiniu_image_url($o_data[$key]);
|
|
if($key=='cardida' && $o_data['cardidb']){
|
|
$imgs[1] = build_qiniu_image_url($o_data['cardidb']);
|
|
}
|
|
}
|
|
$result[$key]['imgs'] = $imgs;
|
|
if($ifcheck==1){
|
|
$result[$key]['status_cn'] = '已通过';
|
|
$result[$key]['status'] = 1;
|
|
}elseif($ifcheck==-1){
|
|
$result[$key]['status_cn'] = '未通过';
|
|
$result[$key]['status'] = -1;
|
|
}else{
|
|
$result[$key]['status_cn'] = '未审核';
|
|
$result[$key]['status'] = 0;
|
|
}
|
|
}
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
}
|