wugg 5 months ago
parent
commit
a243a61e85
2 changed files with 5 additions and 5 deletions
  1. 2 2
      app/admin/command/CheckInvoice.php
  2. 3 3
      app/admin/command/CheckTicket.php

+ 2 - 2
app/admin/command/CheckInvoice.php

@@ -27,7 +27,7 @@ class CheckInvoice extends Command
     protected function execute(Input $input, Output $output)
     {
         $this->datetime = date("Y-m-d");
-        if(Cache::get('checkInvoiceP')==1)return;
+        if(Cache::get('checkInvoiceP')==1  && date('H')>=12)return;
         $list = $this->getInvoice();
         $invoice =Config::get('invoiceType');
         $this->InvoiceNum = $invoice['KingInvoice'];
@@ -71,7 +71,7 @@ class CheckInvoice extends Command
         $this->output->writeln('[' . date(DATE_W3C) . ']' . json_encode($result,JSON_UNESCAPED_UNICODE));
        Db::startTrans();
         try{
-            if(isset($result['code']) && $result['code']=='0000' and count($result['data'])>0){
+            if(isset($result['code']) && $result['code']=='0000' && isset($result['data']) && count($result['data'])>0){
                 if($result['data']['cyjg']=='0001'){
                     $data= $result['data'];
                      $this->changeFiled($data,$invoice);

+ 3 - 3
app/admin/command/CheckTicket.php

@@ -26,7 +26,7 @@ class CheckTicket extends Command
     protected function execute(Input $input, Output $output)
     {
         $this->dateTime = date("Y-m-d H:i:s");
-        if(Cache::get('checkTicketP')==1)return;
+        if(Cache::get('checkTicketP')==1 && date("H")>=12)return;
         $this->output=$output;
         $ticket = $this->getTicket();
         while ($ticket->valid()) {
@@ -41,7 +41,7 @@ class CheckTicket extends Command
      //   $output->writeln('checkticket');
     }
     protected function getTicket(){
-        $ticket = InvoiceTicket::where([["is_del","=",0],["type","=",0],["status","=",0],['updatetime','<',date('Y-m-d H:i:s')]])
+        $ticket = InvoiceTicket::where([["is_del","=",0],["type","=",0],["status","=",0],['open_date','<',date("Y-m-d 00:00:00")],['updatetime','<',date('Y-m-d H:i:s')]])
         ->field("id,invNo,type,inv_type,inv_code,inv_number,inv_total,inv_subtotal,open_date,check_code")
         ->cursor();
         foreach ($ticket as $key => $value) {
@@ -72,7 +72,7 @@ class CheckTicket extends Command
         $this->output->writeln('[' . date(DATE_W3C) . ']' . json_encode($result,JSON_UNESCAPED_UNICODE));
         Db::startTrans();
         try{
-            if(isset($result['code']) && $result['code']=='0000' and count($result['data'])>0){
+            if(isset($result['code']) && $result['code']=='0000' && isset($result['data']) && count($result['data'])>0){
             if($result['data']['cyjg']=='0001'){
                 $data= $result['data'];
                 $this->changeFiled($data,$info);