From 139af4befe203b13cc86aa0bf5833a253ce89bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Sat, 25 May 2024 23:47:30 +0800 Subject: [PATCH] 1 --- app/common/model/Feedback.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/common/model/Feedback.php b/app/common/model/Feedback.php index 97fb6800..304d3752 100644 --- a/app/common/model/Feedback.php +++ b/app/common/model/Feedback.php @@ -28,6 +28,15 @@ class Feedback extends BaseModel // 定义主键 protected $pk = 'feedback_id'; + /** + * 关联模型:主图视频文件 + * @return HasOne + */ + public function store(): HasOne + { + return $this->hasOne('Store', 'store_id', 'store_id'); + } + /** * 详情信息 @@ -51,7 +60,7 @@ class Feedback extends BaseModel */ public function getList(array $param = [], int $pageSize = 15): \think\Paginator { - $res = $this->where($this->getFilter($param)) + $res = $this->with(['store.store_name'])->where($this->getFilter($param)) ->where('is_delete', '=', 0) ->order(['create_time' => 'desc', $this->getPk()]) ->paginate($pageSize);