Browse Source

建立接口:获取b端通栏位置模版

15313670163 23 hours ago
parent
commit
6174e52877

+ 15 - 1
app/JsonRpc/PublicRpcService.php

@@ -35,7 +35,7 @@ use App\Model\Website;
 use App\Constants\ErrorCode;
 use GuzzleHttp\Client;
 use GuzzleHttp\Exception\GuzzleException;
-
+use App\Model\SectorPlace;
 #[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
 class PublicRpcService implements PublicRpcServiceInterface
 {
@@ -1524,4 +1524,18 @@ class PublicRpcService implements PublicRpcServiceInterface
         }
         return Result::success($template);
     }
+    /**
+     * 自助建站-通栏管理-获取通栏位置
+     */
+    public function getSectorPlace(array $data): array
+    {
+        $template = SectorPlace::where('sector_place.sector_num', $data['sector_num'])
+        ->leftJoin('size','sector_place.size_id','=','size.id')
+        ->select('sector_place.*','size.width','size.height')
+        ->get()->all();
+        if(empty($template)){
+            return Result::error('未查询到通栏位置相关模版!');
+        }
+        return Result::success($template);
+    }
 }

+ 1 - 0
app/JsonRpc/PublicRpcServiceInterface.php

@@ -184,4 +184,5 @@ interface PublicRpcServiceInterface
     public function getAllTemplate(array $data): array;
     public function getWebsiteTemplate(array $data): array;
     public function getAllSize(array $data): array;
+    public function getSectorPlace(array $data): array;
 }

+ 27 - 0
app/Model/SectorPlace.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class SectorPlace extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'sector_place';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}