Commit fb807723 by 朱继来

Merge branch 'zjl_order_list_20190902' into development

parents 1b7daf73 94cde224
......@@ -89,13 +89,14 @@ function getInvoiceStatus($order_id)
return $invoice->invoice_status;
}
function getCompanyName($user_id)
// 发票抬头 -> 公司
function getCompanyName($order_id, $user_id)
{
$company = DB::connection('order')
->table('lie_user_company')
->where(['user_id' => $user_id])
->select('com_name')
->first();
$order_invoice = DB::connection('order')->table('lie_order_invoice')->where(['order_id'=>$order_id])->select('tax_title', 'inv_type')->first();
if ($order_invoice->inv_type != 1) return $order_invoice->tax_title;
$company = DB::connection('order')->table('lie_user_company')->where(['user_id' => $user_id])->select('com_name')->first();
if (!$company) return false;
......
......@@ -255,7 +255,7 @@
<tr data-oid="{{ $v['order_id'] }}" data-type="1">
<td class="show-list"><?php print_r(App\Http\Controllers\getAccountName($v['user_id'])); ?></td>
<td class="show-list">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}" style="width: 200px;">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}" style="width: 200px;">{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}</p>
</td>
<td class="show-list">{{$v['order_sn']}}</td>
<td class="show-list">{{$v['erp_order_id']}}</td>
......@@ -356,117 +356,6 @@
</tbody>
</table>
<!-- <table class="table table-hover table-bordered">
<tr>
<td class="table-list-title">公司名称</td>
<td class="table-list-content">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td>
<td class="table-list-title">是否新订单</td>
<td class="table-list-content">
<?php
$is_new_order = App\Http\Controllers\getOrderExtend($v['order_id'], 'is_new');
echo $is_new_order && $is_new_order->is_new ? '是' : '否';
?>
</td>
</tr>
@if ($v['order_pay_type'] == 2)
<tr>
<td class="table-list-title">预付款</td>
<td class="table-list-content">{{$currencySign.$v['advance_amount']}}</td>
<td class="table-list-title">尾款</td>
<td class="table-list-content">{{$currencySign.number_format($v['order_amount'] - $v['advance_amount'], 2, '.', '')}}</td>
</tr>
@endif
<tr>
@if ($v['status'] == 2)
<td class="table-list-title">付款截止时间</td>
@else
<td class="table-list-title">支付时间</td>
@endif
<td class="table-list-content">
<?php
if ($v['status'] == 3) {
if ($username != 'vpadmin@ichunt.com') {
echo $v['advance_pay_time'] != 0 ? date('Y-m-d H:i:s', $v['advance_pay_time']) : '';
} else {
echo $v['advance_pay_time'] != 0 ? date('Y-m-d', $v['advance_pay_time']) : '';
}
} else {
if ($username != 'vpadmin@ichunt.com') {
echo $v['order_pay_time'] != 0 ? date('Y-m-d H:i:s', $v['order_pay_time']) : '';
} else {
echo $v['order_pay_time'] != 0 ? date('Y-m-d', $v['order_pay_time']) : '';
}
}
?>
</td>
<td class="table-list-title">发票状态</td>
<td class="table-list-content">
<?php
$invoice_status = App\Http\Controllers\getInvoiceStatus($v['order_id']);
if ($invoice_status) {
switch ($invoice_status) {
case -1: echo "待确认";break;
case 1: echo "已开票";break;
case 2: echo "已发货";break;
case 3: echo "已签收";break;
}
} else {
echo '';
}
?>
</td>
</tr>
<tr>
<td class="table-list-title">配送方式</td>
<td class="table-list-content">
@if ($v['order_shipping_type'] == '1')
快递配送
@else
自提
@endif
</td>
<td class="table-list-title">优惠金额</td>
<td class="table-list-content"><?php echo App\Http\Controllers\getCoupon($v['order_id']); ?></td>
</tr>
<?php
$shipping = App\Http\Controllers\getShipping($v['order_id']);
$shippingStatus = '';
$shippingNo = '';
if ($shipping) {
foreach ($shipping as $s) {
switch ($s->status) {
case 0:
case 1: $shippingStatus .= '已配送, '; break;
case 2: $shippingStatus .= '已签收, '; break;
default: $shippingStatus .= '未配送, '; break;
}
$shippingNo .= $s->shipping_no ? $s->shipping_no.', ' : '';
}
$shippingStatus = substr($shippingStatus, 0, -2);
}
?>
<tr>
<td class="table-list-title">快递单号</td>
<td class="table-list-content">{{$shippingNo ? substr($shippingNo, 0, -2) : ''}}</td>
<td class="table-list-title">发货状态</td>
<td class="table-list-content">{{$shippingStatus}}</td>
</tr>
<tr>
<td class="table-list-title">Adtag或其它</td>
<td class="table-list-content" colspan="3">
<p><?php echo App\Http\Controllers\handleOrderSource($v['order_source']); ?></p>
</td>
</tr>
</table> -->
</td>
</tr>
@endforeach
......
......@@ -244,7 +244,7 @@
@endif
</td>
<td class="show-list">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}" style="width: 200px;">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}" style="width: 200px;">{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}</p>
</td>
<td class="show-list">{{$v['order_sn']}}</td>
<td class="show-list">
......@@ -350,68 +350,6 @@
</tbody>
</table>
<!-- <table class="table table-hover table-bordered">
<tr>
<td class="table-list-title">公司名称</td>
<td class="table-list-content">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td>
<td class="table-list-title">支付时间</td>
<td class="table-list-content">
<?php
// if ($v['order_pay_time'] != 0) {
// if ($username != 'vpadmin@ichunt.com') {
// echo date('Y-m-d H:i:s', $v['order_pay_time']);
// } else {
// echo date('Y-m-d', $v['order_pay_time']);
// }
// } else {
// if ($v['advance_pay_time'] != 0) {
// if ($username != 'vpadmin@ichunt.com') {
// echo date('Y-m-d H:i:s', $v['advance_pay_time']);
// } else {
// echo date('Y-m-d', $v['advance_pay_time']);
// }
// } else {
// echo '';
// }
// }
?>
</td>
</tr>
<tr>
<td class="table-list-title">发票状态</td>
<td class="table-list-content">
<?php
// $invoice_status = App\Http\Controllers\getInvoiceStatus($v['order_id']);
// if ($invoice_status) {
// switch ($invoice_status) {
// case -1: echo "待确认";break;
// case 1: echo "已开票";break;
// case 2: echo "已发货";break;
// case 3: echo "已签收";break;
// }
// } else {
// echo '';
// }
?>
</td>
<td class="table-list-title">优惠金额</td>
<td class="table-list-content"><?php // echo App\Http\Controllers\getCoupon($v['order_id']); ?></td>
</tr>
<tr>
<td class="table-list-title">快递单号</td>
<td class="table-list-content">{{$shippingNo ? substr($shippingNo, 0, -2) : ''}}</td>
<td class="table-list-title">Adtag或其它</td>
<td class="table-list-content">
<p class="show-title" title="<?php //echo App\Http\Controllers\handleOrderSource($v['order_source']); ?>"><?php //echo App\Http\Controllers\handleOrderSource($v['order_source']); ?></p>
</td>
</tr>
</table> -->
</td>
</tr>
@endforeach
......
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