作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

合并分支 '1iuzhen' 到 'master'

字段验证逻辑修改、后台订单问题修改、销售订单列表显示数据修改



查看合并请求 !205
... ... @@ -77,6 +77,10 @@ class OrderController extends AdminBaseController
<input type="text" name="" id="address" readonly="readonly" value="{value}" class="baby_input" placeholder="请输入{name}" />
<img src="__TMPL__/public/mobile/images/youjiantou.png" class="jiantou" />
</div>';
$this->sort_model[12] = '<div class="text_item form_options" data-validate="{validate}" data-type="12">
<p class="text_tit"><span class=" _validate">{name}</span>{must}</p>
<input type="text" name="" id="" value="{value}" class="baby_input" placeholder="请输入{name}" />
</div>';
}
/**
... ... @@ -169,8 +173,19 @@ class OrderController extends AdminBaseController
$this->error('参数错误');
}
$where['sort_id'] = $param['sort_id'];
if(isset($param['keyword'])) {
$where['sort_name'] = ['like','%'.$param['keyword'].'%'];
if(isset($param['status']) && $param['status'] >= 0) {
$where['status'] = $param['status'];
}
if(isset($param['is_excel']) && $param['is_excel'] >= 0) {
$where['is_excel'] = $param['is_excel'];
}
if(isset($param['is_over']) && $param['is_over'] >= 0) {
if($param['is_over'] == 0) {
$where['over_time'] = ['egt',time()];
}
if($param['is_over'] == 1) {
$where['over_time'] = ['lt',time()];
}
}
$startTime = empty($filter['start_time']) ? 0 : strtotime($filter['start_time']);
$endTime = empty($filter['end_time']) ? 0 : strtotime($filter['end_time']);
... ... @@ -189,6 +204,11 @@ class OrderController extends AdminBaseController
$this->assign('list',$list->items());
$this->assign('page',$list->render());
$this->assign('keyword',isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('status',isset($param['status']) ? $param['status'] : '');
$this->assign('is_excel',isset($param['is_excel']) ? $param['is_excel'] : '');
$this->assign('is_over',isset($param['is_over']) ? $param['is_over'] : '');
$this->assign('start_time',isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time',isset($param['end_time']) ? $param['end_time'] : '');
$this->assign('sort_id',$param['sort_id']);
// 订单类型
$sortList = Db::name('OrderSort')->where(['delete_time'=>0])->select()->toArray();
... ... @@ -221,6 +241,23 @@ class OrderController extends AdminBaseController
if(isset($param['keyword'])) {
$where['order_sn|sort_name|user_login|number'] = ['like','%'.$param['keyword'].'%'];
}
if(!empty($param['sort_id'])) {
$where['sort_id'] = $param['sort_id'];
}
if(isset($param['status']) && $param['status'] >= 0) {
$where['status'] = $param['status'];
}
if(isset($param['is_excel']) && $param['is_excel'] >= 0) {
$where['is_excel'] = $param['is_excel'];
}
if(isset($param['is_over']) && $param['is_over'] >= 0) {
if($param['is_over'] == 0) {
$where['over_time'] = ['egt',time()];
}
if($param['is_over'] == 1) {
$where['over_time'] = ['lt',time()];
}
}
$startTime = empty($filter['start_time']) ? 0 : strtotime($filter['start_time']);
$endTime = empty($filter['end_time']) ? 0 : strtotime($filter['end_time']);
if (!empty($startTime) && !empty($endTime)) {
... ... @@ -238,6 +275,12 @@ class OrderController extends AdminBaseController
$this->assign('list',$list->items());
$this->assign('page',$list->render());
$this->assign('keyword',isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('sort_id',isset($param['sort_id']) ? $param['sort_id'] : '');
$this->assign('status',isset($param['status']) ? $param['status'] : '');
$this->assign('is_excel',isset($param['is_excel']) ? $param['is_excel'] : '');
$this->assign('is_over',isset($param['is_over']) ? $param['is_over'] : '');
$this->assign('start_time',isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time',isset($param['end_time']) ? $param['end_time'] : '');
$this->assign('user_id',$param['user_id']);
// 订单类型
$sortList = Db::name('OrderSort')->where(['delete_time'=>0])->select()->toArray();
... ...
... ... @@ -254,12 +254,23 @@ class MemberSalesController extends HomeBaseController
$this->redirect(url('portal/MemberSales/order_type'));
}
$user_id = cmf_get_current_user_sale_id();
$order_where = [
$order_where1 = [
'user_id' => $user_id,
'status' => 0,
'over_time' => ['egt',time()],
'is_stop' => 0,
'delete_time' => 0
];
$order_where2 = [
'user_id' => $user_id,
'status' => 1,
'is_stop' => 0,
'delete_time' => 0
];
$orderList = Db::name('OrderView')->where($order_where)->select()->toArray();
$orderList = Db::name('OrderView')
->where(function ($q) use ($order_where1) {$q->where($order_where1);})
->whereOr(function ($q) use ($order_where2) {$q->where($order_where2);})
->select()->toArray();
foreach ($orderList as $k=>$v) {
$mobile = '';
$v['options'] = json_decode($v['options'],true);
... ...
... ... @@ -6,6 +6,31 @@
<li class="active"><a href="javascript:;">订单列表</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('Order/index_sales',['user_id'=>$user_id])}">
订单类型:
<select class="form-control" name="sort_id" style="width: 140px;">
<option value="0">请选择</option>
<volist name="sortList" id="vo">
<option value="{$vo.id}" <eq name="sort_id" value="$vo['id']">selected</eq>>{$vo.name}</option>
</volist>
</select>&nbsp; &nbsp;
订单状态:
<select class="form-control" name="status" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="status" value="0">selected</eq>>未支付</option>
<option value="1" <eq name="status" value="1">selected</eq>>已支付</option>
</select>&nbsp; &nbsp;
是否失效:
<select class="form-control" name="is_over" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="is_over" value="0">selected</eq>>否</option>
<option value="1" <eq name="is_over" value="1">selected</eq>>是</option>
</select>&nbsp; &nbsp;
导出状态:
<select class="form-control" name="is_excel" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="is_excel" value="0">selected</eq>>未导出</option>
<option value="1" <eq name="is_excel" value="1">selected</eq>>已导出</option>
</select>&nbsp; &nbsp;
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
... ... @@ -18,6 +43,7 @@
value="{$keyword|default=''}" placeholder="请输入关键字...">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Order/index_sales',['user_id'=>$user_id])}">清空</a>
<input type="button" class="btn btn-primary" id="excel" value="导出"/>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
... ... @@ -101,6 +127,52 @@
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
$('#excel').click(function () {
var url1 = "{:url('Order/excel')}";
var url2 = url1.split('.',5);
var sort_id = $('select[name=sort_id]').val();
var status = $('select[name=status]').val();
var is_over = $('select[name=is_over]').val();
var is_excel = $('select[name=is_excel]').val();
var keyword = $('input[name=keyword]').val();
var start_time = $('input[name=start_time]').val();
var end_time = $('input[name=end_time]').val();
var param = '/excel/1';
var ids = [];
$('.js-check').each(function(index,element) {
if($(this).prop('checked') == true) {
ids.push($(this).val());
}
});
console.log(ids);
if(ids.length>0) {
ids = ids.join(',');
param += '/ids/' + ids;
}
if(sort_id.length > 0) {
param += '/sort_id/'+sort_id;
}
if(status.length > 0) {
param += '/status/'+status;
}
if(is_over.length > 0) {
param += '/is_over/'+is_over;
}
if(is_excel.length > 0) {
param += '/is_excel/'+is_excel;
}
if(keyword.length > 0) {
param += '/keyword/'+keyword;
}
if(start_time.length > 0) {
param += '/start_time/'+start_time;
}
if(end_time.length > 0) {
param += '/end_time/'+end_time;
}
var url = url2[0]+param+'.html';
window.open(url);
});
function reloadPage(win) {
win.location.reload();
}
... ...
... ... @@ -6,6 +6,24 @@
<li class="active"><a href="javascript:;">订单列表</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('Order/index_sort',['sort_id'=>$sort_id])}">
订单状态:
<select class="form-control" name="status" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="status" value="0">selected</eq>>未支付</option>
<option value="1" <eq name="status" value="1">selected</eq>>已支付</option>
</select>&nbsp; &nbsp;
是否失效:
<select class="form-control" name="is_over" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="is_over" value="0">selected</eq>>否</option>
<option value="1" <eq name="is_over" value="1">selected</eq>>是</option>
</select>&nbsp; &nbsp;
导出状态:
<select class="form-control" name="is_excel" style="width: 140px;">
<option value="-1">请选择</option>
<option value="0" <eq name="is_excel" value="0">selected</eq>>未导出</option>
<option value="1" <eq name="is_excel" value="1">selected</eq>>已导出</option>
</select>&nbsp; &nbsp;
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
... ... @@ -18,6 +36,7 @@
value="{$keyword|default=''}" placeholder="请输入关键字...">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Order/index_sort',['sort_id'=>$sort_id])}">清空</a>
<input type="button" class="btn btn-primary" id="excel" value="导出"/>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
... ... @@ -101,6 +120,52 @@
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
$('#excel').click(function () {
var url1 = "{:url('Order/excel')}";
var url2 = url1.split('.',5);
var sort_id = "{$sort_id}";
var status = $('select[name=status]').val();
var is_over = $('select[name=is_over]').val();
var is_excel = $('select[name=is_excel]').val();
var keyword = $('input[name=keyword]').val();
var start_time = $('input[name=start_time]').val();
var end_time = $('input[name=end_time]').val();
var param = '/excel/1';
var ids = [];
$('.js-check').each(function(index,element) {
if($(this).prop('checked') == true) {
ids.push($(this).val());
}
});
console.log(ids);
if(ids.length>0) {
ids = ids.join(',');
param += '/ids/' + ids;
}
if(sort_id.length > 0) {
param += '/sort_id/'+sort_id;
}
if(status.length > 0) {
param += '/status/'+status;
}
if(is_over.length > 0) {
param += '/is_over/'+is_over;
}
if(is_excel.length > 0) {
param += '/is_excel/'+is_excel;
}
if(keyword.length > 0) {
param += '/keyword/'+keyword;
}
if(start_time.length > 0) {
param += '/start_time/'+start_time;
}
if(end_time.length > 0) {
param += '/end_time/'+end_time;
}
var url = url2[0]+param+'.html';
window.open(url);
});
function reloadPage(win) {
win.location.reload();
}
... ...
... ... @@ -138,6 +138,7 @@
var res = {
data: ''
};
var reg = /^1[0-9]{10}$/;
var is_stop = "{$orderInfo.is_stop}";
if(is_stop == 1) {
$('.change_text_o').html('对不起,当前功能已暂停');
... ... @@ -344,16 +345,18 @@
return false;
} else {
// 判断客户编号类型,长度必须为10位;判断手机号码格式是否正确
if($(this).data('type') == 12 && $(this).find('input').val().length != 10 && $(this).data('validate') == 1) {
_error($(this).find('._validate').html()+'长度必须为10位');
status = false;
return false;
} else if($(this).data('type') == 3 && $(this).data('validate') == 1) {
// if($(this).data('type') == 12 && $(this).find('input').val().length != 10 && $(this).data('validate') == 1) {
// _error($(this).find('._validate').html()+'长度必须为10位');
// status = false;
// return false;
// } else
if($(this).data('type') == 3 && $(this).data('validate') == 1) {
if(!reg.test($(this).find('input').val())) {
_error($(this).find('._validate').html()+'格式错误');
status = false;
return false;
}
value = $(this).find('input').val();
} else {
value = $(this).find('input').val();
}
... ...
... ... @@ -295,16 +295,18 @@
return false;
} else {
// 判断客户编号类型,长度必须为10位;判断手机号码格式是否正确
if($(this).data('type') == 12 && $(this).find('input').val().length != 10 && $(this).data('validate') == 1) {
_error($(this).find('._validate').html()+'长度必须为10位');
status = false;
return false;
} else if($(this).data('type') == 3 && $(this).data('validate') == 1) {
// if($(this).data('type') == 12 && $(this).find('input').val().length != 10 && $(this).data('validate') == 1) {
// _error($(this).find('._validate').html()+'长度必须为10位');
// status = false;
// return false;
// } else
if($(this).data('type') == 3 && $(this).data('validate') == 1) {
if(!reg.test($(this).find('input').val())) {
_error($(this).find('._validate').html()+'格式错误');
status = false;
return false;
}
value = $(this).find('input').val();
} else {
value = $(this).find('input').val();
}
... ...