Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
5320a2ab
Commit
5320a2ab
authored
Apr 03, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner管理
parent
b0b96f66
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
22 deletions
+73
-22
Banner.php
application/api/controller/Banner.php
+18
-4
Banner.php
application/index/controller/Banner.php
+7
-9
advertising.html
application/index/view/banner/advertising.html
+1
-0
banner.html
application/index/view/banner/banner.html
+1
-0
banner.js
public/resource/js/banner.js
+12
-1
banner_template_tpl.html
public/resource/template/banner_template_tpl.html
+34
-8
No files found.
application/api/controller/Banner.php
View file @
5320a2ab
...
...
@@ -31,13 +31,27 @@ class Banner extends Basic
*/
public
function
getBannerList
()
{
$params
=
$this
->
params
;
/*$params = array(
"site_area" => 1,//1表示c端 2表示b端
);*/
$where_
=
[];
if
(
!
isset
(
$params
[
"site_area"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
(
$params
[
"site_area"
]
==
1
){
$where_
[
"type"
]
=
array
(
"in"
,[
0
,
1
]);
}
else
{
$where_
[
"type"
]
=
array
(
"in"
,[
2
,
3
]);
}
$field
=
"id,title,CONCAT('"
.
CK_IMG_URL
.
"' , pic_path) as pic_path, url, type,sort,is_show,create_time,update_time"
;
$params
[
'is_show'
]
=
array
(
"eq"
,
0
);
$where_
[
'is_show'
]
=
array
(
"eq"
,
0
);
$result
=
$this
->
bannerModel
->
getBannerList
(
1
,
15
,
"sort desc"
,
$field
,
$params
);
// $jwt = new JwtUntils();
// $data['is_login'] = '0'; //0未登录
// $result['AuthToken'] = $jwt->createToken($data);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
...
...
application/index/controller/Banner.php
View file @
5320a2ab
...
...
@@ -48,15 +48,13 @@ class Banner extends Basic
*/
public
function
getBannerList
()
{
$field
=
"id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time"
;
$field
=
"id,title,pic_path,url,sort,hits,is_show,
type,
up_user,create_time,update_time"
;
$params
[
'is_show'
]
=
array
(
"eq"
,
0
);
$params
[
'type'
]
=
array
(
"
eq"
,
0
);
$params
[
'type'
]
=
array
(
"
in"
,
[
0
,
2
]
);
$pageNo
=
empty
(
$_POST
[
'pageNo'
])
?
1
:
$_POST
[
'pageNo'
];
$pageSize
=
empty
(
$_POST
[
'pageSize'
])
?
15
:
$_POST
[
'pageSize'
];
$result
[
"list"
]
=
$this
->
bannerModel
->
getBannerList
(
$pageNo
,
$pageSize
,
"sort desc"
,
$field
,
$params
);
$result
[
"total"
]
=
$this
->
bannerModel
->
getBannerTotal
(
$params
);
$result
[
"list"
]
=
$this
->
bannerModel
->
getBannerList
(
$pageNo
,
$pageSize
,
"sort desc"
,
$field
,
$params
);
$result
[
"total"
]
=
$this
->
bannerModel
->
getBannerTotal
(
$params
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
...
...
@@ -66,9 +64,9 @@ class Banner extends Basic
*/
public
function
getPopList
()
{
$field
=
"id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time"
;
$field
=
"id,title,pic_path,url,sort,hits,is_show,
type,
up_user,create_time,update_time"
;
$params
[
'is_show'
]
=
array
(
"eq"
,
0
);
$params
[
'type'
]
=
array
(
"
eq"
,
1
);
$params
[
'type'
]
=
array
(
"
in"
,
[
1
,
3
]
);
$pageNo
=
empty
(
$_POST
[
'pageNo'
])
?
1
:
$_POST
[
'pageNo'
];
$pageSize
=
empty
(
$_POST
[
'pageSize'
])
?
15
:
$_POST
[
'pageSize'
];
$result
[
"list"
]
=
$this
->
bannerModel
...
...
@@ -136,7 +134,7 @@ class Banner extends Basic
public
function
upIsShow
()
{
$params
=
array
(
"id"
=>
$_POST
[
"id"
],
"id"
=>
$_POST
[
"id"
],
"is_show"
=>
$_POST
[
"is_show"
]
);
$result
=
$this
->
bannerModel
->
upIsShow
(
$params
);
...
...
application/index/view/banner/advertising.html
View file @
5320a2ab
...
...
@@ -32,6 +32,7 @@
<tr>
<th>
标题
</th>
<th>
图片
</th>
<th>
显示
</th>
<th>
链接
</th>
<th>
排序
</th>
<th>
点击
</th>
...
...
application/index/view/banner/banner.html
View file @
5320a2ab
...
...
@@ -32,6 +32,7 @@
<tr>
<th>
标题
</th>
<th>
图片
</th>
<th>
显示
</th>
<th>
链接
</th>
<th>
排序
</th>
<th>
点击
</th>
...
...
public/resource/js/banner.js
View file @
5320a2ab
...
...
@@ -34,7 +34,18 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
params
.
url
=
$
(
"#url"
).
val
();
params
.
cover_image
=
$
(
"#cover_image"
).
val
();
params
.
sort
=
$
(
"#sort"
).
val
();
params
.
type
=
$
(
"#type"
).
val
();
var
banner_type
=
$
(
"input[name=banner_type]:checked"
).
val
();
var
page_type
=
$
(
"#type"
).
val
();
if
(
page_type
==
0
&&
banner_type
==
0
){
params
.
type
=
0
;
}
else
if
(
page_type
==
0
&&
banner_type
==
1
){
params
.
type
=
2
;
}
else
if
(
page_type
==
1
&&
banner_type
==
0
){
params
.
type
=
1
;
}
else
if
(
page_type
==
1
&&
banner_type
==
1
){
params
.
type
=
3
;
}
if
(
!
params
.
title
||
params
.
title
==
null
)
{
alert
(
"banner名称不能为空"
);
...
...
public/resource/template/banner_template_tpl.html
View file @
5320a2ab
<script
id=
"banner_list_tpl"
type=
"text/template"
>
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
>
<
tr
>
<
td
>
[
%=
it
[
item
][
"title"
]
%
]
<
/td
>
<
td
>
<
input
type
=
"hidden"
value
=
'[%= it[item]["pic_path"] %]'
>
<
img
src
=
'/resource/lib/Attachments/[%= it[item]["pic_path"] %]'
class
=
"diagram-image J_preview"
data
-
bimg
=
'/resource/lib/Attachments/[%= it[item]["pic_path"] %]'
>
<
img
src
=
'/resource/lib/Attachments/[%= it[item]["pic_path"] %]'
class
=
"diagram-image J_preview"
data
-
bimg
=
'/resource/lib/Attachments/[%= it[item]["pic_path"] %]'
>
<
/td
>
<
td
>
[
%
if
(
it
[
item
][
"type"
]
==
0
||
it
[
item
][
"type"
]
==
1
)
{
%
]
用户
app
[
%
}
else
{
%
]
经纪人
app
[
%
}
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"url"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"sort"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"hits"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"up_user"
]
%
]
<
/td
>
<
td
>
<
a
class
=
"btn1 btn-success editor_banner "
href
=
"#modal-add-do"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[item]['id'] %]"
>
<
a
class
=
"btn1 btn-success editor_banner "
href
=
"#modal-add-do"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[item]['id'] %]"
>
编辑
<
/a
>
<
a
class
=
"btn1 btn-danger delete_banner "
href
=
"#modal-delete"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[item]['id'] %]"
>
<
a
class
=
"btn1 btn-danger delete_banner "
href
=
"#modal-delete"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[item]['id'] %]"
>
删除
<
/a
>
<
/td
>
...
...
@@ -70,6 +80,19 @@
</div>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
显示:
</label>
<div
class=
"col-sm-9"
>
<label>
<input
type=
"radio"
name=
"banner_type"
value=
"0"
checked
>
用户端
</label>
<label>
<input
type=
"radio"
name=
"banner_type"
value=
"1"
>
经纪人端
</label>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
标题:
</label>
<div
class=
"col-sm-9"
>
...
...
@@ -81,13 +104,15 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
链接:
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control btn6"
name=
"title"
id=
"url"
autocomplete=
"off"
placeholder=
"请输入链接"
>
<input
type=
"text"
class=
"form-control btn6"
name=
"title"
id=
"url"
autocomplete=
"off"
placeholder=
"请输入链接"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
图片:
</label>
<div
class=
"col-sm-9"
>
<input
readonly=
"readonly"
type=
"text"
name=
"cover_image"
class=
"form-control"
style=
"width: 150px !important;display: inline-block"
<input
readonly=
"readonly"
type=
"text"
name=
"cover_image"
class=
"form-control"
style=
"width: 150px !important;display: inline-block"
id=
"cover_image"
class=
"require"
placeholder=
"请选择图片"
/>
<button
class=
"banner_img btn btn-default"
type=
"button"
>
选择图片
</button>
<span
class=
"tip"
>
建议尺寸288x320
</span>
...
...
@@ -96,7 +121,8 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
排序:
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control btn6"
name=
"title"
id=
"sort"
autocomplete=
"off"
placeholder=
"请输入排序"
>
<input
type=
"text"
class=
"form-control btn6"
name=
"title"
id=
"sort"
autocomplete=
"off"
placeholder=
"请输入排序"
>
</div>
</div>
</form>
...
...
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