|
@@ -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);
|