Browse Source

企业信息 增加字段

kphcdr 1 year ago
parent
commit
236c9aad61
2 changed files with 6 additions and 1 deletions
  1. 5 0
      app/Base/Utils.php
  2. 1 1
      app/Exports/AdminOrderExport.php

+ 5 - 0
app/Base/Utils.php

@@ -14,4 +14,9 @@ class Utils
     {
         return str_replace("4", "o", $id);
     }
+
+    public static function idHas4($id)
+    {
+        return str_replace("o", "4", $id);
+    }
 }

+ 1 - 1
app/Exports/AdminOrderExport.php

@@ -28,7 +28,7 @@ class AdminOrderExport implements FromCollection
             $query->where("id", $this->params['id']);
         })->when($this->params['userinfo'], function (Builder $query) {
             //根据userinfo获取用户信息
-            if ($user = User::where("email", $this->params['userinfo'])->orWhere("phone", $this->params['userinfo'])->orWhere("id", $this->params['userinfo'])->first()) {
+            if ($user = User::where("email", $this->params['userinfo'])->orWhere("phone", $this->params['userinfo'])->orWhere("id", Utils::idHas4($this->params['userinfo']))->first()) {
                 $query->where("user_id", $user->id);
             } else {
                 $query->where("id", 0);