Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴贤德
SooonerHotel
Commits
92d10dfd
Commit
92d10dfd
authored
Jul 19, 2019
by
wangjiangze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
酒店管理 SP/区域搜索
parent
daab774d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
HotelAction.class.php
SooonerHotel/App/Lib/Action/Hotel/HotelAction.class.php
+3
-0
HotelModel.class.php
SooonerHotel/App/Lib/Model/HotelModel.class.php
+8
-0
index.html
SooonerHotel/App/Tpl/Hotel/zh-cn/Hotel/index.html
+18
-1
No files found.
SooonerHotel/App/Lib/Action/Hotel/HotelAction.class.php
View file @
92d10dfd
...
@@ -14,7 +14,10 @@ class HotelAction extends CommonAction{
...
@@ -14,7 +14,10 @@ class HotelAction extends CommonAction{
echo
"
{
\"total\":\"".$total."\",\"rows\":".json_encode($list)."
}
"
;
echo
"
{
\"total\":\"".$total."\",\"rows\":".json_encode($list)."
}
"
;
}
else
{
}
else
{
$spModel
=
D
(
"Sp"
);
$spModel
=
D
(
"Sp"
);
$regionModel
=
D
(
"Region"
);
$sp_lists
=
$spModel
->
where
(
"`status`=0"
)
->
select
();
$sp_lists
=
$spModel
->
where
(
"`status`=0"
)
->
select
();
$region_lists
=
$regionModel
->
where
(
"`level` < 4 and pid < 999999"
)
->
select
();
$this
->
region_lists
=
$region_lists
;
$this
->
sp_lists
=
$sp_lists
;
$this
->
sp_lists
=
$sp_lists
;
$this
->
display
();
$this
->
display
();
}
}
...
...
SooonerHotel/App/Lib/Model/HotelModel.class.php
View file @
92d10dfd
...
@@ -19,6 +19,14 @@ class HotelModel extends RelationModel{
...
@@ -19,6 +19,14 @@ class HotelModel extends RelationModel{
$where
=
" and (A.`name` like '%"
.
$searchValue
.
"%' or A.`code` like '%"
.
$searchValue
.
"%') "
;
$where
=
" and (A.`name` like '%"
.
$searchValue
.
"%' or A.`code` like '%"
.
$searchValue
.
"%') "
;
}
}
if
(
$searchSp
){
$where
.=
" and A.sp_id =
$searchSp
"
;
}
if
(
$searchRegion
){
$where
.=
" and A.region_id =
$searchRegion
"
;
}
$model
=
new
Model
();
$model
=
new
Model
();
//======================
//======================
...
...
SooonerHotel/App/Tpl/Hotel/zh-cn/Hotel/index.html
View file @
92d10dfd
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<form
name=
"searchform"
method=
"post"
action=
""
id =
"searchform"
>
<form
name=
"searchform"
method=
"post"
action=
""
id =
"searchform"
>
<input
type=
"hidden"
name=
"op"
value=
"getjson"
>
<input
type=
"hidden"
name=
"op"
value=
"getjson"
>
<div
class=
"inputBox"
>
<div
class=
"inputBox"
>
<select
class=
"select"
name=
"search
Type
"
>
<select
class=
"select"
name=
"search
Sp
"
>
<option
value=
"0"
>
合作方
</option>
<option
value=
"0"
>
合作方
</option>
<volist
name=
"sp_lists"
id=
"item"
>
<volist
name=
"sp_lists"
id=
"item"
>
<option
value=
"{$item.id}"
>
{$item.name}
</option>
<option
value=
"{$item.id}"
>
{$item.name}
</option>
...
@@ -32,6 +32,11 @@
...
@@ -32,6 +32,11 @@
</select>
</select>
<select
class=
"select"
name=
"searchRegion"
>
<select
class=
"select"
name=
"searchRegion"
>
<option
value=
"0"
>
区域
</option>
<option
value=
"0"
>
区域
</option>
<volist
name=
'region_lists'
id=
'item'
>
<if
condition=
'$item.level eq 2'
>
<optgroup
value=
"{$item.id}"
pid=
"{$item.pid}"
label=
"{$item.name}"
></optgroup>
</if>
</volist>
</select>
</select>
<input
class=
"input"
type=
"text"
placeholder=
"酒店名称/合作方酒店标识"
name=
"searchValue"
>
<input
class=
"input"
type=
"text"
placeholder=
"酒店名称/合作方酒店标识"
name=
"searchValue"
>
</div>
</div>
...
@@ -169,7 +174,19 @@ function del(){
...
@@ -169,7 +174,19 @@ function del(){
$
.
messager
.
alert
(
'提示'
,
'请选择要操作的记录!'
,
'info'
);
$
.
messager
.
alert
(
'提示'
,
'请选择要操作的记录!'
,
'info'
);
}
}
}
}
$
().
ready
(
function
(){
var
region_lists
=
{
$region_lists
|
json_encode
};
$
.
each
(
region_lists
,
function
(
i
,
item
){
if
(
item
.
level
==
3
){
if
(
$
(
"select[name='searchRegion'] option[pid='"
+
item
.
pid
+
"']"
).
length
==
0
){
$
(
"select[name='searchRegion'] optgroup[value='"
+
item
.
pid
+
"']"
).
append
(
'<option value="'
+
item
.
id
+
'" pid="'
+
item
.
pid
+
'"> |--'
+
item
.
name
+
'</option>'
);
}
else
{
$
(
"select[name='searchRegion'] option[pid='"
+
item
.
pid
+
"']:last"
).
after
(
'<option value="'
+
item
.
id
+
'" pid="'
+
item
.
pid
+
'"> |--'
+
item
.
name
+
'</option>'
);
}
}
});
});
$
(
"#submit_search"
).
click
(
function
()
{
$
(
"#submit_search"
).
click
(
function
()
{
$
(
'#dg'
).
datagrid
({
queryParams
:
form2Json
(
"searchform"
)
});
//点击搜索
$
(
'#dg'
).
datagrid
({
queryParams
:
form2Json
(
"searchform"
)
});
//点击搜索
});
});
...
...
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