4 changed files with 63 additions and 34 deletions
@ -0,0 +1,34 @@ |
|||||
|
<?php |
||||
|
|
||||
|
declare(strict_types=1); |
||||
|
|
||||
|
namespace app\command; |
||||
|
|
||||
|
use app\admin\service\setting\IPOService; |
||||
|
use think\console\Command; |
||||
|
use think\console\Input; |
||||
|
use think\console\Output; |
||||
|
|
||||
|
class SignStockCommand extends Command |
||||
|
{ |
||||
|
protected function configure() |
||||
|
{ |
||||
|
// 指令配置 |
||||
|
$this->setName('sign:stock') |
||||
|
->setDescription('the sign stock command'); |
||||
|
} |
||||
|
/** |
||||
|
* Execute the console command. |
||||
|
* |
||||
|
* @param Input $input |
||||
|
* @param Output $output |
||||
|
* @return void |
||||
|
*/ |
||||
|
protected function execute(Input $input, Output $output) |
||||
|
{ |
||||
|
$market_list = [3, 4, 5, 6, 7, 9, 12, 14, 15, 16, 17, 18]; |
||||
|
foreach ($market_list as $market_type) { |
||||
|
(new IPOService())->signStockIPO($market_type); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
# 处理股票IPO中签 |
||||
|
*/10 * * * * cd /www/bourse_p2 && /usr/bin/php think sign:stock >> /www/bourse_p2/runtime/log/cron.log 2>&1 |
||||
|
|
||||
|
# 记录api 日志 |
||||
|
*/1 * * * * cd /www/bourse_p2 && /usr/bin/php think api_log >> /www/bourse_p2/runtime/log/api.log 2>&1 |
Loading…
Reference in new issue