Kaynağa Gözat

修改获取某个任务规则联合查询

15313670163 4 ay önce
ebeveyn
işleme
69e64ad8c4
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      app/JsonRpc/CollectorService.php

+ 1 - 1
app/JsonRpc/CollectorService.php

@@ -272,7 +272,7 @@ class CollectorService implements CollectorServiceInterface
      */
     public function getOneRule(array $data): array
     {
-        $result = Rule::where('id',$data['id'])->first();
+        $result = Rule::withCount(relations:'arts')->where('id',$data['id'])->first();
         if(empty($result)){
             return Result::error('请输入正确的规则任务id!');