Commit 926bfbca by 朱继来

添加同步状态

parent c69188f8
...@@ -244,6 +244,7 @@ Class OrderController extends Controller ...@@ -244,6 +244,7 @@ Class OrderController extends Controller
// $map['order_pay_status'] = $request->input('order_pay_status', ''); // $map['order_pay_status'] = $request->input('order_pay_status', '');
$map['order_source_pf'] = $request->input('order_source_pf', ''); $map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', ''); $map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_erp_syn'] = $request->input('order_erp_syn', '');
} }
// 若没有'查看线下订单'权限,则仅查看线上订单 // 若没有'查看线下订单'权限,则仅查看线上订单
...@@ -396,6 +397,7 @@ Class OrderController extends Controller ...@@ -396,6 +397,7 @@ Class OrderController extends Controller
$map['order_type_a'] = $request->input('order_type_a', ''); $map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source_pf'] = $request->input('order_source_pf', ''); $map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', ''); $map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_erp_syn'] = $request->input('order_erp_syn', '');
} }
// 若没有'查看线下订单'权限,则仅查看线上订单 // 若没有'查看线下订单'权限,则仅查看线上订单
...@@ -536,6 +538,12 @@ Class OrderController extends Controller ...@@ -536,6 +538,12 @@ Class OrderController extends Controller
} }
}) })
->where(function ($query) use ($map) { ->where(function ($query) use ($map) {
// 同步状态
if (!empty($map['order_erp_syn'])) {
$query->where('o.erp_syn', '=', $map['order_erp_syn']);
}
})
->where(function ($query) use ($map) {
// 竞调数据 // 竞调数据
if (isset($map['is_fake'])) { if (isset($map['is_fake'])) {
$query->where('o.is_type', '=', $map['is_fake']); $query->where('o.is_type', '=', $map['is_fake']);
...@@ -547,10 +555,10 @@ Class OrderController extends Controller ...@@ -547,10 +555,10 @@ Class OrderController extends Controller
->orderBy('o.create_time', 'DESC') ->orderBy('o.create_time', 'DESC')
->get(); ->get();
if (!empty($list)) {
// 订单数据处理 // 订单数据处理
$export = $this->exportList($list); $export = $this->exportList($list);
if($export){
$xlsName = '订单数据导出'; $xlsName = '订单数据导出';
$xlslist = exportExcel($xlsName, $xlsCell, $export); $xlslist = exportExcel($xlsName, $xlsCell, $export);
$this->$xlslist; $this->$xlslist;
...@@ -615,6 +623,7 @@ Class OrderController extends Controller ...@@ -615,6 +623,7 @@ Class OrderController extends Controller
); );
$i = 0; $i = 0;
$tmp = array();
foreach ($order as $val) { foreach ($order as $val) {
// 推送人 // 推送人
...@@ -644,11 +653,7 @@ Class OrderController extends Controller ...@@ -644,11 +653,7 @@ Class OrderController extends Controller
$i++; $i++;
} }
if (!empty($tmp)) {
return $tmp; return $tmp;
} else {
return false;
}
} }
// 详情页 // 详情页
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
order_source_pf = $('#order_source_pf').data('default'), order_source_pf = $('#order_source_pf').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(), order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'), test_order = $('input[name=test_order]'),
order_erp_syn = $('#order_erp_syn').data('default'),
listUrl = '/list'; listUrl = '/list';
listUrl += '?order_type=' + order_type; listUrl += '?order_type=' + order_type;
...@@ -75,11 +76,15 @@ ...@@ -75,11 +76,15 @@
listUrl += '&order_source_adtag=' + order_source_adtag; listUrl += '&order_source_adtag=' + order_source_adtag;
} }
if (order_erp_syn) {
listUrl += '&order_erp_syn=' + order_erp_syn;
}
if (test_order.is(':checked')) { if (test_order.is(':checked')) {
listUrl += '&test_order=' + 1; listUrl += '&test_order=' + 1;
} }
if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !test_order.is(':checked')) { if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !order_erp_syn && !test_order.is(':checked')) {
listUrl = '/list'; listUrl = '/list';
} }
...@@ -99,15 +104,16 @@ ...@@ -99,15 +104,16 @@
order_send = $('#order_send').data('default'), order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'), order_source_pf = $('#order_source_pf').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(), order_source_adtag = $('input[name="order_source_adtag"]').val(),
order_erp_syn = $('#order_erp_syn').data('default'),
test_order = $('input[name=test_order]'); test_order = $('input[name=test_order]');
if (test_order.length) { if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !test_order.is(':checked')) { if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !order_erp_syn && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!'); layer.msg('请选择筛选条件,再导出!');
return false; return false;
} }
} else { } else {
if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag) { if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !order_erp_syn) {
layer.msg('请选择筛选条件,再导出!'); layer.msg('请选择筛选条件,再导出!');
return false; return false;
} }
...@@ -127,7 +133,7 @@ ...@@ -127,7 +133,7 @@
test_order = ''; test_order = '';
} }
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_pay_type='+order_pay_type+'&order_status='+order_status+'&shipping_name='+shipping_name+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&test_order='+test_order; location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_pay_type='+order_pay_type+'&order_status='+order_status+'&shipping_name='+shipping_name+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&order_erp_syn='+order_erp_syn+'&test_order='+test_order;
}) })
// 选择查看测试订单 // 选择查看测试订单
......
...@@ -129,6 +129,19 @@ ...@@ -129,6 +129,19 @@
<input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容"> <input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容">
</dd> </dd>
</dl> </dl>
<dl>
<dt>同步状态:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_erp_syn']}}" id="order_erp_syn" name="order_erp_syn">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">已同步</li>
<li data-val="-1">不同步</li>
<li data-val="-2">同步失败</li>
</ul>
</div>
</dd>
</dl>
@if (in_array('check_test_order', $userPerms)) @if (in_array('check_test_order', $userPerms))
<dl> <dl>
<dt></dt> <dt></dt>
...@@ -163,7 +176,7 @@ ...@@ -163,7 +176,7 @@
<th class="pl30">支付方式</th> <th class="pl30">支付方式</th>
<th class="pl30">推送业务员</th> <th class="pl30">推送业务员</th>
<th class="pl30">发货状态</th> <th class="pl30">发货状态</th>
<th class="pl30">配送方式</th> <th class="pl30">同步状态</th>
<th class="pl30">下单时间</th> <th class="pl30">下单时间</th>
<th class="pl30">操作</th> <th class="pl30">操作</th>
</tr> </tr>
...@@ -236,13 +249,16 @@ ...@@ -236,13 +249,16 @@
?> ?>
</td> </td>
<td class="show-list"> <td class="show-list">
@if ($v['order_shipping_type'] == '1') <?php
快递配送 switch ($v['erp_syn']) {
@else case -2: echo '同步失败'; break;
自提 case -1: echo '不同步'; break;
@endif case 1: echo '已同步'; break;
default: echo '未配送'; break;
}
?>
</td> </td>
<td class="show-list">{{date('Y-m-d', $v['create_time'])}}</td> <td class="show-list">{{$username != 'vpadmin@ichunt.com' ? date('Y-m-d h:i:s', $v['create_time']) : date('Y-m-d', $v['create_time'])}}</td>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}">详情</a> <a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}">详情</a>
...@@ -280,14 +296,14 @@ ...@@ -280,14 +296,14 @@
<?php <?php
if ($v['order_pay_time'] != 0) { if ($v['order_pay_time'] != 0) {
if ($username != 'vpadmin@ichunt.com') { if ($username != 'vpadmin@ichunt.com') {
echo date('Y-m-d', $v['order_pay_time']); echo date('Y-m-d h:i:s', $v['order_pay_time']);
} else { } else {
echo date('Y-m-d', $v['order_pay_time']); echo date('Y-m-d', $v['order_pay_time']);
} }
} else { } else {
if ($v['advance_pay_time'] != 0) { if ($v['advance_pay_time'] != 0) {
if ($username != 'vpadmin@ichunt.com') { if ($username != 'vpadmin@ichunt.com') {
echo date('Y-m-d', $v['advance_pay_time']); echo date('Y-m-d h:i:s', $v['advance_pay_time']);
} else { } else {
echo date('Y-m-d', $v['advance_pay_time']); echo date('Y-m-d', $v['advance_pay_time']);
} }
...@@ -316,13 +332,23 @@ ...@@ -316,13 +332,23 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="table-list-title">Adtag或其它</td> <td class="table-list-title">配送方式</td>
<td class="table-list-content"> <td class="table-list-content">
<p class="show-title" title="{{$v['order_source']}}">{{$v['order_source']}}</p> @if ($v['order_shipping_type'] == '1')
快递配送
@else
自提
@endif
</td> </td>
<td class="table-list-title">优惠金额</td> <td class="table-list-title">优惠金额</td>
<td class="table-list-content"><?php echo App\Http\Controllers\getCoupon($v['order_id']); ?></td> <td class="table-list-content"><?php echo App\Http\Controllers\getCoupon($v['order_id']); ?></td>
</tr> </tr>
<tr>
<td class="table-list-title">Adtag或其它</td>
<td class="table-list-content" colspan="3">
<p class="show-title" title="{{$v['order_source']}}">{{$v['order_source']}}</p>
</td>
</tr>
</table> </table>
</td> </td>
</tr> </tr>
......
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