|
@@ -480,4 +480,104 @@ class WebController extends AbstractController
|
|
return Result::success($result['data']);
|
|
return Result::success($result['data']);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 获取网站底部信息
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteFootInfo()
|
|
|
|
+ {
|
|
|
|
+ $data = [
|
|
|
|
+ 'website_id'=>Context::get("SiteId")
|
|
|
|
+ ];
|
|
|
|
+ $result = $this->websiteServiceClient->getWebsiteFootInfo($data);
|
|
|
|
+ if ($result['code'] != ErrorCode::SUCCESS) {
|
|
|
|
+ return Result::error($result['message'],0,[]);
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result['data']);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取网站底部导航
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteFooterCategory()
|
|
|
|
+ {
|
|
|
|
+ $data = [
|
|
|
|
+ 'website_id'=>Context::get("SiteId")
|
|
|
|
+ ];
|
|
|
|
+ $result = $this->websiteServiceClient->getWebsiteFooterCategory($data);
|
|
|
|
+ if ($result['code']!= ErrorCode::SUCCESS) {
|
|
|
|
+ return Result::error($result['message'],0,[]);
|
|
|
|
+ }else{
|
|
|
|
+ return Result::success($result['data']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取网站底部导航列表
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteFooterCategoryList()
|
|
|
|
+ {
|
|
|
|
+ $requireData = $this->request->all();
|
|
|
|
+ $validator = $this->validationFactory->make(
|
|
|
|
+ $requireData,
|
|
|
|
+ [
|
|
|
|
+ 'fcat_id' =>'required|integer'
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'fcat_id.required' => '底部导航栏目id不能为空',
|
|
|
|
+ 'fcat_id.integer' => '底部导航栏目id必须为整数'
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ if ($validator->fails()){
|
|
|
|
+ $errorMessage = $validator->errors()->first();
|
|
|
|
+ return Result::error($errorMessage);
|
|
|
|
+ }
|
|
|
|
+ $data = [
|
|
|
|
+ 'fcat_id'=>$requireData['fcat_id'],
|
|
|
|
+ 'website_id'=>Context::get("SiteId")
|
|
|
|
+ ];
|
|
|
|
+ $result = $this->websiteServiceClient->getWebsiteFooterCategoryList($data);
|
|
|
|
+ if ($result['code']!= ErrorCode::SUCCESS) {
|
|
|
|
+ return Result::error($result['message'],0,[]);
|
|
|
|
+ }else{
|
|
|
|
+ return Result::success($result['data']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取网站底部导航内容
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteFooterCategoryInfo()
|
|
|
|
+ {
|
|
|
|
+ $requireData = $this->request->all();
|
|
|
|
+ $validator = $this->validationFactory->make(
|
|
|
|
+ $requireData,
|
|
|
|
+ [
|
|
|
|
+ 'fcat_id' =>'required|integer',
|
|
|
|
+ 'type' => 'nullable|in:0'
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'fcat_id.required' => 'id不能为空',
|
|
|
|
+ 'fcat_id.integer' => 'id必须为整数',
|
|
|
|
+ 'type.in' => '类型必须为0'
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ if ($validator->fails()){
|
|
|
|
+ $errorMessage = $validator->errors()->first();
|
|
|
|
+ return Result::error($errorMessage);
|
|
|
|
+ }
|
|
|
|
+ $data = [
|
|
|
|
+ 'fcat_id'=>$requireData['fcat_id'],
|
|
|
|
+ 'website_id'=>Context::get("SiteId")
|
|
|
|
+ ];
|
|
|
|
+ if(isset($requireData['type'])){
|
|
|
|
+ $data['type'] = $requireData['type'];
|
|
|
|
+ }
|
|
|
|
+ $result = $this->websiteServiceClient->getWebsiteFooterCategoryInfo($data);
|
|
|
|
+ if ($result['code']!= ErrorCode::SUCCESS) {
|
|
|
|
+ return Result::error($result['message'],0,[]);
|
|
|
|
+ }else{
|
|
|
|
+ return Result::success($result['data']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|