Commit 75bee767 by 朱继来

Merge branch 'zjl_action_log_20190116' into development

parents bd6b8ce5 97fb1f12
...@@ -624,12 +624,16 @@ Class AddOrderController extends Controller ...@@ -624,12 +624,16 @@ Class AddOrderController extends Controller
$type_val = '自营'; $type_val = '自营';
} }
if (count($map) != count($excel[0])) return ['errcode' => 1, 'errmsg' => '导入模板错误,需导入'.$type_val.'模板']; if (count($map) != count($excel[0])) {
errorLog(Error::E_IMPORT_TEMP_ERR, '导入模板错误,需导入'.$type_val.'模板');
return ['errcode' => 1, 'errmsg' => '导入模板错误,需导入'.$type_val.'模板'];
}
// 验证excel内容 // 验证excel内容
$valid = $this->excelValid($excel); $valid = $this->excelValid($excel);
if ($valid['errcode'] != 0) { if ($valid['errcode'] != 0) {
errorLog(Error::E_IMPORT_VALID_FAILED, $valid['errmsg']);
return $valid; return $valid;
} }
......
...@@ -17,4 +17,6 @@ class Error ...@@ -17,4 +17,6 @@ class Error
const E_ADD_FAILED = -10011; // 添加失败 const E_ADD_FAILED = -10011; // 添加失败
const E_UPDATE_FAILED = -10012; // 更新失败 const E_UPDATE_FAILED = -10012; // 更新失败
const E_IMPORT_TEMP_ERR = -10013; // 导入模板错误
const E_IMPORT_VALID_FAILED = -10014; // 导入验证失败
}; };
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class OrderActionLogModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_order_action_log';
protected $primaryKey = 'log_id';
public $timestamps = false;
/**
* 操作记录
* @param [Integer] $order_id [订单ID]
* @param [Integer] $operator_id [操作人]
* @param [Integer] $operator_type [操作人类型:1.网站用户,2.CMS用户, 3-系统定时任务,4-ERP,5-WMS,6-中金]
* @param [string] $event [操作事件]
* @return [type] [description]
*/
public function addLog($order_id, $operator_id, $operator_type = 1, $event='')
{
$log['order_id'] = $order_id;
$log['operator_id'] = $operator_id;
$log['operator_type'] = $operator_type;
$log['event'] = $event;
$log['ip'] = get_client_ip(0, true);
$log['create_time'] = time();
$actionLog = $this->insert($log);
if (!$actionLog) return false;
return $actionLog;
}
}
\ No newline at end of file
...@@ -51,12 +51,6 @@ class OrderModel extends Model ...@@ -51,12 +51,6 @@ class OrderModel extends Model
/* 临时添加 所有人只能查看线上订单 */ /* 临时添加 所有人只能查看线上订单 */
$map['online_order'] = 1; $map['online_order'] = 1;
if ($map['order_goods_type'] == 1) {
$sale_name = '推送业务员';
} else {
$sale_name = '客服';
}
// 非竞调账号,则查看真实数据 // 非竞调账号,则查看真实数据
if ($info['username'] != 'vpadmin@ichunt.com') { if ($info['username'] != 'vpadmin@ichunt.com') {
$map['is_fake'] = 0; $map['is_fake'] = 0;
...@@ -237,7 +231,7 @@ class OrderModel extends Model ...@@ -237,7 +231,7 @@ class OrderModel extends Model
}) })
->where('it.status', '<>', -1) ->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type']) ->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.single_pre_price', 'it.brand_name', 'it.supplier_name', 'it.order_source as items_source', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.tax_title', 'i.inv_type', 'i.invoice_status', 'i.tax_title', 'i.company_address', 'i.company_phone', 'i.tax_no', 'i.bank_name', 'i.bank_account', 'a.consignee', 'a.address', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'u.is_new', 'c.com_name', 'oe.send_remark', 'oe.is_new as is_new_order') ->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.single_pre_price', 'it.brand_name', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_type', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.tax_title', 'i.inv_type', 'i.invoice_status', 'i.tax_title', 'i.company_address', 'i.company_phone', 'i.tax_no', 'i.bank_name', 'i.bank_account', 'a.consignee', 'a.address', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'u.is_new', 'c.com_name', 'oe.send_remark', 'oe.is_new as is_new_order')
->groupBy('it.rec_id') ->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC') ->orderBy('o.create_time', 'DESC')
->get() ->get()
...@@ -247,11 +241,17 @@ class OrderModel extends Model ...@@ -247,11 +241,17 @@ class OrderModel extends Model
// 订单数据处理 // 订单数据处理
$cellData = $this->exportList($list); $cellData = $this->exportList($list);
if ($map['order_goods_type'] == 1) {
$sale_name = '推送业务员';
} else {
$sale_name = '客服';
}
// 标题 // 标题
if ($map['order_goods_type'] == 1) { if ($map['order_goods_type'] == 1) {
$headerCell = ['订单ID', '订单编号', '会员账号', '是否为新订单', '收货人', '下单日期', '下单时间', '客户名称', '明细来源', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注']; $headerCell = ['订单ID', '订单编号', '会员账号', '是否为新订单', '收货人', '下单日期', '下单时间', '客户名称', '平台来源', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注'];
} else { } else {
$headerCell = ['订单ID', '订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '明细来源', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注']; $headerCell = ['订单ID', '订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '平台来源', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注'];
} }
array_unshift($cellData, $headerCell); array_unshift($cellData, $headerCell);
...@@ -345,7 +345,7 @@ class OrderModel extends Model ...@@ -345,7 +345,7 @@ class OrderModel extends Model
$tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]['create_time']); $tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]['create_time']);
$tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]['create_time']); $tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]['create_time']);
$tmp[$i]['com_name'] = !empty($order[$i]['tax_title']) ? $order[$i]['tax_title'] : $order[$i]['com_name']; $tmp[$i]['com_name'] = !empty($order[$i]['tax_title']) ? $order[$i]['tax_title'] : $order[$i]['com_name'];
$tmp[$i]['items_source'] = $order[$i]['items_source']; $tmp[$i]['items_source'] = $this->getOrderSource($order[$i]['order_id'], $order[$i]['order_type']);
// 自营商品名称换成商品型号 // 自营商品名称换成商品型号
$tmp[$i]['goods_name'] = $order[$i]['order_goods_type'] == 1 ? $order[$i]['goods_name'] : $this->getGoodsName($order[$i]['goods_id']); $tmp[$i]['goods_name'] = $order[$i]['order_goods_type'] == 1 ? $order[$i]['goods_name'] : $this->getGoodsName($order[$i]['goods_id']);
...@@ -425,4 +425,39 @@ class OrderModel extends Model ...@@ -425,4 +425,39 @@ class OrderModel extends Model
return $price ? $price->price : 0; return $price ? $price->price : 0;
} }
// 获取订单来源
public function getOrderSource($order_id, $order_type=1)
{
if ($order_type == 1) {
$order = DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->select('order_type')->first();
if ($order) {
switch ($order->order_type) {
case 1:
case 2:
case 3:
return '后台';
}
}
$order_source = $this->where('order_id', $order_id)->select('order_source')->first();
if (preg_match('/pf=1/', $order_source->order_source)) {
$source = 'PC端';
} else if (preg_match('/pf=2/', $order_source->order_source)) {
$source = '移动端';
} else if (preg_match('/pf=6/', $order_source->order_source)) {
$source = '小程序';
} else {
$source = '未知';
}
return $source;
} else if ($order_type == 3) {
return '京东';
}
return false;
}
} }
\ No newline at end of file
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
$('.update_express').click(function(){ $('.update_express').click(function(){
var content = '<div class="form-group">'+ var content = '<div class="form-group">'+
'<label>深圳市内:</label>'+ '<label>深圳市内:</label>'+
'<input type="text" name="sz_inside" class="sz_inside" value="" placeholder="输入快递费用,如20.00" style="width:70%;">'+ '<input type="text" name="sz_inside" class="sz_inside" value="'+express_fee.sz_inside+'" placeholder="输入快递费用,如20.00" style="width:70%;">'+
'</div>'+ '</div>'+
'<div class="form-group">'+ '<div class="form-group">'+
'<label>广东省内:</label>'+ '<label>广东省内:</label>'+
'<input type="text" name="gd_inside" class="gd_inside" value="" placeholder="输入快递费用,如20.00" style="width:70%;">'+ '<input type="text" name="gd_inside" class="gd_inside" value="'+express_fee.gd_inside+'" placeholder="输入快递费用,如20.00" style="width:70%;">'+
'</div>'+ '</div>'+
'<div class="form-group">'+ '<div class="form-group">'+
'<label>广东省外:</label>'+ '<label>广东省外:</label>'+
'<input type="text" name="gd_outside" class="gd_outside" value="" placeholder="输入快递费用,如20.00" style="width:70%;">'+ '<input type="text" name="gd_outside" class="gd_outside" value="'+express_fee.gd_outside+'" placeholder="输入快递费用,如20.00" style="width:70%;">'+
'</div>'; '</div>';
layer.open({ layer.open({
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 首页</title> <title>订单管理后台 | 账期申请列表</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script> <script>document.domain="{{ Config::get('website.domain') }}";</script>
<link href="/js/layui/css/layui.css" rel="stylesheet"> <link href="/js/layui/css/layui.css" rel="stylesheet">
@include('index.css') @include('index.css')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 首页</title> <title>订单管理后台 | PCB首页</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script> <script>document.domain="{{ Config::get('website.domain') }}";</script>
<link href="/js/layui/css/layui.css" rel="stylesheet"> <link href="/js/layui/css/layui.css" rel="stylesheet">
@include('index.css') @include('index.css')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">是否包括测试:</label> <label class="layui-form-label">是否包括测试:</label>
<div class="layui-input-inline"> <div class="layui-input-inline" style="top:9px">
<input type="checkbox" lay-ignore name="test_order" <?php if (@$_GET['test_order']) echo "checked='checked'" ?> > <input type="checkbox" lay-ignore name="test_order" <?php if (@$_GET['test_order']) echo "checked='checked'" ?> >
</div> </div>
</div> </div>
......
...@@ -568,7 +568,7 @@ ...@@ -568,7 +568,7 @@
</div> </div>
<?php $client_source = App\Http\Controllers\clientSource($order_info['user_id']); ?> <?php $client_source = App\Http\Controllers\clientSource($order_info['user_id']); ?>
@if (!empty($client_source) || $order_info['status'] == -1) @if (!empty($client_source))
<div class="tabs-box table-responsive"> <div class="tabs-box table-responsive">
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
@if (!empty($client_source)) @if (!empty($client_source))
...@@ -577,13 +577,6 @@ ...@@ -577,13 +577,6 @@
<td colspan="3">{{ $client_source }}</td> <td colspan="3">{{ $client_source }}</td>
</tr> </tr>
@endif @endif
@if ($order_info['status'] == -1)
<tr>
<td width="10%">订单取消原因:</td>
<td colspan="3">{{ $order_info['cancel_reason'] }}</td>
</tr>
@endif
</table> </table>
</div> </div>
@endif @endif
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 订单统计</title> <title>订单管理后台 | 快递费用配置</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script> <script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('express_set.css') @include('express_set.css')
......
...@@ -34,5 +34,8 @@ ...@@ -34,5 +34,8 @@
</div> </div>
<script> <script>
var express_fee = '<?= json_encode($express_fee) ?>';
express_fee = eval('('+express_fee+')');
$.lie.express.index(); $.lie.express.index();
</script> </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