Merge remote-tracking branch 'origin/master' into akun
正在显示
14 个修改的文件
包含
223 行增加
和
19 行删除
| @@ -161,4 +161,20 @@ class NewsCategoryController extends BaseController | @@ -161,4 +161,20 @@ class NewsCategoryController extends BaseController | ||
| 161 | $this->response('success'); | 161 | $this->response('success'); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | + /** | ||
| 165 | + * @remark :复制新闻分类 | ||
| 166 | + * @name :copyCategory | ||
| 167 | + * @author :lyh | ||
| 168 | + * @method :post | ||
| 169 | + * @time :2024/5/9 9:14 | ||
| 170 | + */ | ||
| 171 | + public function copyCategory(NewsCategoryLogic $newsLogic){ | ||
| 172 | + $this->request->validate([ | ||
| 173 | + 'id'=>'required', | ||
| 174 | + ],[ | ||
| 175 | + 'id.required' => 'id不能为空', | ||
| 176 | + ]); | ||
| 177 | + $data = $newsLogic->copyCategory(); | ||
| 178 | + $this->response('success',Code::SUCCESS,$data); | ||
| 179 | + } | ||
| 164 | } | 180 | } |
| @@ -177,4 +177,21 @@ class CategoryController extends BaseController | @@ -177,4 +177,21 @@ class CategoryController extends BaseController | ||
| 177 | $logic->setAllSort(); | 177 | $logic->setAllSort(); |
| 178 | $this->response('success'); | 178 | $this->response('success'); |
| 179 | } | 179 | } |
| 180 | + | ||
| 181 | + /** | ||
| 182 | + * @remark :复制分类 | ||
| 183 | + * @name :copyCategory | ||
| 184 | + * @author :lyh | ||
| 185 | + * @method :post | ||
| 186 | + * @time :2024/5/8 17:49 | ||
| 187 | + */ | ||
| 188 | + public function copyCategory(CategoryLogic $logic){ | ||
| 189 | + $this->request->validate([ | ||
| 190 | + 'id'=>['required'], | ||
| 191 | + ],[ | ||
| 192 | + 'id.required' => 'ID不能为空', | ||
| 193 | + ]); | ||
| 194 | + $logic->copyCategoryInfo(); | ||
| 195 | + $this->response('success'); | ||
| 196 | + } | ||
| 180 | } | 197 | } |
| @@ -20,6 +20,7 @@ use App\Models\Product\Product; | @@ -20,6 +20,7 @@ use App\Models\Product\Product; | ||
| 20 | use App\Models\Project\Project; | 20 | use App\Models\Project\Project; |
| 21 | use App\Models\RouteMap\RouteMap; | 21 | use App\Models\RouteMap\RouteMap; |
| 22 | use App\Models\WebSetting\SettingNum; | 22 | use App\Models\WebSetting\SettingNum; |
| 23 | +use App\Models\WebSetting\Translate; | ||
| 23 | use App\Models\WebSetting\WebLanguage; | 24 | use App\Models\WebSetting\WebLanguage; |
| 24 | 25 | ||
| 25 | class TranslateController extends BaseController | 26 | class TranslateController extends BaseController |
| @@ -46,6 +47,29 @@ class TranslateController extends BaseController | @@ -46,6 +47,29 @@ class TranslateController extends BaseController | ||
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | /** | 49 | /** |
| 50 | + * @remark :根据语种获取翻译校队内容 | ||
| 51 | + * @name :getLanguageList | ||
| 52 | + * @author :lyh | ||
| 53 | + * @method :post | ||
| 54 | + * @time :2024/5/8 16:08 | ||
| 55 | + */ | ||
| 56 | + public function getLanguageList(Translate $translate){ | ||
| 57 | + $this->request->validate([ | ||
| 58 | + 'language_id'=>'required', | ||
| 59 | + ],[ | ||
| 60 | + 'language_id.required' => 'language_id不能为空', | ||
| 61 | + ]); | ||
| 62 | + $this->map['type'] = 1; | ||
| 63 | + $data = $translate->list($this->map); | ||
| 64 | + foreach ($data as $k=>$v){ | ||
| 65 | + $v['data'] = json_decode($v['data']); | ||
| 66 | + $data[$k] = $v; | ||
| 67 | + } | ||
| 68 | + $this->response('success',Code::SUCCESS,$data); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + | ||
| 72 | + /** | ||
| 49 | * @remark :图片列表 | 73 | * @remark :图片列表 |
| 50 | * @name :imageList | 74 | * @name :imageList |
| 51 | * @author :lyh | 75 | * @author :lyh |
| @@ -224,7 +224,6 @@ class ImageController extends Controller | @@ -224,7 +224,6 @@ class ImageController extends Controller | ||
| 224 | * @time :2024/4/26 16:10 | 224 | * @time :2024/4/26 16:10 |
| 225 | */ | 225 | */ |
| 226 | public function getOnlyFilename($name,$project_id = 0){ | 226 | public function getOnlyFilename($name,$project_id = 0){ |
| 227 | - | ||
| 228 | $nameArr = explode('.',$name); | 227 | $nameArr = explode('.',$name); |
| 229 | $suffix = array_pop($nameArr) ?? 'jpg'; | 228 | $suffix = array_pop($nameArr) ?? 'jpg'; |
| 230 | $nameStr = implode('-', $nameArr); | 229 | $nameStr = implode('-', $nameArr); |
| @@ -3,16 +3,12 @@ | @@ -3,16 +3,12 @@ | ||
| 3 | namespace App\Http\Logic\Bside\BTemplate; | 3 | namespace App\Http\Logic\Bside\BTemplate; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Bside\BaseLogic; | 5 | use App\Http\Logic\Bside\BaseLogic; |
| 6 | -use App\Models\Blog\Blog; | ||
| 7 | use App\Models\Blog\BlogCategory; | 6 | use App\Models\Blog\BlogCategory; |
| 8 | use App\Models\CustomModule\CustomModule; | 7 | use App\Models\CustomModule\CustomModule; |
| 9 | use App\Models\CustomModule\CustomModuleCategory; | 8 | use App\Models\CustomModule\CustomModuleCategory; |
| 10 | -use App\Models\News\News; | ||
| 11 | use App\Models\News\NewsCategory; | 9 | use App\Models\News\NewsCategory; |
| 12 | use App\Models\Product\Category; | 10 | use App\Models\Product\Category; |
| 13 | -use App\Models\Product\Product; | ||
| 14 | use App\Models\Project\PageSetting; | 11 | use App\Models\Project\PageSetting; |
| 15 | -use App\Models\Project\Project; | ||
| 16 | use App\Models\RouteMap\RouteMap; | 12 | use App\Models\RouteMap\RouteMap; |
| 17 | use App\Models\Service\Service as ServiceSettingModel; | 13 | use App\Models\Service\Service as ServiceSettingModel; |
| 18 | use App\Models\Template\BTemplateCommon; | 14 | use App\Models\Template\BTemplateCommon; |
| @@ -22,7 +18,6 @@ use App\Models\Template\BTemplate; | @@ -22,7 +18,6 @@ use App\Models\Template\BTemplate; | ||
| 22 | use App\Models\Template\BTemplateLog; | 18 | use App\Models\Template\BTemplateLog; |
| 23 | use App\Models\Template\Template; | 19 | use App\Models\Template\Template; |
| 24 | use App\Models\Template\TemplateTypeMain; | 20 | use App\Models\Template\TemplateTypeMain; |
| 25 | -use Illuminate\Support\Facades\Cache; | ||
| 26 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
| 27 | use mysql_xdevapi\Exception; | 22 | use mysql_xdevapi\Exception; |
| 28 | 23 |
| @@ -422,7 +422,7 @@ class BlogLogic extends BaseLogic | @@ -422,7 +422,7 @@ class BlogLogic extends BaseLogic | ||
| 422 | $info = $this->model->read(['id'=>$this->param['id']]); | 422 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 423 | $param = [ | 423 | $param = [ |
| 424 | 'name'=>$info['name']."-copy", | 424 | 'name'=>$info['name']."-copy", |
| 425 | - 'status'=>$info['status'], | 425 | + 'status'=>0, |
| 426 | 'sort'=>$info['sort'], | 426 | 'sort'=>$info['sort'], |
| 427 | 'category_id'=>$info['category_id'], | 427 | 'category_id'=>$info['category_id'], |
| 428 | 'text'=>$info['text'], | 428 | 'text'=>$info['text'], |
| @@ -453,19 +453,20 @@ class BlogLogic extends BaseLogic | @@ -453,19 +453,20 @@ class BlogLogic extends BaseLogic | ||
| 453 | */ | 453 | */ |
| 454 | public function copyTemplate($id,$project_id,$save_id){ | 454 | public function copyTemplate($id,$project_id,$save_id){ |
| 455 | $BTemplateModel = new BTemplate(); | 455 | $BTemplateModel = new BTemplate(); |
| 456 | - $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_BLOG,'source_id'=>$id,'project_id'=>$project_id]); | 456 | + $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_BLOG,'source_id'=>$id,'is_list'=>BTemplate::IS_DETAIL,'is_custom'=>BTemplate::IS_NO_CUSTOM,'project_id'=>$project_id]); |
| 457 | if(!empty($list)){ | 457 | if(!empty($list)){ |
| 458 | $data = []; | 458 | $data = []; |
| 459 | foreach ($list as $v){ | 459 | foreach ($list as $v){ |
| 460 | $data[] = [ | 460 | $data[] = [ |
| 461 | 'html'=>$v['html'], | 461 | 'html'=>$v['html'], |
| 462 | - 'project_id'=>$project_id, | 462 | + 'project_id'=>$v['project_id'], |
| 463 | 'source'=>$v['source'], | 463 | 'source'=>$v['source'], |
| 464 | 'source_id'=>$save_id, | 464 | 'source_id'=>$save_id, |
| 465 | 'template_id'=>$v['template_id'], | 465 | 'template_id'=>$v['template_id'], |
| 466 | 'section_list_id'=>$v['section_list_id'], | 466 | 'section_list_id'=>$v['section_list_id'], |
| 467 | 'main_html'=>$v['main_html'], | 467 | 'main_html'=>$v['main_html'], |
| 468 | 'main_css'=>$v['main_css'], | 468 | 'main_css'=>$v['main_css'], |
| 469 | + 'type'=>$v['type'], | ||
| 469 | 'created_at'=>date('Y-m-d H:i:s'), | 470 | 'created_at'=>date('Y-m-d H:i:s'), |
| 470 | 'updated_at'=>date('Y-m-d H:i:s'), | 471 | 'updated_at'=>date('Y-m-d H:i:s'), |
| 471 | ]; | 472 | ]; |
| @@ -475,6 +475,8 @@ class CustomModuleContentLogic extends BaseLogic | @@ -475,6 +475,8 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 475 | 'main_html'=>$v['main_html'], | 475 | 'main_html'=>$v['main_html'], |
| 476 | 'main_css'=>$v['main_css'], | 476 | 'main_css'=>$v['main_css'], |
| 477 | 'is_custom'=>$v['is_custom'], | 477 | 'is_custom'=>$v['is_custom'], |
| 478 | + 'is_list'=>$v['is_list'], | ||
| 479 | + 'type'=>$v['type'], | ||
| 478 | 'created_at'=>$v['created_at'], | 480 | 'created_at'=>$v['created_at'], |
| 479 | 'updated_at'=>$v['updated_at'] | 481 | 'updated_at'=>$v['updated_at'] |
| 480 | ]; | 482 | ]; |
| @@ -46,7 +46,6 @@ class CountLogic extends BaseLogic | @@ -46,7 +46,6 @@ class CountLogic extends BaseLogic | ||
| 46 | //获取项目的剩余时长 | 46 | //获取项目的剩余时长 |
| 47 | $projectModel = new Project(); | 47 | $projectModel = new Project(); |
| 48 | $projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']); | 48 | $projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']); |
| 49 | - $info['service_day'] = ($this->project['deploy_build']['service_duration'] ?? 0 - $projectInfo['finish_remain_day'] ?? 0); | ||
| 50 | $info['compliance_day'] = $projectInfo['finish_remain_day']; | 49 | $info['compliance_day'] = $projectInfo['finish_remain_day']; |
| 51 | return $this->success($info); | 50 | return $this->success($info); |
| 52 | } | 51 | } |
| @@ -9,6 +9,7 @@ use App\Models\News\News as NewsModel; | @@ -9,6 +9,7 @@ use App\Models\News\News as NewsModel; | ||
| 9 | use App\Models\News\NewsCategory as NewsCategoryModel; | 9 | use App\Models\News\NewsCategory as NewsCategoryModel; |
| 10 | use App\Models\Product\Product; | 10 | use App\Models\Product\Product; |
| 11 | use App\Models\RouteMap\RouteMap; | 11 | use App\Models\RouteMap\RouteMap; |
| 12 | +use App\Models\Template\BTemplate; | ||
| 12 | use Illuminate\Support\Facades\DB; | 13 | use Illuminate\Support\Facades\DB; |
| 13 | 14 | ||
| 14 | class NewsCategoryLogic extends BaseLogic | 15 | class NewsCategoryLogic extends BaseLogic |
| @@ -268,4 +269,70 @@ class NewsCategoryLogic extends BaseLogic | @@ -268,4 +269,70 @@ class NewsCategoryLogic extends BaseLogic | ||
| 268 | } | 269 | } |
| 269 | return $this->success(); | 270 | return $this->success(); |
| 270 | } | 271 | } |
| 272 | + | ||
| 273 | + /** | ||
| 274 | + * @remark :复制新闻分类 | ||
| 275 | + * @name :copyCategory | ||
| 276 | + * @author :lyh | ||
| 277 | + * @method :post | ||
| 278 | + * @time :2024/5/9 9:16 | ||
| 279 | + */ | ||
| 280 | + public function copyCategory(){ | ||
| 281 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 282 | + $param = [ | ||
| 283 | + 'name'=>$info['name']."-copy", | ||
| 284 | + 'status'=>0, | ||
| 285 | + 'sort'=>$info['sort'], | ||
| 286 | + 'pid'=>0, | ||
| 287 | + 'remark'=>$info['remark'], | ||
| 288 | + 'alias'=>$info['alias'], | ||
| 289 | + 'project_id'=>$info['project_id'], | ||
| 290 | + 'operator_id'=>$this->user['id'], | ||
| 291 | + 'create_id'=>$this->user['id'], | ||
| 292 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 293 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 294 | + ]; | ||
| 295 | + $save_id = $this->model->insertGetId($param); | ||
| 296 | + $route = RouteMap::setRoute($param['alias'], RouteMap::SOURCE_NEWS_CATE, $save_id, $this->user['project_id']); | ||
| 297 | + $this->model->edit(['alias'=>$route],['id'=>$save_id]); | ||
| 298 | + //同步可视化装修数据 | ||
| 299 | + $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | ||
| 300 | + return $this->success(['id'=>$save_id]); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + /** | ||
| 304 | + * @remark :同步模版数据 | ||
| 305 | + * @name :copyTemplate | ||
| 306 | + * @author :lyh | ||
| 307 | + * @method :post | ||
| 308 | + * @time :2023/7/29 15:53 | ||
| 309 | + */ | ||
| 310 | + public function copyTemplate($id,$project_id,$save_id){ | ||
| 311 | + $BTemplateModel = new BTemplate(); | ||
| 312 | + $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_NEWS,'is_list'=>BTemplate::IS_LIST,'is_custom'=>BTemplate::IS_NO_CUSTOM,'source_id'=>$id,'project_id'=>$project_id]); | ||
| 313 | + if(!empty($list)){ | ||
| 314 | + $data = []; | ||
| 315 | + foreach ($list as $v){ | ||
| 316 | + $data[] = [ | ||
| 317 | + 'html'=>$v['html'], | ||
| 318 | + 'project_id'=>$v['project_id'], | ||
| 319 | + 'source'=>$v['source'], | ||
| 320 | + 'source_id'=>$save_id, | ||
| 321 | + 'template_id'=>$v['template_id'], | ||
| 322 | + 'section_list_id'=>$v['section_list_id'], | ||
| 323 | + 'main_html'=>$v['main_html'], | ||
| 324 | + 'main_css'=>$v['main_css'], | ||
| 325 | + 'is_list'=>$v['is_list'], | ||
| 326 | + 'type'=>$v['type'], | ||
| 327 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 328 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 329 | + ]; | ||
| 330 | + } | ||
| 331 | + $rs = $BTemplateModel->insert($data); | ||
| 332 | + if($rs === false){ | ||
| 333 | + $this->fail('error'); | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + return $this->success(); | ||
| 337 | + } | ||
| 271 | } | 338 | } |
| @@ -467,7 +467,7 @@ class NewsLogic extends BaseLogic | @@ -467,7 +467,7 @@ class NewsLogic extends BaseLogic | ||
| 467 | $info = $this->model->read(['id'=>$this->param['id']]); | 467 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 468 | $param = [ | 468 | $param = [ |
| 469 | 'name'=>$info['name']."-copy", | 469 | 'name'=>$info['name']."-copy", |
| 470 | - 'status'=>$info['status'], | 470 | + 'status'=>0, |
| 471 | 'sort'=>$info['sort'], | 471 | 'sort'=>$info['sort'], |
| 472 | 'category_id'=>$info['category_id'], | 472 | 'category_id'=>$info['category_id'], |
| 473 | 'text'=>$info['text'], | 473 | 'text'=>$info['text'], |
| @@ -497,19 +497,20 @@ class NewsLogic extends BaseLogic | @@ -497,19 +497,20 @@ class NewsLogic extends BaseLogic | ||
| 497 | */ | 497 | */ |
| 498 | public function copyTemplate($id,$project_id,$save_id){ | 498 | public function copyTemplate($id,$project_id,$save_id){ |
| 499 | $BTemplateModel = new BTemplate(); | 499 | $BTemplateModel = new BTemplate(); |
| 500 | - $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_NEWS,'source_id'=>$id,'project_id'=>$project_id]); | 500 | + $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_NEWS,'is_list'=>BTemplate::IS_DETAIL,'is_custom'=>BTemplate::IS_NO_CUSTOM,'source_id'=>$id,'project_id'=>$project_id]); |
| 501 | if(!empty($list)){ | 501 | if(!empty($list)){ |
| 502 | $data = []; | 502 | $data = []; |
| 503 | foreach ($list as $v){ | 503 | foreach ($list as $v){ |
| 504 | $data[] = [ | 504 | $data[] = [ |
| 505 | 'html'=>$v['html'], | 505 | 'html'=>$v['html'], |
| 506 | - 'project_id'=>$project_id, | 506 | + 'project_id'=>$v['project_id'], |
| 507 | 'source'=>$v['source'], | 507 | 'source'=>$v['source'], |
| 508 | 'source_id'=>$save_id, | 508 | 'source_id'=>$save_id, |
| 509 | 'template_id'=>$v['template_id'], | 509 | 'template_id'=>$v['template_id'], |
| 510 | 'section_list_id'=>$v['section_list_id'], | 510 | 'section_list_id'=>$v['section_list_id'], |
| 511 | 'main_html'=>$v['main_html'], | 511 | 'main_html'=>$v['main_html'], |
| 512 | 'main_css'=>$v['main_css'], | 512 | 'main_css'=>$v['main_css'], |
| 513 | + 'type'=>$v['type'], | ||
| 513 | 'created_at'=>date('Y-m-d H:i:s'), | 514 | 'created_at'=>date('Y-m-d H:i:s'), |
| 514 | 'updated_at'=>date('Y-m-d H:i:s'), | 515 | 'updated_at'=>date('Y-m-d H:i:s'), |
| 515 | ]; | 516 | ]; |
| @@ -9,6 +9,7 @@ use App\Models\Product\Category; | @@ -9,6 +9,7 @@ use App\Models\Product\Category; | ||
| 9 | use App\Models\Product\CategoryRelated; | 9 | use App\Models\Product\CategoryRelated; |
| 10 | use App\Models\Product\Product; | 10 | use App\Models\Product\Product; |
| 11 | use App\Models\RouteMap\RouteMap; | 11 | use App\Models\RouteMap\RouteMap; |
| 12 | +use App\Models\Template\BTemplate; | ||
| 12 | use Illuminate\Support\Facades\DB; | 13 | use Illuminate\Support\Facades\DB; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| @@ -285,4 +286,83 @@ class CategoryLogic extends BaseLogic | @@ -285,4 +286,83 @@ class CategoryLogic extends BaseLogic | ||
| 285 | } | 286 | } |
| 286 | return $this->success(); | 287 | return $this->success(); |
| 287 | } | 288 | } |
| 289 | + | ||
| 290 | + /** | ||
| 291 | + * @remark :复制 | ||
| 292 | + * @name :copyCategoryInfo | ||
| 293 | + * @author :lyh | ||
| 294 | + * @method :post | ||
| 295 | + * @time :2024/5/8 17:51 | ||
| 296 | + */ | ||
| 297 | + public function copyCategoryInfo(){ | ||
| 298 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 299 | + if($info === false){ | ||
| 300 | + $this->fail('当前数据不存在或者已被删除'); | ||
| 301 | + } | ||
| 302 | + $param = [ | ||
| 303 | + 'project_id'=>$info['project_id'], | ||
| 304 | + 'title'=>$info['title']."-copy", | ||
| 305 | + 'pid'=>0, | ||
| 306 | + 'sort'=>$info['sort'], | ||
| 307 | + 'image'=>$info['image'], | ||
| 308 | + 'route'=>$info['route'], | ||
| 309 | + 'keywords'=>$info['keywords'], | ||
| 310 | + 'describe'=>$info['describe'], | ||
| 311 | + 'describe_image'=>$info['describe_image'], | ||
| 312 | + ]; | ||
| 313 | + $save_id = $this->model->addReturnId($param); | ||
| 314 | + $route = RouteMap::setRoute($param['route'], RouteMap::SOURCE_PRODUCT_CATE, $save_id, $this->user['project_id']); | ||
| 315 | + $this->model->edit(['route'=>$route],['id'=>$route]); | ||
| 316 | + //同步可视化装修数据 | ||
| 317 | + $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | ||
| 318 | + return $this->success(); | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + /** | ||
| 322 | + * @remark :同步模版数据 | ||
| 323 | + * @name :copyTemplate | ||
| 324 | + * @author :lyh | ||
| 325 | + * @method :post | ||
| 326 | + * @time :2023/7/29 15:53 | ||
| 327 | + */ | ||
| 328 | + public function copyTemplate($id,$project_id,$save_id){ | ||
| 329 | + $BTemplateModel = new BTemplate(); | ||
| 330 | + $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_PRODUCT,'is_list'=>BTemplate::IS_LIST,'is_custom'=>BTemplate::IS_NO_CUSTOM,'source_id'=>$id,'project_id'=>$project_id]); | ||
| 331 | + if(!empty($list)){ | ||
| 332 | + $data = []; | ||
| 333 | + foreach ($list as $v){ | ||
| 334 | + $data[] = $this->setTemplateParams($v,$save_id); | ||
| 335 | + } | ||
| 336 | + $rs = $BTemplateModel->insert($data); | ||
| 337 | + if($rs === false){ | ||
| 338 | + $this->fail('error'); | ||
| 339 | + } | ||
| 340 | + } | ||
| 341 | + return $this->success(); | ||
| 342 | + } | ||
| 343 | + | ||
| 344 | + /** | ||
| 345 | + * @remark :组装模版数据 | ||
| 346 | + * @name :setTemplateParams | ||
| 347 | + * @author :lyh | ||
| 348 | + * @method :post | ||
| 349 | + * @time :2023/7/29 15:54 | ||
| 350 | + */ | ||
| 351 | + public function setTemplateParams($v,$save_id){ | ||
| 352 | + $param = [ | ||
| 353 | + 'html'=>$v['html'], | ||
| 354 | + 'project_id'=>$v['project_id'], | ||
| 355 | + 'source'=>$v['source'], | ||
| 356 | + 'source_id'=>$save_id, | ||
| 357 | + 'template_id'=>$v['template_id'], | ||
| 358 | + 'section_list_id'=>$v['section_list_id'], | ||
| 359 | + 'main_html'=>$v['main_html'], | ||
| 360 | + 'main_css'=>$v['main_css'], | ||
| 361 | + 'is_list'=>$v['is_list'], | ||
| 362 | + 'type'=>$v['type'], | ||
| 363 | + 'created_at'=>$v['created_at'], | ||
| 364 | + 'updated_at'=>$v['updated_at'] | ||
| 365 | + ]; | ||
| 366 | + return $this->success($param); | ||
| 367 | + } | ||
| 288 | } | 368 | } |
| @@ -446,10 +446,10 @@ class ProductLogic extends BaseLogic | @@ -446,10 +446,10 @@ class ProductLogic extends BaseLogic | ||
| 446 | */ | 446 | */ |
| 447 | public function copyTemplate($id,$project_id,$save_id){ | 447 | public function copyTemplate($id,$project_id,$save_id){ |
| 448 | $BTemplateModel = new BTemplate(); | 448 | $BTemplateModel = new BTemplate(); |
| 449 | - $list = $BTemplateModel->list(['source'=>2,'source_id'=>$id,'project_id'=>$project_id]); | 449 | + $list = $BTemplateModel->list(['source'=>BTemplate::SOURCE_PRODUCT,'is_list'=>BTemplate::IS_DETAIL,'is_custom'=>BTemplate::IS_NO_CUSTOM,'source_id'=>$id,'project_id'=>$project_id]); |
| 450 | if(!empty($list)){ | 450 | if(!empty($list)){ |
| 451 | $data = []; | 451 | $data = []; |
| 452 | - foreach ($list as $k => $v){ | 452 | + foreach ($list as $v){ |
| 453 | $data[] = $this->setTemplateParams($v,$project_id,$save_id); | 453 | $data[] = $this->setTemplateParams($v,$project_id,$save_id); |
| 454 | } | 454 | } |
| 455 | $rs = $BTemplateModel->insert($data); | 455 | $rs = $BTemplateModel->insert($data); |
| @@ -477,6 +477,9 @@ class ProductLogic extends BaseLogic | @@ -477,6 +477,9 @@ class ProductLogic extends BaseLogic | ||
| 477 | 'section_list_id'=>$v['section_list_id'], | 477 | 'section_list_id'=>$v['section_list_id'], |
| 478 | 'main_html'=>$v['main_html'], | 478 | 'main_html'=>$v['main_html'], |
| 479 | 'main_css'=>$v['main_css'], | 479 | 'main_css'=>$v['main_css'], |
| 480 | + 'type'=>$v['type'], | ||
| 481 | + 'is_list'=>$v['is_list'], | ||
| 482 | + 'is_custom'=>$v['is_custom'], | ||
| 480 | 'created_at'=>$v['created_at'], | 483 | 'created_at'=>$v['created_at'], |
| 481 | 'updated_at'=>$v['updated_at'] | 484 | 'updated_at'=>$v['updated_at'] |
| 482 | ]; | 485 | ]; |
| @@ -159,8 +159,7 @@ class UserLoginLogic | @@ -159,8 +159,7 @@ class UserLoginLogic | ||
| 159 | $info['hagro'] = $project['hagro'] ?? ''; | 159 | $info['hagro'] = $project['hagro'] ?? ''; |
| 160 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; | 160 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; |
| 161 | $info['test_domain'] = $project['deploy_build']['test_domain'] ?? ''; | 161 | $info['test_domain'] = $project['deploy_build']['test_domain'] ?? ''; |
| 162 | - $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | ||
| 163 | - ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); | 162 | + $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); |
| 164 | $info['is_customized'] = $project['is_customized']; | 163 | $info['is_customized'] = $project['is_customized']; |
| 165 | $info['is_upload_manage'] = $project['is_upload_manage']; | 164 | $info['is_upload_manage'] = $project['is_upload_manage']; |
| 166 | $info['is_upgrade'] = $project['is_upgrade']; | 165 | $info['is_upgrade'] = $project['is_upgrade']; |
| @@ -261,8 +260,7 @@ class UserLoginLogic | @@ -261,8 +260,7 @@ class UserLoginLogic | ||
| 261 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; | 260 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; |
| 262 | $info['is_domain'] = empty($project['deploy_optimize']['domain']) ? 0 : 1; | 261 | $info['is_domain'] = empty($project['deploy_optimize']['domain']) ? 0 : 1; |
| 263 | $info['test_domain'] = $project['deploy_build']['test_domain'] ?? ''; | 262 | $info['test_domain'] = $project['deploy_build']['test_domain'] ?? ''; |
| 264 | - $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | ||
| 265 | - ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); | 263 | + $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); |
| 266 | $info['is_customized'] = $project['is_customized']; | 264 | $info['is_customized'] = $project['is_customized']; |
| 267 | $info['is_upgrade'] = $project['is_upgrade']; | 265 | $info['is_upgrade'] = $project['is_upgrade']; |
| 268 | $info['is_upload_manage'] = $project['is_upload_manage']; | 266 | $info['is_upload_manage'] = $project['is_upload_manage']; |
| @@ -78,6 +78,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -78,6 +78,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 78 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'save'])->name('news_category_edit'); | 78 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'save'])->name('news_category_edit'); |
| 79 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); | 79 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); |
| 80 | Route::any('/category/allSort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'allSort'])->name('news_category_allSort'); | 80 | Route::any('/category/allSort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'allSort'])->name('news_category_allSort'); |
| 81 | + Route::any('/category/copyCategory', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'copyCategory'])->name('news_category_copyCategory'); | ||
| 81 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); | 82 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); |
| 82 | Route::any('/category/sort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'sort'])->name('news_category_sort'); | 83 | Route::any('/category/sort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'sort'])->name('news_category_sort'); |
| 83 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList'); | 84 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList'); |
| @@ -197,6 +198,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -197,6 +198,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 197 | //新版翻译校队 | 198 | //新版翻译校队 |
| 198 | Route::prefix('translate_check')->group(function () {//languageList | 199 | Route::prefix('translate_check')->group(function () {//languageList |
| 199 | Route::any('/', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'lists'])->name('translate_check_lists'); | 200 | Route::any('/', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'lists'])->name('translate_check_lists'); |
| 201 | + Route::any('/getLanguageList', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'getLanguageList'])->name('translate_getLanguageList'); | ||
| 200 | Route::any('/imageList', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'imageList'])->name('translate_checkg_imageList'); | 202 | Route::any('/imageList', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'imageList'])->name('translate_checkg_imageList'); |
| 201 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'save'])->name('translate_check_save'); | 203 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'save'])->name('translate_check_save'); |
| 202 | Route::any('/getUrl', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'getUrl'])->name('translate_check_getUrl'); | 204 | Route::any('/getUrl', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'getUrl'])->name('translate_check_getUrl'); |
-
请 注册 或 登录 后发表评论