28 行
610 B
PHP
28 行
610 B
PHP
<?php
|
|
|
|
namespace addons\shopro\library\split;
|
|
|
|
use addons\shopro\model\split\SplitOrder;
|
|
|
|
class SplitRetryJob
|
|
{
|
|
public static function run()
|
|
{
|
|
$config = new Config();
|
|
if (!$config->isEnable()) {
|
|
return;
|
|
}
|
|
|
|
$list = SplitOrder::where('status', 4)
|
|
->where('retry_count', '<', $config->getRetryMax())
|
|
->where('next_retry_time', '<=', time())
|
|
->limit(20)
|
|
->select();
|
|
|
|
$executor = new SplitExecutor();
|
|
foreach ($list as $splitOrder) {
|
|
$executor->retry($splitOrder->id);
|
|
}
|
|
}
|
|
}
|