Toggle navigation
This project
Loading...
Sign in
najixian
/
xt_dc_admin
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Download as
Email Patches
Plain Diff
Browse Files
Commit
23d610ae7a7d6f8d92ee505ca68c4b60dcb49f50
Authored by
teemitop
2019-07-29 15:43:37 +0800
1 parent
b24d3a6d
build: skipped
获取预定订单
Changes
2
Builds
0
Inline
Side-by-side
Showing
2 changed files
with
230 additions
and
0 deletions
application/admin/controller/Seller.php
application/admin/view/seller/get_reserve_list.html
application/admin/controller/Seller.php
View file @
23d610a
...
...
@@ -574,4 +574,84 @@ class Seller extends Common
$this
->
assign
(
'title'
,
'商家话机在线设备列表'
);
return
$this
->
fetch
();
}
/**
* 从商家维度统计:订单、短信等情况
*/
public
function
GetReserveList
(){
if
(
Request
::
isAjax
()){
$data
=
Request
::
except
(
'file'
);
$key
=
input
(
'post.key'
)
?
input
(
'post.key'
)
:
""
;
$nokey
=
input
(
'post.nokey'
)
?
input
(
'post.nokey'
)
:
""
;
$sellername
=
$data
[
'key'
]
?
$data
[
'key'
]
:
''
;
//商家名称
$id
=
$data
[
'nokey'
]
?
$data
[
'nokey'
]
:
''
;
//订单ID
$time
=
$data
[
'time'
]
?
explode
(
' - '
,
$data
[
'time'
])
:
''
;
$stime
=
$time
?
strtotime
(
date
(
$time
[
0
],
time
()))
:
strtotime
(
date
(
'Y-m-d 00:00:00'
,
time
()));
$etime
=
$time
?
strtotime
(
date
(
$time
[
1
],
time
()))
:
strtotime
(
date
(
'Y-m-d 23:59:59'
,
time
()));
$data
[
'status'
]
=
$data
[
'status'
]
?
$data
[
'status'
]
:
2
;
$data
[
'channel'
]
=
$data
[
'channel'
]
?
$data
[
'channel'
]
:
1
;
$parame
=
'&offset='
.
$data
[
"page"
]
.
'&limit='
.
$data
[
"limit"
]
.
'&sellername='
.@
$sellername
.
'&stime='
.@
$stime
.
'&etime='
.@
$etime
.
'&channel='
.@
$data
[
'channel'
]
.
'&id='
.
$id
.
'&status='
.@
$data
[
'status'
];
//获取运营人员列表
$list
=
file_get_contents
(
UNDER_LINE
.
'App.Customer.GetReserveList'
.
$parame
);
$array
=
json_decode
(
$list
,
TRUE
);
$new_array
=
array
();
foreach
(
$array
[
'data'
][
'list'
]
as
$key
=>
$value
)
{
switch
(
$value
[
'status'
])
{
case
0
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'待确认'
;
break
;
case
1
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'已定座'
;
break
;
case
2
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'到店'
;
break
;
case
3
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'离店'
;
break
;
case
4
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'已取消'
;
break
;
case
5
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'已分配'
;
break
;
case
6
:
$array
[
'data'
][
'list'
][
$key
][
'sta'
]
=
'拒单'
;
break
;
default
:
# code...
break
;
}
switch
(
$value
[
'sex'
])
{
case
1
:
$array
[
'data'
][
'list'
][
$key
][
'rname'
]
=
$value
[
'rname'
]
.
'先生'
.
'('
.
$value
[
'phone'
]
.
')'
;
break
;
case
2
:
$array
[
'data'
][
'list'
][
$key
][
'rname'
]
=
$value
[
'rname'
]
.
'女士'
.
'('
.
$value
[
'phone'
]
.
')'
;
break
;
case
3
:
$array
[
'data'
][
'list'
][
$key
][
'rname'
]
=
$value
[
'rname'
]
.
'公司'
.
'('
.
$value
[
'phone'
]
.
')'
;
break
;
default
:
# code...
break
;
}
}
return
$result
=
[
'code'
=>
0
,
'msg'
=>
'获取成功!'
,
'data'
=>
$array
[
'data'
][
'list'
],
'count'
=>
$array
[
'data'
][
'total'
],
'rel'
=>
1
];
}
$this
->
assign
(
'title'
,
'C端预定订单管理'
);
return
$this
->
fetch
();
}
}
...
...
application/admin/view/seller/get_reserve_list.html
0 → 100644
View file @
23d610a
{include file="common/head"/}
<div
class=
"admin-main layui-anim layui-anim-upbit"
>
<fieldset
class=
"layui-elem-field layui-field-title"
>
<legend>
{:$title}
</legend>
</fieldset>
<div
class=
"demoTable"
>
订单编号:
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"nokey"
id=
"nokey"
placeholder=
"{:lang('pleaseEnter')}订单编号"
autocomplete=
"off"
>
</div>
商家:
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"key"
id=
"key"
placeholder=
"{:lang('pleaseEnter')}店铺名称"
autocomplete=
"off"
>
</div>
日期范围:
<div
class=
"layui-input-inline"
>
<input
type=
"text"
style =
"width:300px"
;
class=
"layui-input"
id=
"time"
placeholder=
"默认为当天的统计情况"
>
</div>
商家来源:
<div
class=
"layui-input-inline layui-form"
>
<div
class=
"layui-input-8"
>
<select
name=
"class"
id=
"channel"
lay-filter=
"myselect"
>
<option
value=
"-1"
>
全部
</option>
<option
value=
"1"
selected=
"true"
>
合作
</option>
<option
value=
"2"
>
推广
</option>
<option
value=
"3"
>
测试
</option>
</select>
</div>
</div>
订单状态:
<div
class=
"layui-input-inline layui-form"
>
<div
class=
"layui-input-8"
>
<select
name=
"class"
id=
"status"
lay-filter=
"myselect"
>
<option
value=
"1"
>
待处理
</option>
<option
value=
"2"
selected=
"true"
>
超时5分钟未处理
</option>
<option
value=
"3"
>
已拒绝
</option>
<option
value=
"4"
>
已安排
</option>
<option
value=
"5"
>
已取消
</option>
</select>
</div>
</div>
<button
class=
"layui-btn"
id=
"search"
data-type=
"reload"
>
查询统计
</button>
</div>
<table
class=
"layui-table"
id=
"list"
lay-filter=
"list"
>
</table>
</div>
<script
type=
"text/html"
id=
"toolbarDemo"
>
<
span
>
订单总数:
<
i
id
=
"count"
>
X
<
/i>单</
span
>
<
span
>
未处理订单总数:
<
i
id
=
"untreated"
>
Y
<
/i>单</
span
>
<
span
>
超时订单总数:
<
i
id
=
"overtime"
>
Z
<
/i>单</
span
>
</script>
<script
type=
"text/html"
id=
"action"
>
{{
#
if
(
d
.
status
==
0
){}}
<
a
class
=
"layui-btn layui-btn-xs"
>
拒绝订单
<
/a
>
<
a
class
=
"layui-btn layui-btn-xs"
>
安排包间
<
/a
>
{{
#
}
else
if
(
d
.
status
==
5
)
{}}
<
a
class
=
"layui-btn layui-btn-xs"
>
取消订单
<
/a
>
{{
#
}
else
{}}
暂无操作
{{
#
}}}
</script>
{include file="common/foot"/}
<script>
layui
.
use
([
'table'
,
'form'
,
'laydate'
],
function
()
{
var
table
=
layui
.
table
,
laydate
=
layui
.
laydate
,
$
=
layui
.
jquery
;
console
.
log
(
layui
);
var
tableIn
=
table
.
render
({
elem
:
'#list'
,
url
:
'{:url("GetReserveList")}'
,
method
:
'post'
,
title
:
'C端预定订单管理'
,
page
:
true
,
sort
:
true
,
toolbar
:
'#toolbarDemo'
,
cols
:
[[
{
field
:
'id'
,
title
:
'订单编号'
,
width
:
100
,
fixed
:
true
},
{
field
:
'sellername'
,
title
:
'所属商家'
},
{
field
:
'seller_tel'
,
title
:
'商家电话'
},
{
field
:
'ddate'
,
title
:
'到店时间'
},
{
field
:
'pnum'
,
title
:
'就餐人数'
},
{
field
:
'rname'
,
title
:
'客户信息'
},
{
field
:
'cusdem'
,
title
:
'备注'
},
{
field
:
'cdate'
,
title
:
'下单时间'
},
{
field
:
'sta'
,
title
:
'状态'
},
{
align
:
'center'
,
width
:
260
,
title
:
'操作'
,
toolbar
:
'#action'
}
]],
done
:
function
(
res
,
curr
,
count
){
$
(
'#count'
).
html
(
res
.
countReserve
);
$
(
'#untreated'
).
html
(
res
.
countSms
);
$
(
'#overtime'
).
html
(
res
.
inviteeCount
);
}
,
id
:
'testReload'
,
page
:
true
,
limit
:
15
});
//日期时间范围
laydate
.
render
({
elem
:
'#time'
,
type
:
'datetime'
,
range
:
true
});
//搜索
$
(
'#search'
).
on
(
'click'
,
function
()
{
//关键字
var
nokey
=
$
(
'#nokey'
).
val
();
//关键字
var
key
=
$
(
'#key'
).
val
();
//选中的商家ID
/*var checkStatus = table.checkStatus('testReload'); //test即为参数id设定的值
var a = [];
$(checkStatus.data).each(function(i,o){
a.push(o.id);
});
console.log(a);*/
var
time
=
$
(
'#time'
).
val
();
console
.
log
(
time
);
//商家来源
var
channel
=
$
(
'#channel'
).
val
();
console
.
log
(
channel
);
//筛选条件
var
status
=
$
(
'#status'
).
val
();
console
.
log
(
status
);
//传参
tableIn
.
reload
({
page
:
{
page
:
1
},
where
:
{
nokey
:
nokey
,
key
:
key
,
status
:
status
,
time
:
time
,
channel
:
channel
}});
});
var
$
=
layui
.
$
,
active
=
{
reload
:
function
(){
var
nokey
=
$
(
'#nokey'
);
var
key
=
$
(
'#key'
);
//执行重载
table
.
reload
(
'testReload'
,
{
page
:
{
curr
:
1
//重新从第 1 页开始
}
,
where
:
{
key
:
{
id
:
key
.
val
(),
no
:
nokey
.
val
()
}
}
});
}
};
})
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment