This commit is contained in:
lin fan
2024-11-23 16:54:37 +08:00
parent ab83c08f21
commit 5f84d59dd4
3 changed files with 20 additions and 6 deletions
@@ -76,7 +76,8 @@ class Order_datas_entity
return ['code' => 0, 'msg' => $result['msg']];
}
$data = $result['data']['CarInvoiceInfos'];
$bill_code = $bill_time = '';
$bill_name = $bill_code = $bill_time = '';
$row = $this->ci->receiver_order_datas_model->get(['o_id' => $oid]);
foreach ($data as $key => $val) {
if ($val['Name'] == '开票日期') {
$bill_time = $val['Value'];
@@ -84,10 +85,20 @@ class Order_datas_entity
if ($val['Name'] == '发票代码') {
$bill_code = $val['Value'];
}
if ($val['Name'] == '购买方名称'){
$bill_name = $val['Value'];
}
}
if (!$bill_code) return ['code' => 0, 'msg' => '未识别到发票代码'];
if (!$bill_code)
return ['code' => 0, 'msg' => '未识别到发票代码'];
if ($bill_name != $row['name'])
return ['code' => 0, 'msg' => '车主信息不一致'];
//更新订单开票时间
$bill_time && $this->ci->orders_model->update(['bill_time' => $bill_time], ['id' => $oid]);
if($bill_time){
$this->ci->orders_model->update(['bill_time' => $bill_time], ['id' => $oid]);
}
return ['code' => 1, 'msg' => '识别成功', 'data' => $data];
}
}