Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
7de66c6c
Commit
7de66c6c
authored
Aug 26, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SFT 海报增加 类型
parent
9845b193
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
20 deletions
+32
-20
CoinPlatformBannerController.php
api/controllers/CoinPlatformBannerController.php
+4
-3
CoinPlatformBannerController.php
backend/controllers/CoinPlatformBannerController.php
+16
-14
index.php
backend/views/coin-platform-banner/index.php
+12
-3
No files found.
api/controllers/CoinPlatformBannerController.php
View file @
7de66c6c
...
@@ -13,14 +13,15 @@ class CoinPlatformBannerController extends BaseController
...
@@ -13,14 +13,15 @@ class CoinPlatformBannerController extends BaseController
$code
=
0
;
$code
=
0
;
$msg
=
'success'
;
$msg
=
'success'
;
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
''
);
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
''
);
if
(
empty
(
$platform_id
)){
$type
=
Yii
::
$app
->
request
->
get
(
'type'
,
''
);
$msg
=
'参数不能为空'
;
if
(
empty
(
$platform_id
)
||
empty
(
$type
))
{
$msg
=
'参数错误'
;
$code
=
-
1
;
$code
=
-
1
;
$data
=
null
;
$data
=
null
;
goto
doEnd
;
goto
doEnd
;
}
}
$data
=
CoinPlatformBanner
::
find
()
->
where
([
'platform_id'
=>
$platform_id
])
->
asArray
()
->
all
();
$data
=
CoinPlatformBanner
::
find
()
->
where
([
'platform_id'
=>
$platform_id
,
'type'
=>
$type
])
->
asArray
()
->
all
();
doEnd
:
doEnd
:
return
[
'code'
=>
$code
,
'data'
=>
$data
,
'msg'
=>
$msg
];
return
[
'code'
=>
$code
,
'data'
=>
$data
,
'msg'
=>
$msg
];
...
...
backend/controllers/CoinPlatformBannerController.php
View file @
7de66c6c
...
@@ -14,14 +14,16 @@ class CoinPlatformBannerController extends BaseController
...
@@ -14,14 +14,16 @@ class CoinPlatformBannerController extends BaseController
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$request
=
Yii
::
$app
->
request
;
$image_url
=
$request
->
post
(
'image_url'
,
''
);
$image_url
=
$request
->
post
(
'image_url'
,
''
);
if
(
$image_url
){
$type
=
$request
->
post
(
'banner_type'
,
1
);
if
(
$image_url
)
{
$banner_item
=
new
CoinPlatformBanner
();
$banner_item
=
new
CoinPlatformBanner
();
$banner_item
->
image_url
=
$image_url
;
$banner_item
->
image_url
=
$image_url
;
$banner_item
->
platform_id
=
$user_platform_id
;
$banner_item
->
platform_id
=
$user_platform_id
;
$banner_item
->
type
=
$type
;
$banner_item
->
save
();
$banner_item
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'banner添加成功'
];
return
[
'code'
=>
0
,
'msg'
=>
'banner添加成功'
];
}
else
{
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'banner添加加失败'
];
return
[
'code'
=>
1
,
'msg'
=>
'banner添加加失败'
];
}
}
}
}
}
}
...
@@ -36,15 +38,15 @@ class CoinPlatformBannerController extends BaseController
...
@@ -36,15 +38,15 @@ class CoinPlatformBannerController extends BaseController
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'id'
,
''
);
$id
=
$request
->
get
(
'id'
,
''
);
if
(
$id
)
{
if
(
$id
)
{
$banner
=
CoinPlatformBanner
::
getBanner
(
$id
);
$banner
=
CoinPlatformBanner
::
getBanner
(
$id
);
if
(
!
$banner
)
{
if
(
!
$banner
)
{
return
[
'code'
=>
1
,
'msg'
=>
'banner不存在,不能删除'
];
return
[
'code'
=>
1
,
'msg'
=>
'banner不存在,不能删除'
];
}
}
$banner
->
delete
();
$banner
->
delete
();
return
[
'code'
=>
0
,
'msg'
=>
'banner删除成功'
];
return
[
'code'
=>
0
,
'msg'
=>
'banner删除成功'
];
}
else
{
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'banner删除失败'
];
return
[
'code'
=>
1
,
'msg'
=>
'banner删除失败'
];
}
}
}
}
}
}
...
@@ -55,17 +57,17 @@ class CoinPlatformBannerController extends BaseController
...
@@ -55,17 +57,17 @@ class CoinPlatformBannerController extends BaseController
public
function
actionIndex
()
public
function
actionIndex
()
{
{
$user_platform_id
=
Yii
::
$app
->
user
->
identity
->
platform_id
;
$user_platform_id
=
Yii
::
$app
->
user
->
identity
->
platform_id
;
if
(
Yii
::
$app
->
request
->
isAjax
)
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
format
=
'json'
;
$condition
=
[];
$condition
=
[];
if
(
1
!==
$user_platform_id
)
{
if
(
1
!==
$user_platform_id
)
{
$condition
=
[
'platform_id'
=>
$user_platform_id
];
$condition
=
[
'platform_id'
=>
$user_platform_id
];
}
}
$data
=
CoinPlatformBanner
::
getItems
(
$condition
);
$data
=
CoinPlatformBanner
::
getItems
(
$condition
);
foreach
(
$data
as
$key
=>
&
$val
){
foreach
(
$data
as
$key
=>
&
$val
)
{
$val
[
'coin_name'
]
=
isset
(
$val
[
'platform'
][
'name'
])
?
$val
[
'platform'
][
'name'
]
:
''
;
$val
[
'coin_name'
]
=
isset
(
$val
[
'platform'
][
'name'
])
?
$val
[
'platform'
][
'name'
]
:
''
;
}
}
return
[
'data'
=>
$data
,
'code'
=>
0
];
return
[
'data'
=>
$data
,
'code'
=>
0
];
}
}
return
$this
->
render
(
'index'
);
return
$this
->
render
(
'index'
);
}
}
...
...
backend/views/coin-platform-banner/index.php
View file @
7de66c6c
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<div
class=
"layui-col-md9"
>
<div
class=
"layui-col-md9"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
</div>
<div
class=
"layui-row add"
style=
"display: none;padding: 5px;"
id=
"_form"
>
<div
class=
"layui-row add"
style=
"display: none;padding: 5
0
px;"
id=
"_form"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md11"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md11"
>
<form
class=
"layui-form"
action=
"javascript:void(0)"
id=
"form1"
method=
"post"
lay-filter=
"form1"
>
<form
class=
"layui-form"
action=
"javascript:void(0)"
id=
"form1"
method=
"post"
lay-filter=
"form1"
>
<input
type=
"hidden"
name=
"_csrf"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
<input
type=
"hidden"
name=
"_csrf"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
...
@@ -31,6 +31,15 @@
...
@@ -31,6 +31,15 @@
</button>
</button>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
图片类型
</label>
<div
class=
"layui-input-block"
>
<select
name=
"banner_type"
>
<option
value=
"1"
>
banner
</option>
<option
value=
"2"
>
海报
</option>
</select>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
...
@@ -54,7 +63,7 @@
...
@@ -54,7 +63,7 @@
},
},
{
{
field
:
'image_url'
,
field
:
'image_url'
,
title
:
'图片
跳转
地址'
,
title
:
'图片地址'
,
width
:
600
width
:
600
},
},
{
{
...
@@ -87,7 +96,7 @@
...
@@ -87,7 +96,7 @@
$
(
'#add'
).
click
(
function
()
{
$
(
'#add'
).
click
(
function
()
{
var
index
=
layer
.
open
({
var
index
=
layer
.
open
({
title
:
'添加banner'
,
title
:
'添加banner'
,
area
:
'
80
0px'
,
area
:
'
75
0px'
,
type
:
1
,
type
:
1
,
content
:
$
(
"#_form"
),
content
:
$
(
"#_form"
),
btn
:
[
'保存'
,
'取消'
],
btn
:
[
'保存'
,
'取消'
],
...
...
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