From c13b8914228e6a404bd60ee36bf2479383da8f23 Mon Sep 17 00:00:00 2001
From: liyaozhi <lzhflash@163.com>
Date: Sun, 09 Nov 2025 10:55:14 +0800
Subject: [PATCH] 111
---
admin/app/common/model/branch/Member.php | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/admin/app/common/model/branch/Member.php b/admin/app/common/model/branch/Member.php
index 1ba5f6e..661a373 100644
--- a/admin/app/common/model/branch/Member.php
+++ b/admin/app/common/model/branch/Member.php
@@ -5,6 +5,7 @@
use app\common\model\BaseModel;
use app\common\model\user\User as UserModel;
use app\common\model\branch\Branch as BranchModel;
+use app\common\model\settings\Region;
/**
* 连盟成员模型
@@ -13,6 +14,12 @@
{
protected $name = 'branch_member';
protected $pk = 'user_id';
+
+ /**
+ * 追加字段
+ * @var string[]
+ */
+ protected $append = ['region'];
/**
* 关联所属分会表
@@ -40,6 +47,24 @@
}
/**
+ * 籍贯
+ * @param $value
+ * @param $data
+ * @return array
+ */
+ public function getRegionAttr($value, $data)
+ {
+ if (!isset($data['province_id'])) {
+ return false;
+ }
+ return [
+ 'province' => Region::getNameById($data['province_id']),
+ 'city' => Region::getNameById($data['city_id']),
+ 'region' => $data['region_id'] == 0 ? '' : Region::getNameById($data['region_id']),
+ ];
+ }
+
+ /**
* 详情
*/
public static function detail($user_id, $with = ['user'])
--
Gitblit v1.9.2