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
8b5ca475
Commit
8b5ca475
authored
Jun 24, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/ucenter
parents
8a403411
2eebd9e6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
CoinRecommendController.php
backend/controllers/CoinRecommendController.php
+2
-1
index.php
backend/views/coin-recommend/index.php
+22
-3
CoinRecommend.php
common/models/psources/CoinRecommend.php
+3
-1
No files found.
backend/controllers/CoinRecommendController.php
View file @
8b5ca475
...
...
@@ -57,7 +57,8 @@ class CoinRecommendController extends BaseController
}
else
{
$platforms
=
CoinPlatform
::
find
()
->
where
([
'id'
=>
$user_platform_id
])
->
asArray
()
->
all
();
}
return
$this
->
render
(
'index'
,
[
'platforms'
=>
$platforms
]);
$chains
=
Coin
::
getPlatformList
();
return
$this
->
render
(
'index'
,
[
'platforms'
=>
$platforms
,
'chains'
=>
$chains
]);
}
public
function
actionAdd
()
...
...
backend/views/coin-recommend/index.php
View file @
8b5ca475
...
...
@@ -47,6 +47,7 @@
<div
style=
"display: none; padding: 5px 5px;"
id=
"_form"
>
<form
class=
"layui-form"
id=
"form1"
lay-filter=
"form1"
>
<input
type=
"hidden"
name=
"id"
value=
""
>
<input
type=
"hidden"
name=
"platform_id_hidden"
id =
'platform_id_hidden'
value=
""
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
钱包
</label>
<div
class=
"layui-input-inline"
>
...
...
@@ -88,6 +89,17 @@
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
所属链
</label>
<div
class=
"layui-input-inline"
>
<select
class=
"layui-select"
name=
"chain"
>
<option
value=
""
>
请选择一个链
</option>
<?php
foreach
(
$chains
as
$chain
)
:
?>
<option
value=
"
<?=
$chain
?>
"
>
<?=
$chain
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
</form>
</div>
...
...
@@ -162,6 +174,10 @@ table.render({
templet
:
'#type_tpl'
},
{
field
:
'chain'
,
title
:
'所属链'
,
},
{
field
:
'sort'
,
title
:
'排序'
},
...
...
@@ -191,7 +207,8 @@ table.on('toolbar(table1)', function(obj) {
coin
:
''
,
sort
:
''
,
recommend
:
''
,
type
:
''
type
:
''
,
chain
:
''
,
});
},
btn1
:
function
()
{
...
...
@@ -238,12 +255,14 @@ table.on('tool(table1)', function(obj) {
coin
:
data
.
coin
,
sort
:
data
.
sort
,
recommend
:
data
.
recommend
,
type
:
data
.
type
type
:
data
.
type
,
chain
:
data
.
chain
,
platform_id_hidden
:
data
.
platform_id
});
},
btn1
:
function
()
{
var
data
=
$
(
"#form1"
).
serialize
();
data
+=
"&platform_id="
+
$
(
'#platform_id'
).
val
();
data
+=
"&platform_id="
+
$
(
'#platform_id
_hidden
'
).
val
();
$
.
get
(
'/admin/coin-recommend/add'
,
data
,
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
...
...
common/models/psources/CoinRecommend.php
View file @
8b5ca475
...
...
@@ -82,6 +82,7 @@ class CoinRecommend extends BaseActiveRecord
$recommend_type
=
$params
[
'recommend'
]
??
1
;
$sort
=
$params
[
'sort'
]
??
0
;
$type
=
$params
[
'type'
]
??
1
;
$chain
=
$params
[
'chain'
]
??
''
;
$coin
=
Coin
::
findOne
([
'name'
=>
strtoupper
(
$coin_name
)]);
if
(
empty
(
$coin
))
{
...
...
@@ -92,7 +93,7 @@ class CoinRecommend extends BaseActiveRecord
$coin_recommend
=
CoinRecommend
::
findOne
(
$id
);
}
else
{
$coin_recommend
=
new
CoinRecommend
();
$count
=
self
::
find
()
->
where
([
'cid'
=>
$coin
->
id
,
'platform_id'
=>
$platform_id
,
'type'
=>
$type
])
->
count
();
$count
=
self
::
find
()
->
where
([
'cid'
=>
$coin
->
id
,
'platform_id'
=>
$platform_id
,
'type'
=>
$type
,
'chain'
=>
$chain
])
->
count
();
if
(
$count
>
0
)
{
return
[
'code'
=>
-
1
,
'msg'
=>
'推荐币种已经存在'
];
}
...
...
@@ -106,6 +107,7 @@ class CoinRecommend extends BaseActiveRecord
$coin_recommend
->
platform_id
=
$platform_id
;
$coin_recommend
->
sort
=
$sort
;
$coin_recommend
->
type
=
$type
;
$coin_recommend
->
chain
=
$chain
;
if
(
$coin_recommend
->
save
())
{
return
[
'code'
=>
0
,
'msg'
=>
'保存成功'
];
}
...
...
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