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
3098add5
Commit
3098add5
authored
Jan 18, 2019
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9a7e2e8f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
16 deletions
+63
-16
CoinReleaseMemberController.php
backend/controllers/CoinReleaseMemberController.php
+2
-5
list.php
backend/views/coin-release-member/list.php
+0
-0
list.js
backend/web/js/coin-release-member/list.js
+45
-4
CoinBusiness.php
common/business/CoinBusiness.php
+11
-4
CoinBTYService.php
common/service/coin/CoinBTYService.php
+1
-1
CoinService.php
common/service/coin/CoinService.php
+4
-2
No files found.
backend/controllers/CoinReleaseMemberController.php
View file @
3098add5
...
...
@@ -127,17 +127,14 @@ class CoinReleaseMemberController extends BaseController
$value
[]
=
$value
[
3
]
*
$present
/
100
;
$value
[]
=
$company_name
;
}
$result
=
CoinReleaseMember
::
implode
(
$data
);
if
(
$result
)
{
return
[
'code'
=>
0
,
'msg'
=>
'导入成功'
];
}
//$result = CoinReleaseMember::implode($data);
return
[
'code'
=>
0
,
'msg'
=>
'预览成功'
,
'data'
=>
$data
];
}
else
{
return
[
'code'
=>
-
1
,
'msg'
=>
'规则不存在'
];
}
}
catch
(
\Exception
$e
)
{
return
[
'code'
=>
$e
->
getCode
(),
'msg'
=>
$e
->
getMessage
()];
}
return
[
'code'
=>
0
,
'msg'
=>
'导入失败'
];
}
/**
...
...
backend/views/coin-release-member/list.php
View file @
3098add5
backend/web/js/coin-release-member/list.js
View file @
3098add5
...
...
@@ -35,12 +35,53 @@ upload.render({
exts
:
'csv'
,
done
:
function
(
res
)
{
layer
.
closeAll
(
'loading'
);
layer
.
msg
(
res
.
msg
);
table
.
reload
(
'table1'
,
{
page
:
{
curr
:
1
console
.
log
(
res
);
var
data
=
res
.
data
;
var
tr_data
=
''
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
tr_data
+=
'<tr><td>'
+
data
[
i
][
1
]
+
'</td><td>'
+
data
[
i
][
2
]
+
'</td><td>'
+
data
[
i
][
3
]
+
'</td></tr>'
;
}
if
(
res
.
code
==
0
){
var
html
=
'<table class="layui-table">'
+
'<colgroup>
\
n'
+
'<col width="150">'
+
'<col width="150">'
+
'<col width="200">'
+
'</colgroup>'
+
'<thead>'
+
'<tr>'
+
'<th>手机号</th>'
+
'<th>币种</th>'
+
'<th>数量</th>'
+
'</tr>'
+
'</thead>'
+
'<tbody>'
+
tr_data
+
'</tbody>'
+
'</table>'
;
layer
.
open
({
title
:
'导入数据预览'
,
content
:
html
,
area
:
[
'1000px'
,
'800px'
],
scrollbar
:
true
,
btn
:
[
'确认导入'
,
'取消'
]
,
btn1
:
function
(
index
,
layero
){
//按钮【按钮一】的回调
}
,
btn2
:
function
(
index
,
layero
){
//按钮【按钮二】的回调
alert
(
1
);
//return false 开启该代码可禁止点击该按钮关闭
}
,
cancel
:
function
(){
}
});
}
else
{
layer
.
msg
(
res
.
msg
);
}
},
before
:
function
(
obj
)
{
//obj参数包含的信息,跟 choose回调完全一致,可参见上文。
layer
.
load
();
//上传loading
...
...
common/business/CoinBusiness.php
View file @
3098add5
...
...
@@ -202,10 +202,17 @@ class CoinBusiness
$row
[
'introduce'
]
=
''
;
}
$row
[
'price'
]
=
sprintf
(
"%s"
,
(
double
)
$row
[
'price'
]);
$coin
=
CoinFactory
::
createCoin
(
$row
[
'name'
],
$row
[
'id'
],
$row
[
'sid'
]);
$row
[
'quotation'
]
=
$coin
->
quotation
();
$row
[
'exchange_count'
]
=
$coin
->
exchange_count
();
$coin
->
__destruct
();
$quotation
=
ExchangeBusiness
::
getquatation
(
$row
[
'name'
]);
if
(
$quotation
){
$tikerdata
[
'price'
]
=
$quotation
[
'rmb'
];
$tikerdata
[
'dollar'
]
=
$quotation
[
'last'
];
}
else
{
$tikerdata
[
'price'
]
=
0
;
$tikerdata
[
'dollar'
]
=
0
;
}
$row
[
'quotation'
]
=
$tikerdata
;
$row
[
'quotation'
][
'publish_count'
]
=
$row
[
'publish_count'
];
$row
[
'quotation'
][
'circulate_count'
]
=
$row
[
'circulate_count'
];
}
return
$row
?
[
$row
]
:
[];
}
...
...
common/service/coin/CoinBTYService.php
View file @
3098add5
...
...
@@ -51,7 +51,7 @@ class CoinBTYService extends Coin implements CoinInterface
$key
=
$this
->
cache_key_prifx
.
$this
->
sid
.
'all'
;
$result
=
Yii
::
$app
->
cache
->
get
(
$key
);
if
(
$result
===
false
||
YII_ENV_DEV
)
{
$url
=
'http
://40.83.77.188
/api/data/Ticker?sort=cname'
;
$url
=
'http
s://zbapi.licai.cn
/api/data/Ticker?sort=cname'
;
$ch
=
new
Curl
();
$content
=
$ch
->
get
(
$url
,
false
);
if
(
is_array
(
$content
)
&&
isset
(
$content
[
'code'
])
&&
$content
[
'code'
]
==
200
)
{
...
...
common/service/coin/CoinService.php
View file @
3098add5
...
...
@@ -492,7 +492,7 @@ class CoinService extends Coin implements CoinInterface
* @param string $sid
* @return object|string
*/
public
function
quotation
()
/*
public function quotation()
{
//使用缓存
$key = [
...
...
@@ -538,5 +538,6 @@ class CoinService extends Coin implements CoinInterface
}
}
return $result;
}
}*/
}
\ No newline at end of file
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