正在显示
4 个修改的文件
包含
11 行增加
和
19 行删除
| @@ -12,7 +12,6 @@ namespace App\Http\Controllers\Bside\Template; | @@ -12,7 +12,6 @@ namespace App\Http\Controllers\Bside\Template; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Http\Logic\Bside\BTemplate\VisualizationLogic; | 14 | use App\Http\Logic\Bside\BTemplate\VisualizationLogic; |
| 15 | -use App\Models\Visualization\Visualization; | ||
| 16 | 15 | ||
| 17 | /** | 16 | /** |
| 18 | * @remark :定制项目处理 | 17 | * @remark :定制项目处理 |
| @@ -402,16 +402,16 @@ class VisualizationLogic extends BaseLogic | @@ -402,16 +402,16 @@ class VisualizationLogic extends BaseLogic | ||
| 402 | 'template_id' => $template_id, | 402 | 'template_id' => $template_id, |
| 403 | 'project_id' => $this->user['project_id'] | 403 | 'project_id' => $this->user['project_id'] |
| 404 | ]; | 404 | ]; |
| 405 | - if ($source == 2) {//产品页 | 405 | + if ($source == BTemplate::SOURCE_PRODUCT) {//产品页 |
| 406 | if($source_id != 0){$data['type'] = 2;if ($pageInfo['product_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} | 406 | if($source_id != 0){$data['type'] = 2;if ($pageInfo['product_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} |
| 407 | else {$data['type'] = 3;if ($pageInfo['product_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} | 407 | else {$data['type'] = 3;if ($pageInfo['product_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} |
| 408 | - if ($source == 3) {//博客页 | 408 | + if ($source == BTemplate::SOURCE_BLOG) {//博客页 |
| 409 | if ($source_id != 0) {$data['type'] = 4;if ($pageInfo['blog_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} | 409 | if ($source_id != 0) {$data['type'] = 4;if ($pageInfo['blog_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} |
| 410 | else {$data['type'] = 5;if ($pageInfo['blog_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} | 410 | else {$data['type'] = 5;if ($pageInfo['blog_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} |
| 411 | - if ($source == 4) {//新闻页 | 411 | + if ($source == BTemplate::SOURCE_NEWS) {//新闻页 |
| 412 | if ($source_id != 0) {$data['type'] = 6;if ($pageInfo['news_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} | 412 | if ($source_id != 0) {$data['type'] = 6;if ($pageInfo['news_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} |
| 413 | else {$data['type'] = 7;if ($pageInfo['news_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} | 413 | else {$data['type'] = 7;if ($pageInfo['news_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}} |
| 414 | - if ($source == 5) {//聚合页 | 414 | + if ($source == BTemplate::SOURCE_KEYWORD) {//聚合页 |
| 415 | $data['type'] = 8;if ($pageInfo['polymerization'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} | 415 | $data['type'] = 8;if ($pageInfo['polymerization'] != 0) {$commonInfo = $commonTemplateModel->read($data);}} |
| 416 | } | 416 | } |
| 417 | } | 417 | } |
| @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic | @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic | ||
| 51 | $category_ids = $this->getLastCategoryArr($this->param['category_id']); | 51 | $category_ids = $this->getLastCategoryArr($this->param['category_id']); |
| 52 | $this->param['category_id'] = ','.implode(',',$category_ids).','; | 52 | $this->param['category_id'] = ','.implode(',',$category_ids).','; |
| 53 | } | 53 | } |
| 54 | -// DB::connection('custom_mysql')->beginTransaction(); | ||
| 55 | -// try { | 54 | + DB::connection('custom_mysql')->beginTransaction(); |
| 55 | + try { | ||
| 56 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 56 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 57 | $id = $this->param['id']; | 57 | $id = $this->param['id']; |
| 58 | //查看路由是否更新 | 58 | //查看路由是否更新 |
| @@ -68,11 +68,11 @@ class ProductLogic extends BaseLogic | @@ -68,11 +68,11 @@ class ProductLogic extends BaseLogic | ||
| 68 | CategoryRelated::saveRelated($id, $category_ids); | 68 | CategoryRelated::saveRelated($id, $category_ids); |
| 69 | //保存扩展字段 | 69 | //保存扩展字段 |
| 70 | $this->saveExtendInfo($id,$extend); | 70 | $this->saveExtendInfo($id,$extend); |
| 71 | -// DB::connection('custom_mysql')->commit(); | ||
| 72 | -// }catch (\Exception $e){ | ||
| 73 | -// DB::connection('custom_mysql')->rollBack(); | ||
| 74 | -// $this->fail('系统错误请联系管理员'); | ||
| 75 | -// } | 71 | + DB::connection('custom_mysql')->commit(); |
| 72 | + }catch (\Exception $e){ | ||
| 73 | + DB::connection('custom_mysql')->rollBack(); | ||
| 74 | + $this->fail('系统错误请联系管理员'); | ||
| 75 | + } | ||
| 76 | //通知更新 | 76 | //通知更新 |
| 77 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); | 77 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); |
| 78 | return $this->success(); | 78 | return $this->success(); |
| @@ -109,13 +109,6 @@ class RouteMap extends Base | @@ -109,13 +109,6 @@ class RouteMap extends Base | ||
| 109 | } | 109 | } |
| 110 | try { | 110 | try { |
| 111 | $route_map = self::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first(); | 111 | $route_map = self::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first(); |
| 112 | - //上线项目 不能修改链接了 | ||
| 113 | - if($route_map){ | ||
| 114 | - $project = ProjectLogic::instance()->getInfo($project_id); | ||
| 115 | - if($project['type'] !== Project::STATUS_ONE){ | ||
| 116 | - return $route_map->route; | ||
| 117 | - } | ||
| 118 | - } | ||
| 119 | if(!$route_map){ | 112 | if(!$route_map){ |
| 120 | $route_map = new self(); | 113 | $route_map = new self(); |
| 121 | $route_map->source = $source; | 114 | $route_map->source = $source; |
-
请 注册 或 登录 后发表评论