Commit ce7b5a94 authored by wuxiaoli's avatar wuxiaoli

执行command

parent 1bd57b13
......@@ -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',
];
......@@ -14,7 +14,7 @@ use think\console\Output;
use think\Db;
class Trust extends Command
class TrustCommand 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;
......
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