daily_interest_by_id(); // 按日结息(按最后结息时间) $this->daily_interest_by_lasttime(); // 重启 K 线 WebSocket 服务 $this->restart_socket(); // 超级期货平仓处理 $this->close_out_processing_super_future(); // 同步 ETH/USDT 交易数据 $this->update_syncethusdt(); // 清理周期数据 $this->cleaning_cycle_data(); // 合约限仓处理 $this->contract_limit_position(); // 合约保仓处理 $this->contract_bc(); // 合约止盈止损 $this->contract_take_profit_and_stop_loss(); // 更新团队等级 $this->update_team_rank(); // 对冲盈亏计算 $this->hedging_profit_calculation(); // 同步火币价格 $this->sync_huobi_price(); // 自动取消 C2C 过期订单 $this->automatic_cancellation_of_C2C_expired_orders(); // 天使投资释放 $this->angel_investment_release(); // 同步 BTC/USDT 交易数据 $this->update_syncbtcusdt(); // 币种撮合交易 $this->currency_matching_transaction(); // 更新市场价格 $this->update_maket_price(); return 'success'; } /** * 按用户 ID 执行日结息 */ public function daily_interest_by_id() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(daily_interest_by_id)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/product/set_rixi_by_id" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 按最后结息时间执行日结息 */ public function daily_interest_by_lasttime() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(daily_interest_by_lasttime)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/product/set_rixi_by_lasttime" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 重启 K 线 WebSocket 服务(每 10 分钟执行一次) */ public function restart_socket() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(restart_socket)', 'type' => 'minute-n', 'where1' => '10', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => 'cd /www/wwwroot/jyshd php NewTradeKlines.php stop php NewTradeKlines.php start -d', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 超级期货平仓处理 */ public function close_out_processing_super_future() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(close_out_processing_super_future)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/task/pc_deal" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 同步 ETH/USDT 交易数据(火币) */ public function update_syncethusdt() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(update_syncethusdt)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/synccoin/syncethusdt" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 清理周期数据 */ public function cleaning_cycle_data() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(cleaning_cycle_data)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/del_hbsj', ]; $result = $btapi->addCrontab($params); return $result; } /** * 合约限仓处理 */ public function contract_limit_position() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(contract_limit_position)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/task/limit_comein" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 合约保仓处理 */ public function contract_bc() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(contract_bc)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/baocang', ]; $result = $btapi->addCrontab($params); return $result; } /** * 合约止盈止损 */ public function contract_take_profit_and_stop_loss() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(contract_take_profit_and_stop_loss)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/task/contract_deal" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 更新团队等级 */ public function update_team_rank() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(update_team_rank)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/level_update', ]; $result = $btapi->addCrontab($params); return $result; } /** * 对冲盈亏计算 */ public function hedging_profit_calculation() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(hedging_profit_calculation)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/zhiya_js', ]; $result = $btapi->addCrontab($params); return $result; } /** * 同步火币价格(核心采集任务) */ public function sync_huobi_price() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(sync_huobi_price)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/tasklh/update_coin" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 自动取消 C2C 过期订单 */ public function automatic_cancellation_of_C2C_expired_orders() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(automatic_cancellation_of_C2C_expired_orders)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/clear_order', ]; $result = $btapi->addCrontab($params); return $result; } /** * 天使投资释放 */ public function angel_investment_release() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(angel_investment_release)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toUrl', 'sBody' => '', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => $this->url . '/task/angel_sf', ]; $result = $btapi->addCrontab($params); return $result; } /** * 同步 BTC/USDT 交易数据(火币) */ public function update_syncbtcusdt() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(update_syncbtcusdt)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/synccoin/syncbtcusdt" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 币种撮合交易 */ public function currency_matching_transaction() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(currency_matching_transaction)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/task/coin_deal" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } /** * 更新市场价格(与 sync_huobi_price 相同,重复任务) */ public function update_maket_price() { $btapi = new Btapi(); $params = [ 'name' => $this->name . '(update_maket_price)', 'type' => 'minute-n', 'where1' => '1', 'hour' => '', 'minute' => '', 'week' => '', 'sType' => 'toShell', 'sBody' => '#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH for (( i = 0; i < 60; i=(i+1) )); do curl -sS --connect-timeout 10 -m 60 "' . $this->url . '/tasklh/update_coin" echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep 1 done exit 0', 'sName' => '', 'backupTo' => 'localhost', 'save' => '', 'urladdress' => '', ]; $result = $btapi->addCrontab($params); return $result; } }