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