|
@@ -1262,7 +1262,21 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$page_type = json_encode([1,2,3,4,6,7]);
|
|
|
}
|
|
|
// 0:未构建;1:已填写基础信息;2:已选择模板; action_id
|
|
|
- $result = WebsiteTemplateInfo::where('website_id', $data['website_id'])->update(['page_type' => $page_type],['action_id' => 1]);
|
|
|
+ $website_template_info = WebsiteTemplateInfo::where('website_id', $data['website_id'])->first();
|
|
|
+ if($website_template_info['action_id'] == 2){
|
|
|
+ return Result::error('网站已应用,不可再次修改!');
|
|
|
+ }
|
|
|
+ if(empty($website_template_info)){
|
|
|
+ $result = WebsiteTemplateInfo::insertGetId([
|
|
|
+ 'website_id' => $data['website_id'],
|
|
|
+ 'page_type' => $page_type,
|
|
|
+ 'action_id' => 1,
|
|
|
+ 'status' => 0,
|
|
|
+ 'user_id' => $data['user_id'],
|
|
|
+ ]);
|
|
|
+ }else{
|
|
|
+ $result = WebsiteTemplateInfo::where('website_id', $data['website_id'])->update(['page_type' => $page_type],['action_id' => 1,'user_id' => $data['user_id']]);
|
|
|
+ }
|
|
|
if ($result) {
|
|
|
return Result::success($result);
|
|
|
} else {
|