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
92125b20
Commit
92125b20
authored
Nov 12, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加应用修改
parent
e10449b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
12 deletions
+70
-12
ApplicationController.php
backend/controllers/ApplicationController.php
+2
-8
CoinApplicationForm.php
backend/models/coin/CoinApplicationForm.php
+10
-2
add.php
backend/views/application/add.php
+29
-1
edit.php
backend/views/application/edit.php
+29
-1
No files found.
backend/controllers/ApplicationController.php
View file @
92125b20
...
@@ -50,7 +50,7 @@ class ApplicationController extends BaseController
...
@@ -50,7 +50,7 @@ class ApplicationController extends BaseController
if
(
Yii
::
$app
->
request
->
isPost
){
if
(
Yii
::
$app
->
request
->
isPost
){
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
format
=
'json'
;
$category_id
=
Yii
::
$app
->
request
->
get
(
'category_id'
);
$category_id
=
Yii
::
$app
->
request
->
get
(
'category_id'
);
$fields
=
[
'category_id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
];
$fields
=
[
'category_id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'
show_width'
,
'show_height'
,
'open_type'
,
'
name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
];
$params
=
array_merge
(
Yii
::
$app
->
request
->
post
(),[
'category_id'
=>
$category_id
]);
$params
=
array_merge
(
Yii
::
$app
->
request
->
post
(),[
'category_id'
=>
$category_id
]);
$params
=
$this
->
initParams
(
$params
,
$fields
);
$params
=
$this
->
initParams
(
$params
,
$fields
);
$coin_applicateion_form
=
new
CoinApplicationForm
();
$coin_applicateion_form
=
new
CoinApplicationForm
();
...
@@ -70,7 +70,7 @@ class ApplicationController extends BaseController
...
@@ -70,7 +70,7 @@ class ApplicationController extends BaseController
{
{
if
(
Yii
::
$app
->
request
->
isPost
)
{
if
(
Yii
::
$app
->
request
->
isPost
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
format
=
'json'
;
$fields
=
[
'category_id'
,
'id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
];
$fields
=
[
'category_id'
,
'id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'
show_width'
,
'show_height'
,
'open_type'
,
'
name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
];
$params
=
$this
->
initParams
(
Yii
::
$app
->
request
->
post
(),
$fields
);
$params
=
$this
->
initParams
(
Yii
::
$app
->
request
->
post
(),
$fields
);
$coin_applicateion_form
=
new
CoinApplicationForm
();
$coin_applicateion_form
=
new
CoinApplicationForm
();
$coin_applicateion_form
->
setScenario
(
CoinApplicationForm
::
SCENARIO_EDIT
);
$coin_applicateion_form
->
setScenario
(
CoinApplicationForm
::
SCENARIO_EDIT
);
...
@@ -101,12 +101,6 @@ class ApplicationController extends BaseController
...
@@ -101,12 +101,6 @@ class ApplicationController extends BaseController
}
else
{
}
else
{
$applicate
[
'icon_url'
]
=
""
;
$applicate
[
'icon_url'
]
=
""
;
}
}
if
(
$applicate
[
'icon'
]){
$icon_info
=
$coin_items
[
$applicate
[
'icon'
]];
$applicate
[
'icon_url'
]
=
$icon_info
[
'base_url'
]
.
$icon_info
[
'file_url'
];
}
else
{
$applicate
[
'icon_url'
]
=
""
;
}
if
(
$applicate
[
'h5_icon'
]){
if
(
$applicate
[
'h5_icon'
]){
$icon_info
=
$coin_items
[
$applicate
[
'h5_icon'
]];
$icon_info
=
$coin_items
[
$applicate
[
'h5_icon'
]];
$applicate
[
'h5_icon_url'
]
=
$icon_info
[
'base_url'
]
.
$icon_info
[
'file_url'
];
$applicate
[
'h5_icon_url'
]
=
$icon_info
[
'base_url'
]
.
$icon_info
[
'file_url'
];
...
...
backend/models/coin/CoinApplicationForm.php
View file @
92125b20
...
@@ -36,12 +36,15 @@ class CoinApplicationForm extends BaseForm
...
@@ -36,12 +36,15 @@ class CoinApplicationForm extends BaseForm
public
$description
;
public
$description
;
public
$image_ids
;
public
$image_ids
;
public
$redirect_type
;
public
$redirect_type
;
public
$show_width
;
public
$show_height
;
public
$open_type
;
public
function
scenarios
()
public
function
scenarios
()
{
{
return
[
return
[
self
::
SCENARIO_ADD
=>
[
'category_id'
,
'name'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
],
self
::
SCENARIO_ADD
=>
[
'category_id'
,
'name'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
's
how_width'
,
'show_height'
,
'open_type'
,
's
ort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
],
self
::
SCENARIO_EDIT
=>
[
'category_id'
,
'id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
],
self
::
SCENARIO_EDIT
=>
[
'category_id'
,
'id'
,
'h5_icon'
,
'official_url'
,
'introduce_image'
,
'
show_width'
,
'show_height'
,
'open_type'
,
'
name'
,
'sort'
,
'icon'
,
'type'
,
'native_url'
,
'native_login_url'
,
'h5_url'
,
'android_url'
,
'ios_url'
,
'app_store_url'
,
'advertise'
,
'description'
,
'redirect_type'
],
];
];
}
}
...
@@ -67,6 +70,9 @@ class CoinApplicationForm extends BaseForm
...
@@ -67,6 +70,9 @@ class CoinApplicationForm extends BaseForm
'advertise'
=>
'宣传语'
,
'advertise'
=>
'宣传语'
,
'description'
=>
'介绍'
,
'description'
=>
'介绍'
,
'redirect_type'
=>
'跳转方式'
,
'redirect_type'
=>
'跳转方式'
,
'show_width'
=>
'显示宽度'
,
'show_height'
=>
'显示高度'
,
'open_type'
=>
'H5打开方式'
];
];
}
}
...
@@ -81,6 +87,8 @@ class CoinApplicationForm extends BaseForm
...
@@ -81,6 +87,8 @@ class CoinApplicationForm extends BaseForm
[
'description'
,
'string'
,
'length'
=>
[
0
,
500
]],
[
'description'
,
'string'
,
'length'
=>
[
0
,
500
]],
[
'type'
,
'default'
,
'value'
=>
1
],
[
'type'
,
'default'
,
'value'
=>
1
],
[
'redirect_type'
,
'default'
,
'value'
=>
1
],
[
'redirect_type'
,
'default'
,
'value'
=>
1
],
[
'show_height'
,
'default'
,
'value'
=>
0
],
[
'show_width'
,
'default'
,
'value'
=>
0
],
];
];
}
}
...
...
backend/views/application/add.php
View file @
92125b20
...
@@ -6,6 +6,11 @@
...
@@ -6,6 +6,11 @@
* Time: 21:01
* Time: 21:01
*/
*/
?>
?>
<style>
.layui-form-label
{
width
:
110px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md6"
>
<form
class=
"layui-form"
method=
"post"
action=
""
>
<form
class=
"layui-form"
method=
"post"
action=
""
>
...
@@ -131,7 +136,19 @@
...
@@ -131,7 +136,19 @@
<textarea
class=
"layui-textarea"
name=
"description"
></textarea>
<textarea
class=
"layui-textarea"
name=
"description"
></textarea>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
显示尺寸
</label>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"text"
name=
"show_width"
placeholder=
"宽"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid"
>
px
</div>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"text"
name=
"show_height"
placeholder=
"高"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid"
>
px
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
跳转方式
</label>
<label
class=
"layui-form-label"
>
跳转方式
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
...
@@ -143,6 +160,17 @@
...
@@ -143,6 +160,17 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
H5打开方式
</label>
<div
class=
"layui-input-block"
>
<select
name=
"open_type"
>
<option
value=
"0"
>
选择打开方式
</option>
<option
value=
"1"
>
钱包内打开
</option>
<option
value=
"2"
>
浏览器打开
</option>
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
<button
class=
"layui-btn"
>
提交
</button>
<button
class=
"layui-btn"
>
提交
</button>
</div>
</div>
</form>
</form>
...
...
backend/views/application/edit.php
View file @
92125b20
...
@@ -6,6 +6,11 @@
...
@@ -6,6 +6,11 @@
* Time: 16:01
* Time: 16:01
*/
*/
?>
?>
<style>
.layui-form-label
{
width
:
110px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md12"
>
<div
class=
"layui-col-md12"
>
<form
class=
"layui-form"
method=
"post"
action=
""
id=
"applicateEdit"
>
<form
class=
"layui-form"
method=
"post"
action=
""
id=
"applicateEdit"
>
...
@@ -133,7 +138,19 @@
...
@@ -133,7 +138,19 @@
<textarea
class=
"layui-textarea"
name=
"description"
>
<?=
$item
[
'description'
]
?>
</textarea>
<textarea
class=
"layui-textarea"
name=
"description"
>
<?=
$item
[
'description'
]
?>
</textarea>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
显示尺寸
</label>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"text"
name=
"show_width"
placeholder=
"宽"
autocomplete=
"off"
class=
"layui-input"
value=
"
<?=
$item
[
'show_width'
]
?>
"
>
</div>
<div
class=
"layui-form-mid"
>
px
</div>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"text"
name=
"show_height"
placeholder=
"高"
autocomplete=
"off"
class=
"layui-input"
value=
"
<?=
$item
[
'show_height'
]
?>
"
>
</div>
<div
class=
"layui-form-mid"
>
px
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
跳转方式
</label>
<label
class=
"layui-form-label"
>
跳转方式
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
...
@@ -143,6 +160,17 @@
...
@@ -143,6 +160,17 @@
</select>
</select>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
H5打开方式
</label>
<div
class=
"layui-input-block"
>
<select
name=
"open_type"
>
<option
value=
"0"
>
选择打开方式
</option>
<option
value=
"1"
<?php
if
(
$item
[
'open_type'
]
==
1
)
echo
"selected"
?>
>
钱包内打开
</option>
<option
value=
"2"
<?php
if
(
$item
[
'open_type'
]
==
2
)
echo
"selected"
?>
>
浏览器打开
</option>
</select>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
...
...
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