master
ELF 4 years ago
parent 11caa30cfa
commit 6f2f588617

@ -94,7 +94,7 @@ class ConsoleController extends Think {
}
}
public function runTask($queue = 'common', $count = 1)
public function runTask($queue = 'common', $count = 10)
{
Printer::export($queue);
Printer::export($count);
@ -109,7 +109,7 @@ class ConsoleController extends Think {
public function addTask()
{
$id = M('market_shift', 'tab_')->add([
/* $id = M('market_shift', 'tab_')->add([
'from_id' => 1,
'to_id' => 2,
'split_time' => 0,
@ -117,8 +117,10 @@ class ConsoleController extends Think {
]);
$params = [
'market_shift_id' => $id
];
Task::add('market-shift', $params);
]; */
for ($i=0; $i<50; $i++) {
Task::add('test', ['value' => $i]);
}
}
public function initMarketAdmin()

@ -127,7 +127,10 @@ class FinancePromoteController extends AdminController
);
$promotes = [];
if (count($senddata) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', array_column($senddata, 'p_id')]])->select();
$promoteIds = array_column($senddata, 'p_id');
if ($promoteIds) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', $promoteIds]])->select();
}
}
$promotes = index_by_column('id', $promotes);
$adminUsernames = getAdminUsernameList(array_column($promotes, 'admin_id'));
@ -355,7 +358,10 @@ class FinancePromoteController extends AdminController
$promotes = [];
if (count($senddata) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', array_column($senddata, 'promote_id')]])->select();
$promoteIds = array_column($senddata, 'promote_id');
if (count($promoteIds)) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', $promoteIds]])->select();
}
}
$promotes = index_by_column('id', $promotes);
$adminUsernames = getAdminUsernameList(array_column($promotes, 'admin_id'));
@ -507,7 +513,10 @@ class FinancePromoteController extends AdminController
}
$promotes = [];
if (count($data) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', array_column($data, 'p_id')]])->select();
$promoteIds = array_column($data, 'p_id');
if (count($promoteIds) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account', 'admin_id'])->where(['id' => ['in', $promoteIds]])->select();
}
}
$promotes = index_by_column('id', $promotes);
$adminUsernames = getAdminUsernameList(array_column($promotes, 'admin_id'));

@ -9,10 +9,11 @@ class Task
{
public static $types = [
'market-shift' => '\Base\Task\MarketShiftTask',
'test' => '\Base\Task\TestTask',
];
public static $queues = [
'common' => [],
'common' => ['test'],
'market-shift' => ['market-shift']
];

@ -0,0 +1,17 @@
<?php
namespace Base\Task;
use Base\Service\MarketService;
/**
* 任务处理
* @author elf<360197197@qq.com>
*/
class TestTask extends BaseTask
{
public function run()
{
echo '测试' . $this->params['value'] . '执行成功';
echo PHP_EOL;
}
}
Loading…
Cancel
Save