Commit ce7b5a94 authored by wuxiaoli's avatar wuxiaoli

执行command

parent 1bd57b13
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
// | Author: yunwuxin <448901948@qq.com> // | Author: yunwuxin <448901948@qq.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
return ['app\stock\command\Crontab', return [
'app\stock\command\Trust', 'Crontab'=>'app\stock\command\Crontab',
]; 'Trust' => 'app\market\command\TrustCommand',
\ No newline at end of file ];
...@@ -14,7 +14,7 @@ use think\console\Output; ...@@ -14,7 +14,7 @@ use think\console\Output;
use think\Db; use think\Db;
class Trust extends Command class TrustCommand extends Command
{ {
protected function configure() protected function configure()
...@@ -38,6 +38,7 @@ class Trust extends Command ...@@ -38,6 +38,7 @@ class Trust extends Command
if (!empty($res_t)) $this->goturnTrusts($res_t); if (!empty($res_t)) $this->goturnTrusts($res_t);
} }
/* 将最新委托转成不可撤销状态,等待交易 */ /* 将最新委托转成不可撤销状态,等待交易 */
protected function goturnTrusts($res){ protected function goturnTrusts($res){
$this->output->writeln(date('Y-m-d H:i:s').' 交易委托: '.count($res)." 个"); $this->output->writeln(date('Y-m-d H:i:s').' 交易委托: '.count($res)." 个");
...@@ -169,7 +170,7 @@ class Trust extends Command ...@@ -169,7 +170,7 @@ class Trust extends Command
$sm_res = $subaccount->up_moneylog($trust['sub_id'], $affect, $trustModel , $return_money = 0, $Balance); $sm_res = $subaccount->up_moneylog($trust['sub_id'], $affect, $trustModel , $return_money = 0, $Balance);
//写入成交表 //写入成交表
$deal_stock = new Deal_stock(); $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(); $postmd = Db::name('stock_position')->where(['sub_id'=>$trust['sub_id'],'gupiao_code'=>$trust['gupiao_code']])->find();
$canbuy = !empty($postmd) ? $postmd['stock_count'] : 0; $canbuy = !empty($postmd) ? $postmd['stock_count'] : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment