|
@@ -167,15 +167,15 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
'suffix' => $data['suffix'] ?? "",
|
|
|
'ad_key' => $data['ad_key'] ?? "",
|
|
|
];
|
|
|
- $web_templsate = WebsiteTemplateInfo::where('website_id', $data['id'])->first();
|
|
|
+ // $web_templsate = WebsiteTemplateInfo::where('website_id', $data['id'])->first();
|
|
|
// `status` tinyint(1) DEFAULT '0' COMMENT '0:未构建 1:未应用 2:已应用',
|
|
|
- if (!empty($web_templsate) && $web_templsate['status'] == 2) {
|
|
|
- return Result::error("此网站已应用,不可修改基本信息", 0);
|
|
|
- }
|
|
|
-
|
|
|
- Db::beginTransaction();
|
|
|
- try {
|
|
|
- if ($data['ad_key'] != $website['ad_key']) {
|
|
|
+ // if (!empty($web_templsate) && $web_templsate['status'] == 2) {
|
|
|
+ // return Result::error("此网站已应用,不可修改基本信息", 0);
|
|
|
+ // }
|
|
|
+
|
|
|
+ Db::beginTransaction();
|
|
|
+ try{
|
|
|
+ if($data['ad_key'] != $website['ad_key']){
|
|
|
$web = Website::where(function ($query) use ($data) {
|
|
|
$query->where('id', '!=', $data['id'])
|
|
|
->where('ad_key', $data['ad_key']);
|
|
@@ -2126,8 +2126,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
public function getWebsiteintel(array $data): array
|
|
|
{
|
|
|
//查询所有网站模板信息
|
|
|
- $query = Website::where('website.status', 1)
|
|
|
- ->leftJoin("website_template_info", "website_template_info.website_id", "website.id")
|
|
|
+ $query = Website::leftJoin("website_template_info", "website_template_info.website_id", "website.id")
|
|
|
->leftJoin("template", "template.template_id", "website_template_info.template_id")
|
|
|
->leftJoin("template_class", "template_class.class_id", "template.template_class_id")
|
|
|
->leftJoin('website_column', 'website_column.id', 'website.website_column_id')
|
|
@@ -2244,6 +2243,11 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
if (empty($result)) {
|
|
|
return Result::error("请输入正确的网站id!", 0);
|
|
|
}
|
|
|
+ // 0:未构建 1:未应用 2:已应用
|
|
|
+ if($result['status'] == 2){
|
|
|
+ return Result::error("此网站的模板正在应用中,暂不可编辑!", 0);
|
|
|
+ }
|
|
|
+
|
|
|
// 订单状态:1:通过;2:驳回;3:撤回;4:修改;5:过期;6:待审核;7:结束
|
|
|
$order = Order::where('website_id', $data['website_id'])->where('status', 1)->first();
|
|
|
if (!empty($order)) {
|
|
@@ -3526,6 +3530,8 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
//克隆网站基础信息 website_template_info website_category
|
|
|
$resultWebsiteTemplateInfo = WebsiteTemplateInfo::where(['website_id' => $data['website_id']])->first();
|
|
|
$clone_website_template_info = $resultWebsiteTemplateInfo->replicate();
|
|
|
+ $clone_website_template_info->status = 0;
|
|
|
+ $clone_website_template_info->action_id = 0;
|
|
|
$clone_website_template_info->website_id = $clone_website->id;
|
|
|
$clone_website_template_info->save();
|
|
|
//克隆网站导航 获取原始 website_id 对应的所有 WebsiteCategory 记录
|