|
@@ -1566,9 +1566,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
return Result::error("参数错误", 0);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2029,6 +2027,115 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 添加网站底基础信息
|
|
|
+ * @param array $data
|
|
|
+ */
|
|
|
+ public function addWebFootInfo(array $data): array
|
|
|
+ {
|
|
|
+ $website = Website::where('id',$data['website_id'])->first();
|
|
|
+ if(empty($website)){
|
|
|
+ return Result::error("请输入正确的网站id!", 0);
|
|
|
+ }
|
|
|
+ $info = WebsiteTemplateInfo::where('website_id',$data['website_id'])->first();
|
|
|
+ if(!empty($info)){
|
|
|
+ return Result::error("该网站已经添加过了!", 0);
|
|
|
+ }
|
|
|
+ $result = WebsiteTemplateInfo::where('website_id',$data['website_id'])->insertGetId($data);
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("请先添加网站基础信息!",0);
|
|
|
+ }else{
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ * 获取网站底基础信息
|
|
|
+ * @param array $data
|
|
|
+ */
|
|
|
+ public function getWebFootInfo(array $data): array
|
|
|
+ {
|
|
|
+ $website = Website::where('id',$data['website_id'])->first();
|
|
|
+ if(empty($website)){
|
|
|
+ return Result::error("请输入正确的网站id!", 0);
|
|
|
+ }
|
|
|
+ $result = WebsiteTemplateInfo::where('website_id',$data['website_id'])->first();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("请先添加网站基础信息!",0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
+
|
|
|
+ * 修改网站底基础信息
|
|
|
+ * @param array $data
|
|
|
+ */
|
|
|
+ public function upWebFootInfo(array $data): array
|
|
|
+ {
|
|
|
+
|
|
|
+ $website = Website::where('id',$data['website_id'])->first();
|
|
|
+ if(empty($website)){
|
|
|
+ return Result::error("请输入正确的网站id!", 0);
|
|
|
+
|
|
|
+ }
|
|
|
+ $where = ['website_id'=>$data['website_id']];
|
|
|
+ unset($data['website_id']);
|
|
|
+ $result = WebsiteTemplateInfo::where($where)->first();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("请先添加网站基础信息!",0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $result = WebsiteTemplateInfo::where($where)->update($data);
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("修改失败!",0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取父级/子级栏目
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ * */
|
|
|
+ public function getWebsiteParentCategory(array $data): array
|
|
|
+ {
|
|
|
+ if(isset($data['website_id']) &&!empty($data['website_id'])){
|
|
|
+ $website = Website::where('id',$data['website_id'])->where('status',1)->first();
|
|
|
+ }
|
|
|
+ if (empty($website)) {
|
|
|
+ return Result::error("暂无该网站",0);
|
|
|
+ }
|
|
|
+ if($data['id']==0){
|
|
|
+ $category = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
+ ->where('pid', 0)
|
|
|
+ ->pluck('aLIas_pinyin')
|
|
|
+ ->map(function ($alias) {
|
|
|
+ return "/{$alias}/:id";
|
|
|
+ })
|
|
|
+ ->values()
|
|
|
+ ->all();
|
|
|
+ }else{
|
|
|
+ $category = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
+ ->where('pid','!=', 0)
|
|
|
+ ->pluck('aLIas_pinyin')
|
|
|
+ ->map(function ($alias) {
|
|
|
+ return "/{$alias}/:id";
|
|
|
+ })
|
|
|
+ ->values()
|
|
|
+ ->all();
|
|
|
+ }
|
|
|
+ if (empty($category)) {
|
|
|
+ return Result::error("暂无此导航",0);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result::success($category);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public function addWebsiteGroup(array $data): array
|
|
|
{
|