From 2ce0ff589b0b18becb5fb61467469a677f1d1314 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 13 Dec 2023 09:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/lists/custom/CustomLists.php | 1 + app/common/model/custom/Custom.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/adminapi/lists/custom/CustomLists.php b/app/adminapi/lists/custom/CustomLists.php index 1354d0b64..54e4c1e64 100644 --- a/app/adminapi/lists/custom/CustomLists.php +++ b/app/adminapi/lists/custom/CustomLists.php @@ -55,6 +55,7 @@ class CustomLists extends BaseAdminDataLists implements ListsSearchInterface public function lists(): array { return Custom::where($this->searchWhere) + ->with('province') ->field(['*']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) diff --git a/app/common/model/custom/Custom.php b/app/common/model/custom/Custom.php index dfed9ce7c..413739668 100644 --- a/app/common/model/custom/Custom.php +++ b/app/common/model/custom/Custom.php @@ -32,8 +32,8 @@ class Custom extends BaseModel protected $deleteTime = 'delete_time'; - public function provinceName() + public function province() { - return $this->hasOne(GeoProvince::class, 'province_id','province'); + return $this->hasOne(GeoProvince::class, 'province_code','province'); } } \ No newline at end of file