【发布时间】:2017-06-25 20:24:06
【问题描述】:
脚本代码
class Deposit extends MY_Controller
{
public function coinPaymentCron()
{
$this->load->model('user_model','apimodel');
$apikeys = $this->apimodel->getApiKey();
foreach ($apikeys as $keysapi) {
# code...
$publickey = $keysapi->public_key;
$privatekey = $keysapi->private_key;
}
$cps = new CoinPaymentsAPI();
$cps->Setup($privatekey, $publickey);
$getTxIds = $this->apimodel->gettxids();
foreach ($getTxIds as $txid) {
# code...
$tx_id = $txid->txn_id;
echo $tx_id;
$txinfo = $cps->gettxinfo($tx_id);
if ($txinfo['error'] == 'ok') {
# code...
$statusText = $txinfo['result']['status_text'];
$amountReceived = $txinfo['result']['receivedf'];
$statusPayment = $txinfo['result']['status'];
$this->apimodel->updateStatus($tx_id, $statusText);
}
}
}
}
我用于运行 cron 作业的代码命令是
/usr/local/bin/php /home/name/public_html/index.php deposit coinPaymentCron
我也尝试了很多方法,比如使用 wget 和 curl,但不幸的是没有一个对我有用。 还使用 url 检查了脚本,脚本运行正常并更新数据库,但 cron 作业未运行。 其他一些 cron 作业正在使用此方法运行
/usr/local/bin/php /home/name/public_html/index.php
任何人都可以就这个问题提供帮助或让我知道我做错了什么吗?
【问题讨论】:
标签: codeigniter