Commit 6c734d81 by LiuJunYi

订单增加手机号查询

parent 10627c06
......@@ -57,9 +57,7 @@ class Order extends AuthBase
$condition['title'] = ['like', '%' . input('get.title') . '%'];
}
//根据筛选条件查询
$order_list = $this->order_model->with(['project' => function ($query) {
}])->where($condition)->order('created_at desc')->paginate(10, false, ['query' => $_GET])->each(function ($item) {
$order_list = $this->order_model->hasWhere('userinfo',['phone'=>['like','%'.input('phone').'%']])->where($condition)->order('created_at desc')->paginate(10, false, ['query' => $_GET])->each(function ($item) {
$project = \app\common\model\Project::withTrashed()->find($item['pid']);
$item['project_poster'] = $project['poster'];
$item['project_title'] = $project['title'];
......@@ -97,7 +95,7 @@ class Order extends AuthBase
$condition['created_at'] = ['<', $end_time . ' 00:00:00'];
}
}
$order_list = $this->order_model->where($condition)->order('created_at desc')->select();
$order_list = $this->order_model->hasWhere('userinfo',['phone'=>['like','%'.input('phone').'%']])->where($condition)->order('created_at desc')->select();
//导出用户信息、活动信息、订单信息,如:姓名、手机号、活动名称、价格、家庭组数、大人数量、孩子数量、孩子年龄、备注等
//导出到excel之前数据处理
$mulit_arr = [];
......@@ -119,7 +117,10 @@ class Order extends AuthBase
$arr[] = $vo->project['title'];
if($vo->type ==1 ){
//活动
$arr[] = "姓名:{$vo->extras['nickname']},价格:{$vo->extras['price']},数量:{$vo->extras['sign_limits']},地址:{$vo->extras['address']},描述:{$vo->extras['remark']}";
$name = json_encode($vo->extras['nickname']);
$name = preg_replace("/\\\u[ed][0-9a-f]{3}\\\u[ed][0-9a-f]{3}/", "*", $name);//替换成*
$name = json_decode($name);
$arr[] = "姓名:{$name},价格:{$vo->extras['price']},数量:{$vo->extras['sign_limits']},地址:{$vo->extras['address']},描述:{$vo->extras['remark']}";
}else{
//会员卡
$arr[] = "价格:{$vo->extras['price']},时长:{$vo->extras['year']},备注:{$vo->extras['remark']}";
......
......@@ -14,6 +14,10 @@
placeholder="活动名称"/>
</div>
<div class="form-group margin-right">
<input class="form-control" id="phone" type="text" name="phone" value="{:input('phone')}"
placeholder="手机号"/>
</div>
<div class="form-group margin-right">
<select name="status" class="form-control" id="status">
<option value="-1" {if condition="$status=='-1'" }selected{/if}>全部订单状态</option>
<option value="0" {if condition="$status=='0'" }selected{/if}>未付款</option>
......@@ -195,7 +199,8 @@
var start_time = $("#start_time").val();
var end_time = $("#end_time").val();
var title = $("#title").val();
window.location.href = "{:url('admin/order/orderOutput')}" + '?status=' + status + '&type=' + type + '&start_time=' + start_time + '&end_time=' + end_time + '&title=' + title;
var phone = $("#phone").val();
window.location.href = "{:url('admin/order/orderOutput')}" + '?status=' + status + '&type=' + type + '&start_time=' + start_time + '&end_time=' + end_time + '&title=' + title+'&phone=' + phone;
$(this).removeAttr('disabled');
});
......
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 to comment