wugg 2 éve
szülő
commit
e18d6a2474

+ 1 - 1
app/admin/controller/Base.php

@@ -95,7 +95,7 @@ class Base extends \app\BaseController
         $resgin= Db::name("resign_info")->where([["hand_uid","=",$this->uid],["is_del","=",0],['status',"=",4]])
             ->column(['resign_uid']);
         if(!empty($resgin)){
-            $resgin['write']= array_unique(array_merge($resgin['write'],$resgin));
+            $action['write']= array_unique(array_merge($action['write'],$resgin));
         }
 
         /**

+ 10 - 0
app/admin/middleware.php

@@ -0,0 +1,10 @@
+<?php
+// 全局中间件定义文件
+return [
+    // 全局请求缓存
+    app\admin\middleware\PostLog::class
+    // 多语言加载
+    // \think\middleware\LoadLangPack::class,
+    // Session初始化
+    // \think\middleware\SessionInit::class
+];

+ 47 - 0
app/admin/middleware/PostLog.php

@@ -0,0 +1,47 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\middleware;
+use think\facade\Db;
+class PostLog
+{
+    /**
+     * 处理请求
+     *
+     * @param \think\Request $request
+     * @param \Closure       $next
+     * @return Response
+     */
+    public function handle($request, \Closure $next)
+    {
+    $param = $request->post();
+     $rid=  "";$rname=  "";
+    if(isset($param['token']) && $param['token']!=''){
+        $apply_id = GetUserInfo($param['token']);
+         if(empty($apply_id)||$apply_id['code']!=0){
+             $rid=  "";
+             $rname=  "";
+        }else{
+             $rid= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+             $rname= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+        }
+    }
+    $server = $request->server();
+    $data=[
+        "uri_name"=>$server['REQUEST_URI'],
+        "param"=>json_encode($param,JSON_UNESCAPED_UNICODE),
+        "response"=>'',
+        "action_id"=>$rid,
+        "action_name"=>$rname,
+        "addtime"=>date("Y-m-d H:i:s")
+    ] ;
+    Db::name("data_log")->insert($data);
+    $response = $next($request);
+    return $response;
+
+    }
+
+    public function end($response){
+
+    }
+}

+ 2 - 2
app/command/NowReportHandle.php

@@ -176,8 +176,8 @@ class NowReportHandle extends Command
             ->leftJoin('supplier ws', 'wwi.supplierNo = ws.`code`')
             ->where('wgs.is_del', 0)
             ->where('wgb.is_stock', 1)
-            ->whereBetween('wgs.addtime', [$start_date, $end_date])
-            ->order('wgs.addtime', 'desc')
+            ->whereBetween('wgs.updatetime', [$start_date, $end_date])
+            ->order('wgs.updatetime', 'desc')
             ->cursor();
 
         $list = [];