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
ce7b5a94
Commit
ce7b5a94
authored
Jun 20, 2024
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
执行command
parent
1bd57b13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
application/command.php
application/command.php
+4
-3
application/market/command/TrustCommand.php
application/market/command/TrustCommand.php
+3
-2
No files found.
application/command.php
View file @
ce7b5a94
...
...
@@ -9,6 +9,7 @@
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
return
[
'app\stock\command\Crontab'
,
'app\stock\command\Trust'
,
];
\ No newline at end of file
return
[
'Crontab'
=>
'app\stock\command\Crontab'
,
'Trust'
=>
'app\market\command\TrustCommand'
,
];
application/market/command/Trust.php
→
application/market/command/Trust
Command
.php
View file @
ce7b5a94
...
...
@@ -14,7 +14,7 @@ use think\console\Output;
use
think\Db
;
class
Trust
extends
Command
class
Trust
Command
extends
Command
{
protected
function
configure
()
...
...
@@ -38,6 +38,7 @@ class Trust extends Command
if
(
!
empty
(
$res_t
))
$this
->
goturnTrusts
(
$res_t
);
}
/* 将最新委托转成不可撤销状态,等待交易 */
protected
function
goturnTrusts
(
$res
){
$this
->
output
->
writeln
(
date
(
'Y-m-d H:i:s'
)
.
' 交易委托: '
.
count
(
$res
)
.
" 个"
);
...
...
@@ -169,7 +170,7 @@ class Trust extends Command
$sm_res
=
$subaccount
->
up_moneylog
(
$trust
[
'sub_id'
],
$affect
,
$trustModel
,
$return_money
=
0
,
$Balance
);
//写入成交表
$deal_stock
=
new
Deal_stock
();
$deal_res
=
$deal_stock
->
add_m_deal_stock
(
$Qdata
,
$trust
[
'trust_count'
],
$trust
[
'trust_price'
],
$trust
[
'sub_id'
],
$trust
[
'lid'
],
$trust
[
'login_name'
],
$trust
[
'soruce'
],
$trust
[
'trust_no'
]);
$deal_res
=
$deal_stock
->
add_m_deal_stock
(
$Qdata
,
$trust
[
'trust_count'
],
$trust
[
'trust_price'
],
$trust
[
'sub_id'
],
$trust
[
'lid'
],
$trust
[
'login_name'
],
$trust
[
'soruce'
],
$trust
[
'trust_no'
]
,
1
);
//查询持仓表
$postmd
=
Db
::
name
(
'stock_position'
)
->
where
([
'sub_id'
=>
$trust
[
'sub_id'
],
'gupiao_code'
=>
$trust
[
'gupiao_code'
]])
->
find
();
$canbuy
=
!
empty
(
$postmd
)
?
$postmd
[
'stock_count'
]
:
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