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
e2d3ff7df043643e7255c34f4b0172dfb7915fa1
Authored by
teemitop
2020-03-04 16:24:23 +0800
1 parent
45bfe4aa
PC配置来电跳转
Inline
Side-by-side
Showing
2 changed files
with
236 additions
and
0 deletions
application/admin/controller/Seller.php
application/admin/view/seller/devicelists.html
application/admin/controller/Seller.php
View file @
e2d3ff7
...
...
@@ -1286,4 +1286,114 @@ class Seller extends Common
}
return
view
();
}
/**
* 状态设置
*/
public
function
devicelists
(){
$facturer
=
Db
::
query
(
"SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer"
);
$this
->
assign
(
'facturer'
,
$facturer
);
if
(
Request
::
isAjax
()){
$data
=
Request
::
except
(
'file'
);
$channel
=
@
$data
[
'channel'
]
?
@
$data
[
'channel'
]
:
1
;
$manufacturer
=
@
$data
[
'manufacturer'
]
?
@
$data
[
'manufacturer'
]
:
1
;
$page
=
(
$data
[
'page'
]
-
1
)
*
$data
[
'limit'
];
$__Where
=
' 1=1'
;
$__Where
.=
@
$data
[
'key'
]
?
" and s.sellername like '%"
.
$data
[
'key'
]
.
"%'"
:
""
;
switch
(
$manufacturer
)
{
case
'1'
:
$__Where
.=
' and sta.type in (0,1)'
;
break
;
case
'-1'
:
$__Where
.=
' '
;
break
;
default
:
$__Where
.=
' and sta.type = '
.
$manufacturer
;
break
;
}
if
(
$channel
&&
$channel
!=-
1
)
{
$__Where
.=
' and rel.type_id='
.
$channel
;
}
else
{
$__Where
.=
""
;
}
$total
=
Db
::
query
(
"SELECT
count(1) as total
FROM
`xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS sta
LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON sta.sid = s.id
LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS rel ON sta.sid = rel.sid
WHERE
$__Where
"
);
$list
=
Db
::
query
(
"SELECT
s.sellername,
rel.type_id,
sta.*
FROM
`xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS sta
LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON sta.sid = s.id
LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS rel ON sta.sid = rel.sid
WHERE
$__Where
ORDER BY
sta.sid
LIMIT
$page
,"
.
$data
[
'limit'
]);
foreach
(
$list
as
$key
=>
$value
)
{
//$list[$key]['call_jump_page'] = $value['call_jump_page'] == 1 ? "订座页面" : "桌位页面";
switch
(
$value
[
'type'
])
{
case
'0'
:
$list
[
$key
][
'type'
]
=
$facturer
[
0
][
'facturer'
];
break
;
case
'1'
:
$list
[
$key
][
'type'
]
=
$facturer
[
0
][
'facturer'
];
break
;
case
'2'
:
$list
[
$key
][
'type'
]
=
$facturer
[
1
][
'facturer'
];
break
;
case
'3'
:
$list
[
$key
][
'type'
]
=
$facturer
[
2
][
'facturer'
];
break
;
case
'4'
:
$list
[
$key
][
'type'
]
=
$facturer
[
3
][
'facturer'
];
break
;
default
:
$list
[
$key
][
'type'
]
=
'error: '
.
$value
[
'type'
];
break
;
}
}
return
$result
=
[
'code'
=>
0
,
'msg'
=>
'获取成功!'
,
'data'
=>
$list
,
'count'
=>
$total
[
0
][
'total'
],
'rel'
=>
1
];
}
$this
->
assign
(
'title'
,
'设备列表'
);
return
$this
->
fetch
();
}
/**
* 商家基础信息配置
*/
public
function
upcalljumppage
(){
if
(
Request
::
isAjax
()){
$data
=
Request
::
except
(
'file'
);
$list
=
file_get_contents
(
ON_LINE
.
'Android.Device.UpDeviceCallJumpPage&device='
.
$data
[
'device'
]
.
'&field='
.
'&status='
.
$data
[
'status'
]);
$array
=
json_decode
(
$list
,
TRUE
);
if
(
$array
[
'ret'
]
==
200
){
$result
[
'code'
]
=
1
;
$result
[
'msg'
]
=
'SUCCESS!'
;
}
else
{
$result
[
'code'
]
=
0
;
$result
[
'msg'
]
=
'请求错误!'
;
}
return
$result
;
}
return
view
();
}
}
...
...
application/admin/view/seller/devicelists.html
0 → 100644
View file @
e2d3ff7
{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=
"key"
id=
"key"
placeholder=
"{:lang('pleaseEnter')}店铺名称"
autocomplete=
"off"
>
</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
>
合作
</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=
"manufacturer"
lay-filter=
"manufacturer"
>
<option
value=
"-1"
>
全部
</option>
{foreach $facturer as $key=>$vo}
<option
value=
"{$vo.id}"
{
if
$
vo
.
id
eq
1
}
selected
{/
if
}
>
{$vo.facturer}
</option>
{/foreach}
</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>
{include file="common/foot"/}
<script
type=
"text/html"
id=
"checkboxTpl"
>
<!--
这里的
checked
的状态只是演示
-->
<
input
type
=
"checkbox"
name
=
"lock"
value
=
"{{d.id}}"
title
=
"锁定"
lay
-
filter
=
"lockDemo"
{{
d
.
id
==
10006
?
'checked'
:
''
}}
>
</script>
<script>
layui
.
use
([
'table'
,
'form'
,
'laydate'
],
function
()
{
var
table
=
layui
.
table
,
laydate
=
layui
.
laydate
,
$
=
layui
.
jquery
;
var
tableIn
=
table
.
render
({
elem
:
'#list'
,
url
:
'{:url("devicelists")}'
,
method
:
'post'
,
title
:
'设备列表'
,
page
:
true
,
toolbar
:
'#toolbarDemo'
,
cols
:
[[
//{checkbox:true,fixed: true},
//{field: 'id', title: '{:lang("id")}',width:100,fixed: true},
{
field
:
'sid'
,
title
:
'商家编号'
,
width
:
100
},
{
field
:
'sellername'
,
title
:
'所属商家'
},
{
field
:
'device'
,
title
:
'设备编号'
},
{
field
:
'type'
,
title
:
'厂商'
},
{
field
:
'version'
,
title
:
'设备版本号'
},
{
field
:
'call_jump_page'
,
align
:
'center'
,
edit
:
'text'
,
title
:
'1=订座页/2=桌位页'
},
]],
done
:
function
(
res
,
curr
,
count
){
}
,
id
:
'testReload'
,
page
:
true
,
limit
:
15
});
//监听单元格编辑
table
.
on
(
'edit(list)'
,
function
(
obj
){
var
value
=
obj
.
value
,
//得到修改后的值
data
=
obj
.
data
,
//得到所在行所有键值
field
=
obj
.
field
;
//得到字段
switch
(
field
){
case
'call_jump_page'
:
var
new_field
=
'来电跳转页面'
;
var
msg_tips
=
value
==
1
?
'跳转订座'
:
'跳转桌位'
;
break
;
}
if
(
field
==
'call_jump_page'
&&
!
(
/
(
^
[
1-2
]\d
*$
)
/
.
test
(
value
))){
layer
.
msg
(
'只能输入1或者2!'
,{
time
:
1500
,
icon
:
2
});
return
;
}
//layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改为:'+ value);
layer
.
confirm
(
'请确认将 '
+
data
.
sellername
+
'商家的 '
+
new_field
+
' 设置为:'
+
msg_tips
,
function
(
index
){
$
.
post
(
"{:url('upcalljumppage')}"
,{
device
:
data
.
device
,
status
:
value
},
function
(
res
){
if
(
res
.
code
==
1
){
layer
.
msg
(
res
.
msg
,{
time
:
1500
,
icon
:
1
});
}
else
{
layer
.
msg
(
res
.
msg
,{
time
:
1500
,
icon
:
2
});
}
});
layer
.
close
(
index
);
});
});
//搜索
$
(
'#search'
).
on
(
'click'
,
function
()
{
//关键字
var
key
=
$
(
'#key'
).
val
();
//传参
tableIn
.
reload
({
page
:
{
page
:
1
},
where
:
{
key
:
key
,
channel
:
$
(
'#channel'
).
val
(),
manufacturer
:
$
(
'#manufacturer'
).
val
()}});
});
var
$
=
layui
.
$
,
active
=
{
reload
:
function
(){
var
key
=
$
(
'#key'
);
var
channel
=
$
(
'#channel'
);
//执行重载
table
.
reload
(
'testReload'
,
{
page
:
{
curr
:
1
//重新从第 1 页开始
}
,
where
:
{
key
:
{
id
:
key
.
val
(),
channel
:
channel
.
val
()
}
}
});
}
};
})
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment