wugg 6 months ago
parent
commit
6449739af4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/admin/command/CheckInvoice.php

+ 4 - 1
app/admin/command/CheckInvoice.php

@@ -7,7 +7,7 @@ use app\admin\model\CompanyInfo;use app\admin\model\InvoiceInfo;use app\admin\mo
 use think\console\Input;
 use think\console\input\Argument;
 use think\console\input\Option;
-use think\console\Output;use think\facade\Config;use think\facade\Db;
+use think\console\Output;use think\facade\Cache;use think\facade\Config;use think\facade\Db;
 
 class CheckInvoice extends Command
 {
@@ -30,11 +30,14 @@ class CheckInvoice extends Command
         $list = $this->getInvoice();
         $invoice =Config::get('invoiceType');
         $this->InvoiceNum = $invoice['KingInvoice'];
+        if(Cache::get('checkInvoiceP')==1)return;
         while ($list->valid()){
+            Cache::set('checkInvoiceP',1,1800);
              $invoice = $list->current();
             $this->checkTicket($invoice);
             $list->next();
         }
+        Cache::set('checkInvoiceP',0);
 
     }