Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
6c734d81
Commit
6c734d81
authored
Jan 09, 2019
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单增加手机号查询
parent
10627c06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
application/admin/controller/Order.php
+6
-5
application/admin/view/order/index.html
+6
-1
No files found.
application/admin/controller/Order.php
View file @
6c734d81
...
...
@@ -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'
]
}
"
;
...
...
application/admin/view/order/index.html
View file @
6c734d81
...
...
@@ -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'
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment