cqp 6 日 前
コミット
aca4e3ce63
1 ファイル変更8 行追加4 行削除
  1. 8 4
      app/Service/Service.php

+ 8 - 4
app/Service/Service.php

@@ -410,13 +410,17 @@ class Service
         return $user['depart_select']['depart_id'];
     }
 
-    public function getMyTopDepart($user){
+    public function getMyTopDepart($user, $get_title = false){
         if(empty($user)) return 0;
         //当前门店
         $current_top_depart_id = $user['depart_top'][0] ?? [];
-        $current_top_depart_id = $current_top_depart_id['depart_id'] ?? 0;
-
-        return $current_top_depart_id;
+        if($get_title){
+            $current_top_depart_title = $current_top_depart_id['title'] ?? "";
+            return $current_top_depart_title;
+        }else{
+            $current_top_depart_id = $current_top_depart_id['depart_id'] ?? 0;
+            return $current_top_depart_id;
+        }
     }
 
     public function returnOrderEditErrorCommon($current_top_depart_id, $order_top_depart_id){