Browse Source

非法字符BUG
数据错误修复
回滚错误修复

Zhouzhendong 4 years ago
parent
commit
540007dedc

+ 1 - 1
app/Exceptions/Handler.php

@@ -35,7 +35,7 @@ class Handler extends ExceptionHandler
      *
      * @param Throwable $exception
      * @return void
-     * @throws Exception
+     * @throws Exception|Throwable
      */
     public function report(Throwable $exception)
     {

+ 0 - 1
app/Http/Controllers/OrderController.php

@@ -20,7 +20,6 @@ use Oursdreams\Export\Export;
 class OrderController extends Controller
 {
     public function delivering(OrderDelivering $request){
-        //if(!Gate::allows('订单管理-查询')){ return view('order/index');  }
         /** @var OrderService $orderService */
         $orderService = app('OrderService');
         $request = $request->input();

+ 10 - 14
app/Http/Controllers/TestController.php

@@ -88,19 +88,15 @@ class TestController extends Controller
 
     public function test()
     {
-        $a = new StorageService();
-        $b = Station::query()->where("station_type_id",5)->whereNotNull("parent_id")->get();
-        $a->clearTask(array_column($b->toArray(),"code"));
-    }
-    public function _stationCacheLightOff($locCode)
-    {
-        if (!$locCode) return null;
-        $params = [
-            "areaCode" => "1004",
-            'locCode' => $locCode,
-            'PTLAction' => 0,
-        ];
-        $response = Http::post(config('api.haiq.storage.light'), $params);
-        return json_decode($response->body());
+        $a = DB::select(DB::raw("select payload from failed_jobs where id in (356633,356640)"));
+        $o = [];
+        foreach ($a as $b){
+            $c = json_decode($b->payload)->tags;
+            foreach ($c as $d){
+                $o[] = explode(":",$d)[1];
+            }
+        }
+        $orders = Order::query()->whereIn("id",$o)->get();
+        $this->dispatch(new OrderCreateInstantBill($orders));
     }
 }

+ 6 - 11
app/Http/Middleware/LogPostRequest.php

@@ -19,17 +19,12 @@ class LogPostRequest
      */
     public function handle($request, Closure $next)
     {
-        try {
-            if($request->method()!='GET'){
-                LogService::log($request->fullUrl(),$request->method(),
-                    '请求:'.json_encode($request->all())
-                    .'请求头:'.json_encode($request->headers->all())
-                );
-            }
-            return $next($request);
-        }catch (\Exception $e){
-            $this->push(__METHOD__."->".__LINE__,"路径跳转捕获",$e->getMessage()."  请求用户:".Auth::id()."  request对象:".json_encode($request));
-            return view("exception.404");
+        if($request->method()!='GET'){
+            LogService::log($request->fullUrl(),$request->method(),
+                '请求:'.json_encode($request->all())
+                .'请求头:'.json_encode($request->headers->all())
+            );
         }
+        return $next($request);
     }
 }

+ 1 - 1
app/OrderPackage.php

@@ -84,7 +84,7 @@ class OrderPackage extends Model
 
     public function getStatusAttribute($value)
     {
-        if(!$value)return '';
+        if(!$value || !isset(self::$enums['status'][$value]))return '';
         return self::$enums['status'][$value];
     }
     public function setStatusAttribute($value)

+ 2 - 2
app/Services/OrderService.php

@@ -188,7 +188,8 @@ class OrderService
         }
         if ($soreference5){
             $soreference5 = str_replace("'",'"',$soreference5);
-            $arr=array_values(array_filter(preg_split('/[,, ]+/is', $soreference5)));
+            mb_regex_encoding('utf-8');
+            $arr=array_values(array_filter(preg_split('/[,, ]+/u', $soreference5,-1,PREG_SPLIT_NO_EMPTY)));
             if (count($arr)>0){
                 $sql.=" and (soreference5 in (";
                 foreach ($arr as $index=>$str){
@@ -348,7 +349,6 @@ class OrderService
             $params['soreference']='';
             $sql = $this->getSql($params,$params['page'] ?? 1, $params['paginate'] ?? 50);
         }
-
         if ($sql)$orders=DB::connection('oracle')->select(DB::raw($sql));
         else $orders = [];
         return $this->orderFormat($orders);

+ 2 - 6
app/User.php

@@ -119,12 +119,8 @@ class User extends Authenticatable
             });
             return $ownerIds;
         }
-        return array_column(DB::table("owner_role")->whereIn("role_id",array_column($this->roles->toArray(),"id"))->get()->toArray(),"owner_id");
-        /*$this->authorities()->each(function(Authority $authority)use(&$ownerIds){
-            $ownerId=$authority->getOwnerIdAttribute();
-            if($ownerId){array_push($ownerIds,$ownerId);}
-        });
-        return array_unique($ownerIds);*/
+        return array_column(DB::table("owner_role")->whereIn("role_id",
+            array_column($this->roles->toArray(),"id"))->get()->toArray(),"owner_id");
     }
     function getPermittingWorkgroupIds($allowAll=false){
         $workgroupIds=[];