wuggemail@foxmail.com 2 weeks ago
parent
commit
33f7cf64dc
2 changed files with 20 additions and 11 deletions
  1. 15 10
      app/admin/listener/ComonQrd.php
  2. 5 1
      app/admin/middleware/checkToken.php

+ 15 - 10
app/admin/listener/ComonQrd.php

@@ -53,18 +53,23 @@ class ComonQrd
             	$payArr=array_column($assoc->toArray(),"cancel_fee","orderCode");
             	$tag=[];
     	        $qrdSave=[];
+                IF($bool==false){
+                    $tagLog=TagLog::where(["code"=>$data['invNo'],"tag_id"=>107])->column("id","code");
+                }
             	foreach ($orderArr as $item){
             		if(!isset($payArr[$item->sequenceNo]))continue;
-		           $tag_temp=[
-		                'code'=>$item->sequenceNo,
-		                'tag_id'=>107,//开票申请同步QR
-		                'creater'=>'system',
-		                'createrid'=>0,
-		                'tag_fee'=>0,
-		                'tag_img'=>'',
-		                "tag_code"=>$data['invNo'],
-		                'status'=>$bool?1:0
-		                ];
+                    if($bool==false &&!isset($tagLog[$data['invNo']])) continue;
+                    $tag_temp=[
+                        "id"=>$bool?null:$tagLog[$data['invNo']],
+                        'code'=>$item->sequenceNo,
+                        'tag_id'=>107,//开票申请同步QR
+                        'creater'=>'system',
+                        'createrid'=>0,
+                        'tag_fee'=>0,
+                        'tag_img'=>'',
+                        "tag_code"=>$data['invNo'],
+                        'status'=>$bool?1:0
+                    ];
 		            $qrd=[
 		                'id'=>$item->id,
 		                'apay_fee'=>$item->apay_fee,

+ 5 - 1
app/admin/middleware/checkToken.php

@@ -3,6 +3,8 @@ declare (strict_types = 1);
 
 namespace app\admin\middleware;
 use app\admin\model\SystemLog;
+use think\facade\Cache;
+
 class checkToken
 {
     /**
@@ -17,12 +19,14 @@ class checkToken
         if ($request->isOptions()) {
             return json();
         }
+        $token=$request->param('token');
+        $userinfo = Cache::get('user:info:'.$token);
         $data=[
         	"info"=>"",
         	"action"=>"",
         	"url"=>$request->server()['REQUEST_URI'],
         	"param"=>json_encode($request->param(),JSON_UNESCAPED_UNICODE),
-        	"name"=>'',
+        	"name"=>$userinfo['nickname']??'system',
         	"addtime"=>date("Y-m-d H:i:s")
         ];
         SystemLog::create($data);