|
|
@@ -67,6 +67,7 @@ use Hyperf\Coroutine\Concurrent;
|
|
|
use function Hyperf\Coroutine\batch;
|
|
|
use Swoole\Coroutine;
|
|
|
use App\Model\Message;
|
|
|
+use App\Model\ResearchTopic;
|
|
|
#[RpcService(name: "WebService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class WebService implements WebServiceInterface
|
|
|
{
|
|
|
@@ -3820,4 +3821,41 @@ class WebService implements WebServiceInterface
|
|
|
$result = Result::buildCityTree($province_city);
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getWebsiteResearchTopic(array $data): array
|
|
|
+ {
|
|
|
+ $web = Website::where('id',$data['website_id'])->first();
|
|
|
+ if (empty($web)) {
|
|
|
+ return Result::error("暂无相关网站信息", 0);
|
|
|
+ }
|
|
|
+ $column_arr = json_decode($web['website_column_arr_id'] ?? [], true);
|
|
|
+ $where['level'] = 1;
|
|
|
+ if (isset($data['province_id']) && !empty($data['province_id'])) {
|
|
|
+ $where['province_id'] = $data['province_id'];
|
|
|
+ }
|
|
|
+ if (isset($data['city_id']) && !empty($data['city_id'])) {
|
|
|
+ $where['city_id'] = $data['city_id'];
|
|
|
+ }
|
|
|
+ if (isset($data['county_id']) && !empty($data['county_id'])) {
|
|
|
+ $where['county_id'] = $data['county_id'];
|
|
|
+ }
|
|
|
+ if(isset($data['title']) && !empty($data['title'])){
|
|
|
+ array_push($where,['title','like','%'.$data['title'].'%']);
|
|
|
+ }
|
|
|
+ $research_topic = ResearchTopic::whereIn('column_id', $column_arr)
|
|
|
+ ->where($where)
|
|
|
+ ->select('id', 'title', 'keyword', 'description','province_id','city_id','county_id')
|
|
|
+ ->paginate($data['page_size'], ['*'], 'page', $data['page']);
|
|
|
+ if (empty($research_topic->items())) {
|
|
|
+ return Result::error("暂无相关研究主题信息", 0);
|
|
|
+ }
|
|
|
+ $result = [
|
|
|
+ 'rows' => $research_topic->items(),
|
|
|
+ 'count' => $research_topic->total(),
|
|
|
+ ];
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
}
|