diff --git a/niucloud/app/model/customer_resources/CustomerResources.php b/niucloud/app/model/customer_resources/CustomerResources.php index cd2e4f79..3e83166f 100644 --- a/niucloud/app/model/customer_resources/CustomerResources.php +++ b/niucloud/app/model/customer_resources/CustomerResources.php @@ -153,6 +153,15 @@ class CustomerResources extends BaseModel return $this->hasOne(SixSpeed::class, 'resource_id', 'id'); } + //一对多关联"资源共享表" + public function resourceSharingHasMany() + { + return $this->hasMany(ResourceSharing::class, 'resource_id', 'id'); + } + + + + /** * 获取客户初步意向度类型名称 * @param $value diff --git a/niucloud/app/service/api/apiService/CustomerResourcesService.php b/niucloud/app/service/api/apiService/CustomerResourcesService.php index fa33da12..7c3e77a9 100644 --- a/niucloud/app/service/api/apiService/CustomerResourcesService.php +++ b/niucloud/app/service/api/apiService/CustomerResourcesService.php @@ -52,6 +52,9 @@ class CustomerResourcesService extends BaseApiService $model = $model->where('name', 'like', "%{$where['name']}%"); } $data = $model->field($field) + ->with([ + 'resourceSharingHasMany' + ]) ->append([ 'initial_intent_name' ])