Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stock_new
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
stock_new
Commits
3314982f
Commit
3314982f
authored
Jun 19, 2024
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善实时获取股票信息
parent
51342211
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
application/function.php
application/function.php
+8
-1
application/market/home/Index.php
application/market/home/Index.php
+1
-1
application/market/home/Trade.php
application/market/home/Trade.php
+1
-1
application/market/model/Trust.php
application/market/model/Trust.php
+2
-2
No files found.
application/function.php
View file @
3314982f
...
...
@@ -242,10 +242,17 @@ if (!function_exists('getEndDay')) {
}
if
(
!
function_exists
(
'z_market'
))
{
function
z_market
(
$code
)
function
z_market
(
$code
,
$market
=
"HK"
)
{
$res
=
\think\Db
::
name
(
'admin_config'
)
->
where
(
array
(
'name'
=>
'market_data_in'
))
->
value
(
'value'
);
//判断股票前缀
if
(
toMarket
(
$code
)){
$market
=
toMarket
(
$code
);
};
$code
=
strtolower
(
$market
)
.
$code
;
//判断股票是否
switch
(
$res
)
{
case
1
:
$res
=
qq_market
(
$code
);
...
...
application/market/home/Index.php
View file @
3314982f
...
...
@@ -87,7 +87,7 @@ class Index extends Common
if
(
$code
===
null
)
{
return
json
([
'data'
=>
null
,
'status'
=>
0
,
'message'
=>
'缺少参数code,操作失败'
]);
}
$data
=
z_market
(
strtolower
(
$market
)
.
$code
);
$data
=
z_market
(
$code
,
$market
);
if
(
!
$data
)
{
return
json
([
'data'
=>
$data
,
'status'
=>
0
,
'message'
=>
'操作失败'
]);
}
...
...
application/market/home/Trade.php
View file @
3314982f
This diff is collapsed.
Click to expand it.
application/market/model/Trust.php
View file @
3314982f
...
...
@@ -320,7 +320,7 @@ class Trust extends Model{
public
function
trustBuy
(
$data
,
$bs_res
)
{
//查询股票最新行情
$Qdata
=
z_market
(
$data
[
'code'
]);
$Qdata
=
z_market
(
$data
[
'code'
]
,
$data
[
'market'
]
);
$price
=
$data
[
'price'
]
<=
0
?
$Qdata
[
'Price'
]
:
$data
[
'price'
];
//判断股票价格是否符号购买条件
if
(
config
(
'stock_buy_price'
)
>
0
)
{
...
...
@@ -373,7 +373,7 @@ class Trust extends Model{
public
function
trustSell
(
$data
)
{
//查询股票最新行情
$Qdata
=
z_market
(
$data
[
'code'
]);
$Qdata
=
z_market
(
$data
[
'code'
]
,
$data
[
'market'
]
);
$price
=
$data
[
'price'
]
<=
0
?
$Qdata
[
'Price'
]
:
$data
[
'price'
];
if
(
config
(
'site_trade_sell'
)
==
0
)
{
...
...
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