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
010b4916
Commit
010b4916
authored
Sep 21, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f3ab64e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
17 deletions
+33
-17
CoinReleaseMemberController.php
backend/controllers/CoinReleaseMemberController.php
+16
-12
list.php
backend/views/coin-publish-rule/list.php
+1
-1
list.js
backend/web/js/coin-release-member/list.js
+16
-4
No files found.
backend/controllers/CoinReleaseMemberController.php
View file @
010b4916
...
...
@@ -21,8 +21,8 @@ class CoinReleaseMemberController extends BaseController
public
function
actionList
()
{
$get
=
Yii
::
$app
->
request
->
get
();
$page
=
$get
[
'page'
]
??
1
;
$get
=
Yii
::
$app
->
request
->
get
();
$page
=
$get
[
'page'
]
??
1
;
$limit
=
$get
[
'limit'
]
??
10
;
if
(
Yii
::
$app
->
request
->
isAjax
)
{
...
...
@@ -33,7 +33,7 @@ class CoinReleaseMemberController extends BaseController
return
[
'code'
=>
-
1
,
'msg'
=>
'failed'
];
}
$condition
=
[[
'rule_id'
=>
$rule_id
]];
$datas
=
CoinReleaseMember
::
getList
(
$page
,
$limit
,
$condition
);
$datas
=
CoinReleaseMember
::
getList
(
$page
,
$limit
,
$condition
);
return
$datas
;
}
return
$this
->
render
(
'list'
);
...
...
@@ -47,15 +47,15 @@ class CoinReleaseMemberController extends BaseController
}
else
{
if
(
Yii
::
$app
->
request
->
isPost
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$post
=
Yii
::
$app
->
request
->
post
();
$post
=
Yii
::
$app
->
request
->
post
();
// 获取rule_id
$rule_id
=
$this
->
getRuleId
();
if
(
$rule_id
)
{
$post
[
'rule_id'
]
=
$rule_id
;
$post
[
'rule_id'
]
=
$rule_id
;
$coin_publish_rule
=
CoinPublishRule
::
findOne
(
$rule_id
);
if
(
$coin_publish_rule
)
{
$post
[
'release'
]
=
$post
[
'amount'
]
*
(
100
-
$coin_publish_rule
->
lock
)
/
100
;
$post
[
'freeze'
]
=
$post
[
'amount'
]
*
$coin_publish_rule
->
lock
/
100
;
$post
[
'freeze'
]
=
$post
[
'amount'
]
*
$coin_publish_rule
->
lock
/
100
;
}
else
{
return
[
'code'
=>
-
1
,
'msg'
=>
'规则不存在'
];
}
...
...
@@ -63,13 +63,16 @@ class CoinReleaseMemberController extends BaseController
return
[
'code'
=>
-
1
,
'msg'
=>
'规则不存在'
];
}
if
(
isset
(
$post
[
'id'
])
&&
!
empty
(
$post
[
'id'
]))
{
$model
=
CoinReleaseMember
::
findOne
(
$post
[
'id'
]);
$model
=
CoinReleaseMember
::
findOne
(
$post
[
'id'
]);
$model
->
scenario
=
CoinReleaseMember
::
SCENARIOS_UPDATE
;
}
else
{
$model
=
new
CoinReleaseMember
();
$model
=
new
CoinReleaseMember
();
$model
->
scenario
=
CoinReleaseMember
::
SCENARIOS_ADD
;
}
if
(
$model
->
load
(
$post
)
&&
$model
->
validate
())
{
$model
->
amount
=
$model
->
amount
*
1e8
;
$model
->
release
=
$model
->
release
*
1e8
;
$model
->
freeze
=
$model
->
freeze
*
1e8
;
if
(
$model
->
save
())
{
return
[
'code'
=>
0
,
'msg'
=>
'添加成功'
];
}
...
...
@@ -87,14 +90,14 @@ class CoinReleaseMemberController extends BaseController
public
function
actionImplode
()
{
Yii
::
$app
->
response
->
format
=
'json'
;
$file
=
UploadedFile
::
getInstanceByName
(
'file'
);
$file
=
UploadedFile
::
getInstanceByName
(
'file'
);
try
{
$fd
=
fopen
(
$file
->
tempName
,
'r'
);
$data
=
[];
$fd
=
fopen
(
$file
->
tempName
,
'r'
);
$data
=
[];
$rule_id
=
$this
->
getRuleId
();
if
(
$rule_id
)
{
$coin_publish_rule
=
CoinPublishRule
::
findOne
(
$rule_id
);
$present
=
$coin_publish_rule
->
lock
;
$present
=
$coin_publish_rule
->
lock
;
if
(
!
$coin_publish_rule
)
{
return
[
'code'
=>
-
1
,
'msg'
=>
'规则不存在'
];
}
...
...
@@ -127,6 +130,7 @@ class CoinReleaseMemberController extends BaseController
/**
* 获取rule_id
*
* @return int
*/
private
function
getRuleId
()
...
...
backend/views/coin-publish-rule/list.php
View file @
010b4916
...
...
@@ -23,7 +23,7 @@ ListAsset::register($this);
<tr>
<td>
<?=
$coin_name
?>
</td>
<td>
<?=
$amount
/
1e8
?>
</td>
<td>
<?=
$release_amount
?>
</td>
<td>
<?=
$release_amount
/
1e8
?>
</td>
<td>
<?=
$address
?>
</td>
</tr>
</tbody>
...
...
backend/web/js/coin-release-member/list.js
View file @
010b4916
...
...
@@ -9,9 +9,21 @@ table.render({
cols
:
[[
{
field
:
'mobile'
,
title
:
'手机号'
},
{
field
:
'coin'
,
title
:
'币种'
},
{
field
:
'amount'
,
title
:
'总量'
},
{
field
:
'release'
,
title
:
'已解冻'
},
{
field
:
'freeze'
,
title
:
'已冻结'
},
{
field
:
'amount'
,
title
:
'总量'
,
templet
:
function
(
d
)
{
return
d
.
amount
/
1
e8
;
}
},
{
field
:
'release'
,
title
:
'已解冻'
,
templet
:
function
(
d
)
{
return
d
.
release
/
1
e8
;
}
},
{
field
:
'freeze'
,
title
:
'已冻结'
,
templet
:
function
(
d
)
{
return
d
.
freeze
/
1
e8
;
}
},
]]
});
...
...
@@ -29,7 +41,7 @@ upload.render({
}
});
},
before
:
function
(
obj
)
{
//obj参数包含的信息,跟 choose回调完全一致,可参见上文。
before
:
function
(
obj
)
{
//obj参数包含的信息,跟 choose回调完全一致,可参见上文。
layer
.
load
();
//上传loading
}
});
...
...
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