浏览代码

创建生成队列

程旭源 4 年之前
父节点
当前提交
a5f174c162
共有 3 个文件被更改,包括 20 次插入0 次删除
  1. 1 0
      application/command.php
  2. 18 0
      application/common/command/SettlementTraffic.php
  3. 1 0
      application/job/FlowLog.php

+ 1 - 0
application/command.php

@@ -17,4 +17,5 @@ return [
     'app\admin\command\Min',
     'app\admin\command\Addon',
     'app\admin\command\Api',
+    'app\'
 ];

+ 18 - 0
application/common/command/SettlementTraffic.php

@@ -0,0 +1,18 @@
+<?php
+
+
+namespace app\common\command;
+
+
+use think\console\Command;
+use think\console\Input;
+use think\console\Output;
+
+class SettlementTraffic extends Command
+{
+    protected function configure()
+    {
+//        parent::configure(); // TODO: Change the autogenerated stub
+        $this->setName('SettlementTraffic')->setDescription('后台统计用户流量使用, 并扣除相关流量')
+    }
+}

+ 1 - 0
application/job/FlowLog.php

@@ -18,5 +18,6 @@ class FlowLog
             'bytes'     =>  $data['bytes'],
             'created_at'    => $data['time']
         ]);
+        $job->delete();
     }
 }