Commit 6a6d2739 by 朱继来

fix conflict

parents c7695240 91855c2a
......@@ -107,7 +107,7 @@ Class OrderCountController extends Controller
/**
* 订单数统计
*/
public function count(Request $request)
public function count(Request $request, $type = 1, $view = 'count')
{
$info = $this->getPageInfo($request);
......@@ -116,19 +116,19 @@ Class OrderCountController extends Controller
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array("pf"=>1, "k1"=>$data['k1'], "k2"=>$data['k2']);
$resData = array("pf"=>1, "k1"=>$data['k1'], "k2"=>$data['k2'], 'type'=>$type);
$temp = json_decode(curlApi($url,$resData,"POST"), true);
$info['count'] = $temp['data'];
return view('count', $info);
return view($view, $info);
}
/**
* 金额统计 -- 订单列表
*/
public function amount(Request $request)
public function amount(Request $request, $type = 1, $view = 'amount')
{
$info = $this->getPageInfo($request);
......@@ -144,6 +144,7 @@ Class OrderCountController extends Controller
$map['checkTime'] = $checkTime = $request->input('checkTime', '1'); // 默认选择订单付款时间
$map['checkStatus'] = $checkStatus = $request->input('checkStatus', '1'); // 默认选择查询全部
$map['order_goods_type'] = $type;
// 竞调账号
if ($info['username'] != 'vpadmin@ichunt.com') {
......@@ -184,8 +185,18 @@ Class OrderCountController extends Controller
$info['time_start'] = $time_start;
$info['time_end'] = $time_end;
return view('amount', $info);
return view($view, $info);
}
// 自营订单统计
public function selfCount(REQUEST $request)
{
return $this->count($request, 2, 'self_count');
}
// 自营订单金额统计
public function selfAmount(REQUEST $request)
{
return $this->amount($request, 2, 'self_amount');
}
}
\ No newline at end of file
......@@ -49,7 +49,9 @@
return 2;
} else if ($department->name == '交易员') {
return 3;
} else {
} else if ($department->name == '客服') {
return 4;
}else {
return 0;
}
}
......@@ -235,7 +237,7 @@
foreach ($val as $k => $v) {
if (is_array($v)) {
foreach ($v as $k1 => $v1) {
if (preg_match('/_check/', $v1)) {
if (preg_match('/_check$/', $v1)) {
$menuData[$key][] = $k;
continue;
}
......
......@@ -132,3 +132,17 @@
return $response ? $response : curl_error($ch);
}
/**
* 接口服务时加密方式
* @param [type] $data [description]
* @param [type] $timestamp [description]
* @param [type] $key [description]
* @return [type] [description]
*/
function service_token($data, $timestamp, $key = null)
{
$key = is_null($key) ? Config('website.SERVICE_KEY') : $key;
$token = md5($data.$timestamp.$key);
return $token;
}
......@@ -58,7 +58,13 @@ Route::group(['middleware' => 'web'], function () {
Route::resource('/prompt', 'PromptController@index');
Route::get('/count', 'OrderCountController@count');
Route::get('/self_count', 'OrderCountController@selfCount');
Route::get('/amount', 'OrderCountController@amount');
Route::get('/self_amount', 'OrderCountController@selfAmount');
Route::get('/self_order', 'OrderController@selfOrder');
Route::post('/ajaxSelfCancel', 'OrderController@ajaxSelfCancel');
Route::post('/ajaxSelfExpress', 'OrderController@ajaxSelfExpress');
Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime');
......
<?php
return [
// 菜单权限
'订单管理' => [
'平台订单' => ['orderlist_check', 'export', 'check_order', 'cancel_order', 'check_account', 'order_send', 'send_invoice', 'update_address', 'update_invoice', 'check_test_order', 'check_offline_order'],
'联营订单' => [
'平台订单' => ['orderlist_check', 'export', 'cancel_order', 'check_account', 'order_send', 'update_address', 'update_invoice', 'check_test_order', 'check_order', 'download_contract',],
'ERP订单' => ['erp_order_check'],
],
'自营订单' => [
'订单列表' => ['self_order_check', 'self_order_export', 'self_order_cancel', 'self_order_express', 'self_order_invoice_express', 'self_order_update_address', 'self_order_update_invoice', 'self_check_test_order', 'self_order_download_contract'],
'快递配置' => ['self_order_express_set_check'],
],
'订单统计' => [
'联营订单统计' => ['order_count_check'],
'订单统计' => ['ordercount_check'],
'自营订单统计' => ['self_order_count_check'],
],
];
\ No newline at end of file
......@@ -22,5 +22,11 @@ return [
'check_access_api' => 'http://perm.liexin.net/api/perms/access',
// 竞调账户配置显示时间
'vp_time_set' => '2018-04-01',
'vp_time_set' => '2018-05-01',
// 基石服务地址
'SERVICE_DOMAIN' => 'http://192.168.1.100',
//中间服务秘钥
'SERVICE_KEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp',
];
......@@ -9,11 +9,18 @@
},
bind:function(){
$('.order-amount-search').click(function(){
searchAmount('/amount');
})
$('.self-order-amount-search').click(function(){
searchAmount('/self_amount');
})
function searchAmount(url) {
var checkTime = $('#checkTime').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
checkStatus = $('#checkStatus').val(),
url = '/amount';
time_start = Date.parse(time_start) / 1000;
time_end = Date.parse(time_end) / 1000;
......@@ -21,7 +28,7 @@
url = url+'?checkTime='+checkTime+'&time_start='+time_start+'&time_end='+time_end+'&checkStatus='+checkStatus;
location.href = url;
})
}
}
}
......
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
self:{
index:function(){
$.lie.droplist($('.droplist'));
$('.search_self_order').click(function(){
var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default'),
listUrl = '/self_order';
listUrl += '?order_type=' + order_type;
if (order_contain) {
listUrl += '&order_contain=' + order_contain;
}
if(time_start){
time_start = Date.parse(time_start) / 1000;
listUrl += '&time_start='+time_start;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
listUrl += '&time_end='+time_end;
}
if (order_status) {
listUrl += '&order_status=' + order_status;
}
if (order_send) {
listUrl += '&order_send=' + order_send;
}
if (order_source_pf) {
listUrl += '&order_source_pf=' + order_source_pf;
}
if (order_payment_mode) {
listUrl += '&order_payment_mode=' + order_payment_mode;
}
if (order_invoice_status) {
listUrl += '&order_invoice_status=' + order_invoice_status;
}
if (order_source_adtag) {
listUrl += '&order_source_adtag=' + order_source_adtag;
}
if (erp_order_id) {
listUrl += '&erp_order_id=' + erp_order_id;
}
if (test_order.is(':checked')) {
listUrl += '&test_order=' + 1;
}
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
listUrl = '/self_order';
}
location.href = listUrl;
})
// 导出订单
$('.self_export').click(function() {
var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default');
if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
} else {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
}
if(time_start){
time_start = Date.parse(time_start) / 1000;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
}
if (test_order.is(':checked')) {
test_order = 1;
} else {
test_order = '';
}
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_payment_mode='+order_payment_mode+'&order_status='+order_status+'&order_invoice_status='+order_invoice_status+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&erp_order_id='+erp_order_id+'&test_order='+test_order+'&order_goods_type='+2;
})
// 选择查看测试订单
$('input[name=test_order]').click(function(){
if ($(this).is(':checked')) {
$(this).val(1);
} else {
$(this).val('');
}
})
// 切换类型时,清空输入框内容
$('.dropdown-menu>li').click(function(){
var val = $(this).data('val'); // 当前值
var def = $(this).parents('.droplist').data('default'); // 默认值
if (val != def) {
if ($(this).parents('.droplist').attr('name') == 'order_type') {
$('input[name=order_contain]').val(''); // 清空
}
$(this).parents('.droplist').data('default', val); // 赋值
}
})
// 展示列表下的内容
$('.show-list').click(function(){
var nextTr = $(this).parent('tr').next('.show-other-content');
if (nextTr.css('display') == 'none') {
$(this).parent('tr').siblings('.show-other-content').hide();
nextTr.show();
} else {
nextTr.hide();
}
})
}
}
});
})(jQuery)
\ No newline at end of file
<div class="page-content">
<ul class="nav nav-tabs">
<li><a href="{{URL('count')}}">订单数统计</a></li>
<li><a href="{{URL('count')}}">联营订单数统计</a></li>
<li class="active"><a href="javascript:;">订单金额统计</a></li>
</ul>
<div class="tabs-box">
......
<div class="page-content">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">订单状态概览</a></li>
<li class="active"><a href="javascript:;">联营订单状态概览</a></li>
<li><a href="{{URL('amount')}}">订单金额统计</a></li>
</ul>
<div class="tabs-box">
......
......@@ -66,7 +66,7 @@
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input class="only_positive_nubme num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
<input class="only_positive_nubme only_number num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
</td>
<td>
<input class="price only_number" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['goods_price']}}" value="{{$v['goods_price']}}">
......
......@@ -275,6 +275,16 @@
<!-- 管理员和经理显示 && sale_id为空 && 订单状态为待审核 -->
@if (in_array($role, [1, 2]) && $v['status'] == 1)
<a class="btn btn-info" href="{{URL('sendSales', ['order_id'=>$v['order_id']])}}" target="_blank">推送</a>
<?php
$apiUrl = Config('website.api_domain');
$k1 = time();
$k2 = md5(md5($k1).'fh6y5t4rr351d2c3bryi');
$downLoadUrl = $apiUrl.'contract/pdfinfo?id='.$v['order_id'].'&k1='.$k1.'&k2='.$k2;
?>
@if (in_array('download_contract', $userPerms))
<a class="btn btn-info" href="{{$downLoadUrl}}">下载合同</a>
@endif
</div>
</td>
......@@ -457,4 +467,8 @@
$('.selectpicker').selectpicker('val', order_status.split(',')).trigger("change");
$.lie.order.index();
// 展开菜单
$('#side-menu').children('li').eq(1).addClass('active');
$('#side-menu').children('li').eq(1).children('ul').children('li').eq(0).addClass('active');
</script>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 订单列表</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('selfOrder.css')
@include('selfOrder.js')
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('selfOrder.content')
</div>
</div>
</div>
</body>
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="/layer/skin/layer.css" rel="stylesheet">
<link href="/css/order.css" rel="stylesheet">
<link href="/css/detail.css" rel="stylesheet">
\ No newline at end of file
<script src="/js/jquery-2.2.1.js"></script>
<script src="/js/jquery.form.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/layer/layer.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/inspinia.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/self_order.js"></script>
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 订单统计金额</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('orderlist.css')
@include('orderlist.js')
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('self_amount.content')
</div>
</div>
</div>
</body>
<div class="page-content">
<ul class="nav nav-tabs">
<li><a href="{{URL('self_count')}}">自营订单数统计</a></li>
<li class="active"><a href="javascript:;">订单金额统计</a></li>
</ul>
<div class="tabs-box">
<div class="row-fluid order-amount">
<select name="checkTime" id="checkTime" style="width: 150px; margin-bottom: 0;">
<option value="1">订单付款时间</option>
<option value="2">订单创建时间</option>
</select>
<input type="text" readonly name="time_start" value="{{ !empty($time_start) ? date('Y-m-d H:i:s', $time_start) : '' }}" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
<span> - </span>
<input type="text" readonly name="time_end" value="{{ !empty($time_end) ? date('Y-m-d H:i:s', $time_end) : '' }}" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
<select name="checkStatus" id="checkStatus" style="width: 80px; margin-bottom: 0;">
<option value="1">全部</option>
<option value="2">已完成</option>
<option value="3">未完成</option>
</select>
<button class="btn btn-primary self-order-amount-search">搜索</button>
</div>
</div>
<div class="tabs-box">
<div class="row-fluid">
<table class="table table-bordered">
<tr>
<th>序号</th>
<th>订单号</th>
<th>订单付款时间</th>
<th>交易完成时间</th>
<th>订单金额</th>
</tr>
<empty name="list">
@if (empty($list))
<tr><td colspan="5">没有更多数据~</td></tr>
@else
@foreach ($list as $key => $vo)
<tr>
<td>{{$key + 1}}</td>
<td>{{$vo['order_sn']}}</td>
<td>
<?php
// 全款
if ($vo['order_pay_type'] == 1) {
echo date('Y-m-d H:i:s', $vo['pay_time']);
} else if ($vo['order_pay_type'] == 2) { // 预付款
$exp = explode(',', $vo['pay_time']);
$pay_amount = explode(',', $vo['pay_amount']);
if (count($exp) == 1) {
// 如果有两条金额记录,支付时间只有一条,则首尾款时间一致
if (count($pay_amount) == 2) {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
if ($vo['pay_type'] == 2) {
echo date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)';
}
}
} else {
if ($exp[0] < $exp[1]){
echo date('Y-m-d H:i:s', $exp[1]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[1]).' (首款)';
}
}
}
?>
</td>
<td>
@if ($vo['finish_time'] != 0)
{{date('Y-m-d H:i:s', $vo['finish_time'])}}
@endif
</td>
<td>
<?php
if ($vo['currency'] == 1) {
$currency = '¥';
} else {
$currency = '$';
}
if ($vo['order_pay_type'] == 1) { // 全款
echo $currency.$vo['pay_amount'];
} else if ($vo['order_pay_type'] == 2) { // 预付款
$exp = explode(',', $vo['pay_amount']);
if (count($exp) == 1) {
if ($vo['pay_type'] == 2) {
echo $currency.$exp[0].' (首款)';
} else {
echo $currency.$exp[0].' (尾款)';
}
} else {
if ($exp[0] > $exp[1]) {
echo $currency.$exp[0].' (尾款)<br>'.$currency.$exp[1].' (首款)';
} else {
echo $currency.$exp[1].' (尾款)<br>'.$currency.$exp[0].' (首款)';
}
}
}
?>
</td>
</tr>
@endforeach
@endif
</table>
</div>
<div class="row-fluid pagination">
<span>
@if ($checkStatus == 1)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@elseif ($checkStatus == 2)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
@else
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@endif
</span>
<?php echo isset($page) ? $page : ''; ?>
</div>
</div>
</div>
<script>
$.lie.orderamount.index();
var checkTime = '{{$checkTime}}';
var checkStatus = '{{$checkStatus}}';
$('#checkTime').val(checkTime);
$('#checkStatus').val(checkStatus);
$('#side-menu').children('li').last().attr('class', 'active');
$('#side-menu').children('li').last().children('ul').children('li').eq(2).attr('class', 'active');
</script>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 订单统计</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('orderlist.css')
@include('orderlist.js')
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('self_count.content')
</div>
</div>
</div>
</body>
<div class="page-content">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">自营订单状态概览</a></li>
<li><a href="{{URL('self_amount')}}">订单金额统计</a></li>
</ul>
<div class="tabs-box">
<div class="row-fluid">
<table class="table">
<tr>
<th>时间</th>
<th title = "指定时间内,新创建的订单,不考虑该订单是否有状态变化。">新创建订单数</th>
<th title = "指定时间内,客户完成了所有款项的支付,并系统对账完成的订单数量。(对应待发货状态)">已付款</th>
<th title = "指定时间内,订单完成发货,但客户还未完成收货状态的订单数量。(对应待收货状态)">待收货</th>
<th title = "指定时间内,订单已完成状态的订单数量(对应已完成状态)">已完成</th>
<th title = "指定时间内,订单已取消的订单数量(对应已取消状态) ">已取消</th>
</tr>
<tr>
<td>今日</td>
<td>{{$count['all']['today']}}</td>
<td>{{$count['paid']['today']}}</td>
<td>{{$count['send']['today']}}</td>
<td>{{$count['done']['today']}}</td>
<td>{{$count['cancel']['today']}}</td>
</tr>
<tr>
<td>近7天</td>
<td>{{$count['all']['week']}}</td>
<td>{{$count['paid']['week']}}</td>
<td>{{$count['send']['week']}}</td>
<td>{{$count['done']['week']}}</td>
<td>{{$count['cancel']['week']}}</td>
</tr>
<tr>
<td>近30天</td>
<td>{{$count['all']['month']}}</td>
<td>{{$count['paid']['month']}}</td>
<td>{{$count['send']['month']}}</td>
<td>{{$count['done']['month']}}</td>
<td>{{$count['cancel']['month']}}</td>
</tr>
</table>
</div>
</div>
</div>
<script>
$.lie.order.index();
</script>
\ No newline at end of file
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