Commit 20307cf6 by 朱继来

Merge branch 'zjl_com_name_20210706'

parents c9c02607 666208b2
Showing with 5 additions and 3 deletions
...@@ -100,14 +100,16 @@ function getInvoiceStatus($order_id) ...@@ -100,14 +100,16 @@ function getInvoiceStatus($order_id)
return $invoice->invoice_status; return $invoice->invoice_status;
} }
// 发票抬头 -> 公司 // 发票抬头 -> 合同公司
function getCompanyName($order_id, $user_id) function getCompanyName($order_id, $user_id)
{ {
if (!$user_id) return false; if (!$user_id) return false;
$order_invoice = DB::connection('order')->table('lie_order_invoice')->where(['order_id'=>$order_id])->select('tax_title', 'inv_type')->first(); $tax_title = DB::connection('order')->table('lie_order_invoice')->where('order_id', $order_id)->where('inv_type', '<>', 1)->value('tax_title');
if ($tax_title) return $tax_title;
if ($order_invoice && $order_invoice->inv_type != 1) return $order_invoice->tax_title; $contract_com_name = DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->value('contract_com_name');
if ($contract_com_name) return $contract_com_name;
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment