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
34ed11aa
Commit
34ed11aa
authored
Jun 19, 2024
by
twj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/stock_new
into dev
parents
f4afec72
a732594e
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
286 deletions
+14
-286
application/function.php
application/function.php
+2
-2
application/market/home/Index.php
application/market/home/Index.php
+2
-1
application/market/home/Trade.php
application/market/home/Trade.php
+1
-1
application/market/model/Deal_stock.php
application/market/model/Deal_stock.php
+2
-1
application/market/model/Delivery.php
application/market/model/Delivery.php
+2
-1
application/market/model/StockPosition.php
application/market/model/StockPosition.php
+0
-277
application/market/model/Trust.php
application/market/model/Trust.php
+4
-2
application/market/validate/Trade.php
application/market/validate/Trade.php
+1
-1
No files found.
application/function.php
View file @
34ed11aa
...
@@ -247,9 +247,9 @@ if (!function_exists('getEndDay')) {
...
@@ -247,9 +247,9 @@ if (!function_exists('getEndDay')) {
$res
=
\think\Db
::
name
(
'admin_config'
)
->
where
(
array
(
'name'
=>
'market_data_in'
))
->
value
(
'value'
);
$res
=
\think\Db
::
name
(
'admin_config'
)
->
where
(
array
(
'name'
=>
'market_data_in'
))
->
value
(
'value'
);
//判断股票前缀
//判断股票前缀
if
(
toMarket
(
$code
)){
/*
if(toMarket($code)){
$market = toMarket($code);
$market = toMarket($code);
};
};
*/
$code
=
strtolower
(
$market
)
.
$code
;
$code
=
strtolower
(
$market
)
.
$code
;
//判断股票是否
//判断股票是否
...
...
application/market/home/Index.php
View file @
34ed11aa
...
@@ -58,7 +58,7 @@ class Index extends Common
...
@@ -58,7 +58,7 @@ class Index extends Common
$map
[
'title'
]
=
[
'like'
,
"%
$key
%"
];
$map
[
'title'
]
=
[
'like'
,
"%
$key
%"
];
}
}
$map
[
'status'
]
=
1
;
$map
[
'status'
]
=
1
;
$data
=
Db
::
name
(
'stock_list'
)
->
field
(
'code,title,pinyin'
)
->
where
(
$map
)
->
limit
(
10
)
->
select
();
$data
=
Db
::
name
(
'stock_list'
)
->
field
(
'code,title,pinyin
,market
'
)
->
where
(
$map
)
->
limit
(
10
)
->
select
();
if
(
!
$data
)
{
if
(
!
$data
)
{
return
json
([
'data'
=>
$data
,
'status'
=>
0
,
'message'
=>
'操作失败'
]);
return
json
([
'data'
=>
$data
,
'status'
=>
0
,
'message'
=>
'操作失败'
]);
...
@@ -69,6 +69,7 @@ class Index extends Common
...
@@ -69,6 +69,7 @@ class Index extends Common
$res
[
$k
][
'code'
]
=
$v
[
'code'
];
$res
[
$k
][
'code'
]
=
$v
[
'code'
];
$res
[
$k
][
'name'
]
=
$v
[
'title'
];
$res
[
$k
][
'name'
]
=
$v
[
'title'
];
$res
[
$k
][
'pin'
]
=
$v
[
'pinyin'
];
$res
[
$k
][
'pin'
]
=
$v
[
'pinyin'
];
$res
[
$k
][
'market'
]
=
$v
[
'market'
];
}
}
}
}
return
json
([
'data'
=>
$res
,
'status'
=>
1
,
'message'
=>
'操作成功'
]);
return
json
([
'data'
=>
$res
,
'status'
=>
1
,
'message'
=>
'操作成功'
]);
...
...
application/market/home/Trade.php
View file @
34ed11aa
This diff is collapsed.
Click to expand it.
application/market/model/Deal_stock.php
View file @
34ed11aa
...
@@ -69,7 +69,7 @@ class Deal_stock extends Model{
...
@@ -69,7 +69,7 @@ class Deal_stock extends Model{
* 返回子账号成交
* 返回子账号成交
* $sub_id 子账号
* $sub_id 子账号
*/
*/
public
function
get_deal_stock
(
$sub_id
,
$beginday
,
$endday
){
public
function
get_deal_stock
(
$sub_id
,
$beginday
,
$endday
,
$offset
=
15
){
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
);}
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
);}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
...
@@ -80,6 +80,7 @@ class Deal_stock extends Model{
...
@@ -80,6 +80,7 @@ class Deal_stock extends Model{
->
where
(
'deal_date'
,
'>='
,
$beginday
)
->
where
(
'deal_date'
,
'>='
,
$beginday
)
->
where
(
'deal_date'
,
'<='
,
$endday
)
->
where
(
'deal_date'
,
'<='
,
$endday
)
->
order
(
'id desc'
)
->
order
(
'id desc'
)
->
paginate
(
$offset
,
false
,
[
'query'
=>
request
()
->
param
()])
->
select
();
->
select
();
if
(
!
$res
||
count
(
$res
)
===
0
){
if
(
!
$res
||
count
(
$res
)
===
0
){
...
...
application/market/model/Delivery.php
View file @
34ed11aa
...
@@ -57,7 +57,7 @@ class Delivery extends Model{
...
@@ -57,7 +57,7 @@ class Delivery extends Model{
* 返回对应交割单
* 返回对应交割单
* $sub_id 子账号
* $sub_id 子账号
*/
*/
public
function
get_delivery_order
(
$sub_id
,
$beginday
=
""
,
$endday
=
""
){
public
function
get_delivery_order
(
$sub_id
,
$beginday
=
""
,
$endday
=
""
,
$offset
=
15
){
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
)
+
86400
;}
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
)
+
86400
;}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
$res
=
Db
::
name
(
'stock_delivery_order'
)
$res
=
Db
::
name
(
'stock_delivery_order'
)
...
@@ -66,6 +66,7 @@ class Delivery extends Model{
...
@@ -66,6 +66,7 @@ class Delivery extends Model{
->
where
(
'deal_date'
,
'>='
,
$beginday
)
->
where
(
'deal_date'
,
'>='
,
$beginday
)
->
where
(
'deal_date'
,
'<='
,
$endday
)
->
where
(
'deal_date'
,
'<='
,
$endday
)
->
order
(
'id desc'
)
->
order
(
'id desc'
)
->
paginate
(
$offset
,
false
,
[
'query'
=>
request
()
->
param
()])
->
select
();
->
select
();
return
$res
;
return
$res
;
}
}
...
...
application/market/model/StockPosition.php
deleted
100644 → 0
View file @
f4afec72
This diff is collapsed.
Click to expand it.
application/market/model/Trust.php
View file @
34ed11aa
...
@@ -234,13 +234,15 @@ class Trust extends Model{
...
@@ -234,13 +234,15 @@ class Trust extends Model{
* 返回子账号委托
* 返回子账号委托
* $sub_id 子账号
* $sub_id 子账号
*/
*/
public
function
get_trust
(
$sub_id
,
$beginday
,
$endday
){
public
function
get_trust
(
$sub_id
,
$beginday
,
$endday
,
$offset
=
15
){
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
);}
if
(
empty
(
$endday
)){
$endday
=
time
();}
else
{
$endday
=
strtotime
(
$endday
);}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
if
(
empty
(
$beginday
)){
$beginday
=
strtotime
(
date
(
"Y-m-d"
,
time
()));}
else
{
$beginday
=
strtotime
(
$beginday
);}
$res
=
Db
::
name
(
'stock_trust'
)
$res
=
Db
::
name
(
'stock_trust'
)
->
where
([
'sub_id'
=>
$sub_id
])
->
where
([
'sub_id'
=>
$sub_id
])
->
where
(
'trust_date'
,
'>='
,
$beginday
)
->
where
(
'trust_date'
,
'>='
,
$beginday
)
->
where
(
'trust_date'
,
'<='
,
$endday
)
->
where
(
'trust_date'
,
'<='
,
$endday
)
->
order
(
'id desc'
)
->
paginate
(
$offset
,
false
,
[
'query'
=>
request
()
->
param
()])
->
select
();
->
select
();
return
$res
;
return
$res
;
}
}
...
@@ -300,7 +302,7 @@ class Trust extends Model{
...
@@ -300,7 +302,7 @@ class Trust extends Model{
if
(
$res
)
return
[
'status'
=>
0
,
'message'
=>
'该股票禁止交易'
];
if
(
$res
)
return
[
'status'
=>
0
,
'message'
=>
'该股票禁止交易'
];
//判断购买数量书否正确
//判断购买数量书否正确
if
((
$data
[
'count'
]
%
100
)
!=
0
)
return
[
'status'
=>
0
,
'message'
=>
'交易数量必须是100的整数倍'
];
if
((
$data
[
'count'
]
%
100
)
!=
0
)
return
[
'status'
=>
0
,
'message'
=>
'交易数量必须是100的整数倍'
];
$bs_res
=
Db
::
name
(
'stock_borrow'
)
->
where
(
array
(
'stock_subaccount_id'
=>
$data
[
'subid'
]))
->
find
();
$bs_res
=
Db
::
name
(
'stock_borrow'
)
->
where
(
array
(
'stock_subaccount_id'
=>
$data
[
'sub
_
id'
]))
->
find
();
if
(
empty
(
$bs_res
))
{
if
(
empty
(
$bs_res
))
{
return
[
'status'
=>
0
,
'message'
=>
'没有对应的配资'
];
return
[
'status'
=>
0
,
'message'
=>
'没有对应的配资'
];
}
}
...
...
application/market/validate/Trade.php
View file @
34ed11aa
<?php
<?php
namespace
app\
apicom
\validate
;
namespace
app\
market
\validate
;
use
think\Validate
;
use
think\Validate
;
...
...
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