修改订单图片

This commit is contained in:
lcc
2024-06-17 17:59:08 +08:00
parent f9c5ba6733
commit 2dfd437136
3 changed files with 28 additions and 16 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ class Cusorder extends Wxapp
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$serie_name = isset($series[$val['series_id']]) ? $series[$val['series_id']][0]['name'] : '';
$car_name = isset($cars[$val['car_id']]) ? $cars[$val['car_id']][0]['name'] : '';
$img_status = $this->order_datas_entity->data_status($order_datas[$val['id']][0]);
$img_status = $this->order_datas_entity->data_status($order_datas[$val['id']][0],$val['status']);
$title = "{$brand_name}-{$serie_name}";
$o_data_1 = [
@@ -32,6 +32,7 @@ class Cusorderdata extends Wxapp
$row = $this->orders_model->get(['id' => $id]);
$data = [];
$data['img_status'] = 1;
$data['order_status'] = intval($row['status']);
$row_data = $this->receiver_order_datas_model->get(['o_id' => $id]);
$cardidb = $cardida = $business_licence = $car_img = [];
if ($row_data['car_img']) {
@@ -225,7 +226,12 @@ class Cusorderdata extends Wxapp
$img = $car_img;
$result = $this->tcorc->VehicleLicense(build_qiniu_image_url($car_img));
if (!$result['code']) {
throw new Exception('行驶证识别失败,请重新上传', ERR_PARAMS_ERROR);
// throw new Exception('行驶证识别失败,请重新上传', ERR_PARAMS_ERROR);
$res_data['code'] = API_CODE_ORC_FAIL;
$res_data['data'] = [
['car_img' => false, 'errmsg' => '行驶证识别失败,请重新上传'],
];
return $res_data;
}
$jsondata['car_info'] = $result['data']['FrontInfo'];
$update['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
@@ -11,7 +11,7 @@ class Order_datas_entity
private $ci;
const COLOR_UN_UPLOAD = '#c1b8b9'; //未传
const COLOR_IS_UPLOAD = '#fd9737'; //已传
const COLOR_IS_UPLOAD = '#ff0000'; //已传
const COLOR_UN_CHECK = '#f9394d'; //未通过
const COLOR_CHECK = '#36afa2'; //通过
@@ -34,24 +34,30 @@ class Order_datas_entity
return $row;
}
public function data_status($o_data)
public function data_status($o_data, $order_status)
{
$result = [
'contract_img' => ['text' => '未传', 'type' => 1, 'color' => self::COLOR_UN_UPLOAD], //合同图片
'pay_img' => ['text' => '未传', 'type' => 1, 'color' => self::COLOR_UN_UPLOAD], //支付凭证
'cardida' => ['text' => '未传', 'type' => 2, 'color' => self::COLOR_UN_UPLOAD], //身份证
'business_licence' => ['text' => '未传', 'type' => 3, 'color' => self::COLOR_UN_UPLOAD], //营业执照
'equity_ck_img' => ['text' => '未传', 'type' => 4, 'color' => self::COLOR_UN_UPLOAD], //权益确认书
'bill_img' => ['text' => '未传', 'type' => 5, 'color' => self::COLOR_UN_UPLOAD], //发票
'delivery_ck_img' => ['text' => '未传', 'type' => 5, 'color' => self::COLOR_UN_UPLOAD], //交车确认图片
'car_img' => ['text' => '未传', 'type' => 5, 'color' => self::COLOR_UN_UPLOAD], //行驶证
'car_auth_img' => ['text' => '未传', 'type' => 5, 'color' => self::COLOR_UN_UPLOAD], //车机实名认证
'insurance_img' => ['text' => '未传', 'type' => 5, 'color' => self::COLOR_UN_UPLOAD], //交强险图片
'contract_img' => ['text' => '未传', 'type' => 0, 'color' => self::COLOR_UN_UPLOAD], //合同图片
'pay_img' => ['text' => '未传', 'type' => 0, 'color' => self::COLOR_UN_UPLOAD], //支付凭证
'cardida' => ['text' => '未传', 'type' => 0, 'color' => self::COLOR_UN_UPLOAD], //身份证
'business_licence' => ['text' => '未传', 'type' => 0, 'color' => self::COLOR_UN_UPLOAD], //营业执照
'equity_ck_img' => ['text' => '未传', 'type' => 0, 'color' => self::COLOR_UN_UPLOAD], //权益确认书
'bill_img' => ['text' => '未传', 'type' => 1, 'color' => self::COLOR_UN_UPLOAD], //发票
'delivery_ck_img' => ['text' => '未传', 'type' => 2, 'color' => self::COLOR_UN_UPLOAD], //交车确认图片
'car_img' => ['text' => '未传', 'type' => 2, 'color' => self::COLOR_UN_UPLOAD], //行驶证
'car_auth_img' => ['text' => '未传', 'type' => 2, 'color' => self::COLOR_UN_UPLOAD], //车机实名认证
'insurance_img' => ['text' => '未传', 'type' => 2, 'color' => self::COLOR_UN_UPLOAD], //交强险图片
];
foreach ($result as $key => $item) {
if ($o_data[$key]) {
$result[$key]['text'] = '已传';
$result[$key]['color'] = self::COLOR_IS_UPLOAD;
if ($order_status > $item['type']) {
$result[$key]['text'] = '已审核';
$result[$key]['color'] = self::COLOR_CHECK;
} else {
$result[$key]['text'] = '已传';
$result[$key]['color'] = self::COLOR_IS_UPLOAD;
}
}
}
return $result;