mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
修改任务
This commit is contained in:
parent
19eadbcbad
commit
1eaff7a50b
@ -41,9 +41,7 @@ class OrderClean extends Command
|
|||||||
private function _autoCancelOrder()
|
private function _autoCancelOrder()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$map = [];
|
$map = [['status', '<', 3], ['payment_status', '=', 0]];
|
||||||
$map[] = ['status', '<', 3];
|
|
||||||
$map[] = ['payment_status', '=', 0];
|
|
||||||
$map[] = ['create_at', '<', date('Y-m-d H:i:s', strtotime('-30 minutes'))];
|
$map[] = ['create_at', '<', date('Y-m-d H:i:s', strtotime('-30 minutes'))];
|
||||||
[$total, $count] = [$this->app->db->name('ShopOrder')->where($map)->count(), 0];
|
[$total, $count] = [$this->app->db->name('ShopOrder')->where($map)->count(), 0];
|
||||||
$this->app->db->name('ShopOrder')->where($map)->select()->map(function ($item) use ($total, &$count) {
|
$this->app->db->name('ShopOrder')->where($map)->select()->map(function ($item) use ($total, &$count) {
|
||||||
@ -69,9 +67,7 @@ class OrderClean extends Command
|
|||||||
private function _autoRemoveOrder()
|
private function _autoRemoveOrder()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$map = [];
|
$map = [['status', '=', 0], ['payment_status', '=', 0]];
|
||||||
$map[] = ['status', '=', 0];
|
|
||||||
$map[] = ['payment_status', '=', 0];
|
|
||||||
$map[] = ['create_at', '<', date('Y-m-d H:i:s', strtotime('-3 days'))];
|
$map[] = ['create_at', '<', date('Y-m-d H:i:s', strtotime('-3 days'))];
|
||||||
[$total, $count] = [$this->app->db->name('ShopOrder')->where($map)->count(), 0];
|
[$total, $count] = [$this->app->db->name('ShopOrder')->where($map)->count(), 0];
|
||||||
foreach ($this->app->db->name('ShopOrder')->where($map)->cursor() as $item) {
|
foreach ($this->app->db->name('ShopOrder')->where($map)->cursor() as $item) {
|
||||||
|
@ -20,7 +20,7 @@ class UserAgent extends Command
|
|||||||
$this->setName('xdata:UserAgent');
|
$this->setName('xdata:UserAgent');
|
||||||
$this->addArgument('uuid', Argument::OPTIONAL, '目标用户', '');
|
$this->addArgument('uuid', Argument::OPTIONAL, '目标用户', '');
|
||||||
$this->addArgument('puid', Argument::OPTIONAL, '上级代理', '');
|
$this->addArgument('puid', Argument::OPTIONAL, '上级代理', '');
|
||||||
$this->setDescription('重新设置用户上级代理, 参数:uuid puid');
|
$this->setDescription('重新设置用户上级代理, 参数:UUID PUID');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,16 +34,16 @@ class UserAgent extends Command
|
|||||||
*/
|
*/
|
||||||
protected function execute(Input $input, Output $output)
|
protected function execute(Input $input, Output $output)
|
||||||
{
|
{
|
||||||
[$uuid, $pid] = [$input->getArgument('uuid'), $input->getArgument('pid')];
|
[$uuid, $puid] = [$input->getArgument('uuid'), $input->getArgument('puid')];
|
||||||
if (empty($uuid)) $this->setQueueError("参数UID无效,请传入正确的参数!");
|
if (empty($uuid)) $this->setQueueError("参数UID无效,请传入正确的参数!");
|
||||||
if (empty($pid)) $this->setQueueError("参数PID无效,请传入正确的参数!");
|
if (empty($puid)) $this->setQueueError("参数PID无效,请传入正确的参数!");
|
||||||
|
|
||||||
// 检查当前用户资料
|
// 检查当前用户资料
|
||||||
$user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
|
$user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
|
||||||
if (empty($user)) $this->setQueueError("读取用户数据失败!");
|
if (empty($user)) $this->setQueueError("读取用户数据失败!");
|
||||||
|
|
||||||
// 检查上级代理用户
|
// 检查上级代理用户
|
||||||
$parant = $this->app->db->name('DataUser')->where(['id' => $pid])->find();
|
$parant = $this->app->db->name('DataUser')->where(['id' => $puid])->find();
|
||||||
if (empty($parant)) $this->setQueueError('读取代理数据失败!');
|
if (empty($parant)) $this->setQueueError('读取代理数据失败!');
|
||||||
|
|
||||||
// 检查异常关系处理
|
// 检查异常关系处理
|
||||||
|
Loading…
x
Reference in New Issue
Block a user