|
@@ -26,6 +26,8 @@ use App\Model\Component;
|
|
use App\Model\Link;
|
|
use App\Model\Link;
|
|
use App\Model\FooterCategory;
|
|
use App\Model\FooterCategory;
|
|
use App\Model\Size;
|
|
use App\Model\Size;
|
|
|
|
+use App\Model\Website;
|
|
|
|
+
|
|
#[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
#[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
class PublicRpcService implements PublicRpcServiceInterface
|
|
class PublicRpcService implements PublicRpcServiceInterface
|
|
{
|
|
{
|
|
@@ -1404,6 +1406,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
*/
|
|
*/
|
|
public function saveWebsiteTemplate(array $data): array
|
|
public function saveWebsiteTemplate(array $data): array
|
|
{
|
|
{
|
|
|
|
+ // return Result::success($data);
|
|
$website_template_info = WebsiteTemplateInfo::where('website_id', $data['website_id'])->first();
|
|
$website_template_info = WebsiteTemplateInfo::where('website_id', $data['website_id'])->first();
|
|
if(empty($website_template_info)){
|
|
if(empty($website_template_info)){
|
|
return Result::error('请先填写网站基础信息!');
|
|
return Result::error('请先填写网站基础信息!');
|
|
@@ -1422,10 +1425,11 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
if(empty($template_info)){
|
|
if(empty($template_info)){
|
|
$template = WebsiteTemplate::insertGetId([
|
|
$template = WebsiteTemplate::insertGetId([
|
|
'website_id' => $data['website_id'],
|
|
'website_id' => $data['website_id'],
|
|
- 'template_data' => $data['template_data']
|
|
|
|
|
|
+ 'template_data' => $data['template_data'],
|
|
|
|
+ 'user_id' => $data['user_id'],
|
|
]);
|
|
]);
|
|
}else{
|
|
}else{
|
|
- $template = WebsiteTemplate::where('website_id', $data['website_id'])->update(['template_data' => $data['template_data']]);
|
|
|
|
|
|
+ $template = WebsiteTemplate::where('website_id', $data['website_id'])->update(['template_data' => $data['template_data'],'user_id' => $data['user_id']]);
|
|
}
|
|
}
|
|
if(empty($template)){
|
|
if(empty($template)){
|
|
Db::rollback();
|
|
Db::rollback();
|
|
@@ -1443,4 +1447,21 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
}
|
|
}
|
|
return Result::success($template);
|
|
return Result::success($template);
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 自助建站---流程---6.返显保存的模版
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteTemplate(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $web = Website::where('id', $data['website_id'])->first();
|
|
|
|
+ if(empty($web)){
|
|
|
|
+ return Result::error('未查询到网站信息!');
|
|
|
|
+ }
|
|
|
|
+ $template = WebsiteTemplate::where('website_id', $data['website_id'])->first();
|
|
|
|
+ if(empty($template)){
|
|
|
|
+ return Result::error('未查询到模版!');
|
|
|
|
+ }
|
|
|
|
+ return Result::success($template);
|
|
|
|
+ }
|
|
}
|
|
}
|