|
@@ -1951,4 +1951,71 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
|
|
|
|
|
|
// 自助建站---------------fr---------------
|
|
|
+
|
|
|
+
|
|
|
+ // 网站底基础信息--fr-------------------
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加网站底基础信息
|
|
|
+ * @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
|
|
|
+ {
|
|
|
+ // return Result::success($data['website_id']);
|
|
|
+ $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);
|
|
|
+ }
|
|
|
+ // $where = ['website_id'=>$data['website_id']];
|
|
|
+ // unset($data['website_id']);
|
|
|
+ $result = WebsiteTemplateInfo::where($where)->update($data);
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("修改失败!",0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
}
|