Merge remote-tracking branch 'origin/master' into akun
正在显示
21 个修改的文件
包含
175 行增加
和
53 行删除
| @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | ||
| 33 | protected $description = '升级项目统计'; | 33 | protected $description = '升级项目统计'; |
| 34 | 34 | ||
| 35 | public function handle(){ | 35 | public function handle(){ |
| 36 | - $project_id = 450; | 36 | + $project_id = 759; |
| 37 | ProjectServer::useProject($project_id); | 37 | ProjectServer::useProject($project_id); |
| 38 | $this->count($project_id); | 38 | $this->count($project_id); |
| 39 | DB::disconnect('custom_mysql'); | 39 | DB::disconnect('custom_mysql'); |
| @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command | @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command | ||
| 36 | protected $description = '升级项目统计'; | 36 | protected $description = '升级项目统计'; |
| 37 | 37 | ||
| 38 | public function handle(){ | 38 | public function handle(){ |
| 39 | - $project_id = 450; | 39 | + $project_id = 759; |
| 40 | $oldModel = new UpdateOldInfo(); | 40 | $oldModel = new UpdateOldInfo(); |
| 41 | $info = $oldModel->read(['project_id'=>$project_id]); | 41 | $info = $oldModel->read(['project_id'=>$project_id]); |
| 42 | $url = $info['old_domain_online']; | 42 | $url = $info['old_domain_online']; |
| @@ -50,14 +50,21 @@ class RankDataTask extends Command | @@ -50,14 +50,21 @@ class RankDataTask extends Command | ||
| 50 | public function handle() | 50 | public function handle() |
| 51 | { | 51 | { |
| 52 | $list = NoticeLog::where('type', NoticeLog::TYPE_RANK_DATA)->where('status', NoticeLog::STATUS_PENDING)->get(); | 52 | $list = NoticeLog::where('type', NoticeLog::TYPE_RANK_DATA)->where('status', NoticeLog::STATUS_PENDING)->get(); |
| 53 | - foreach ($list as $item){ | 53 | + foreach ($list as $item) { |
| 54 | echo 'start:' . $item['id'] . PHP_EOL; | 54 | echo 'start:' . $item['id'] . PHP_EOL; |
| 55 | - try { | 55 | + $error_msg = []; |
| 56 | $rankDataLogic = new RankDataLogic(); | 56 | $rankDataLogic = new RankDataLogic(); |
| 57 | + try { | ||
| 57 | //排名数据 | 58 | //排名数据 |
| 58 | $api = new QuanqiusouApi(); | 59 | $api = new QuanqiusouApi(); |
| 59 | $site_res = $api->getSiteRes(); | 60 | $site_res = $api->getSiteRes(); |
| 60 | $rankDataLogic->syncRankData($item['data']['api_no'], $site_res, true); | 61 | $rankDataLogic->syncRankData($item['data']['api_no'], $site_res, true); |
| 62 | + } catch (\Exception $e) { | ||
| 63 | + Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray()); | ||
| 64 | + $error_msg[] = $e->getMessage(); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + try { | ||
| 61 | //外链数据 | 68 | //外链数据 |
| 62 | $rankDataLogic->syncExternalLinks($item['data']['api_no'], true); | 69 | $rankDataLogic->syncExternalLinks($item['data']['api_no'], true); |
| 63 | //外链引荐域名 | 70 | //外链引荐域名 |
| @@ -70,10 +77,14 @@ class RankDataTask extends Command | @@ -70,10 +77,14 @@ class RankDataTask extends Command | ||
| 70 | $item->status = NoticeLog::STATUS_SUCCESS; | 77 | $item->status = NoticeLog::STATUS_SUCCESS; |
| 71 | $item->save(); | 78 | $item->save(); |
| 72 | echo 'success:' . $item['id'] . PHP_EOL; | 79 | echo 'success:' . $item['id'] . PHP_EOL; |
| 73 | - }catch (\Exception $e){ | 80 | + } catch (\Exception $e){ |
| 74 | echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; | 81 | echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; |
| 75 | - Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item); | ||
| 76 | - $this->retry($item, $e->getMessage()); | 82 | + Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray()); |
| 83 | + $error_msg[] = $e->getMessage(); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + if($error_msg){ | ||
| 87 | + $this->retry($item, implode(',', $error_msg)); | ||
| 77 | } | 88 | } |
| 78 | } | 89 | } |
| 79 | } | 90 | } |
| @@ -94,9 +94,8 @@ class UpdateProductCategory extends Command | @@ -94,9 +94,8 @@ class UpdateProductCategory extends Command | ||
| 94 | if(!empty($cate_arr) && is_array($cate_arr)){ | 94 | if(!empty($cate_arr) && is_array($cate_arr)){ |
| 95 | foreach ($cate_arr as $v){ | 95 | foreach ($cate_arr as $v){ |
| 96 | $categoryModel = new Category(); | 96 | $categoryModel = new Category(); |
| 97 | - $info = $categoryModel->read(['pid'=>$v],['id']); | ||
| 98 | - if($info !== false){ | ||
| 99 | - //有下级时,跳过 | 97 | + $info = $categoryModel->read(['id'=>$v],['id']); |
| 98 | + if($info === false){ | ||
| 100 | continue; | 99 | continue; |
| 101 | }else{ | 100 | }else{ |
| 102 | //更新关联表 | 101 | //更新关联表 |
| @@ -12,6 +12,7 @@ use App\Models\ASide\APublicModel; | @@ -12,6 +12,7 @@ use App\Models\ASide\APublicModel; | ||
| 12 | use App\Models\Channel\Channel; | 12 | use App\Models\Channel\Channel; |
| 13 | use App\Models\Domain\DomainInfo; | 13 | use App\Models\Domain\DomainInfo; |
| 14 | use App\Models\Manage\Manage; | 14 | use App\Models\Manage\Manage; |
| 15 | +use App\Models\Manage\ManageHr; | ||
| 15 | use App\Models\Project\OnlineCheck; | 16 | use App\Models\Project\OnlineCheck; |
| 16 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 17 | use App\Models\RankData\RankData; | 18 | use App\Models\RankData\RankData; |
| @@ -88,7 +89,7 @@ class OptimizeController extends BaseController | @@ -88,7 +89,7 @@ class OptimizeController extends BaseController | ||
| 88 | if($item['type'] != Project::TYPE_ZERO){ | 89 | if($item['type'] != Project::TYPE_ZERO){ |
| 89 | $data = APublicModel::getNumByProjectId($item['id']); | 90 | $data = APublicModel::getNumByProjectId($item['id']); |
| 90 | } | 91 | } |
| 91 | - $manageModel = new Manage(); | 92 | + $manageModel = new ManageHr(); |
| 92 | $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0); | 93 | $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0); |
| 93 | $item['build_leader'] = $manageModel->getName($item['leader_mid']); | 94 | $item['build_leader'] = $manageModel->getName($item['leader_mid']); |
| 94 | $item['build_manager'] = $manageModel->getName($item['manager_mid']); | 95 | $item['build_manager'] = $manageModel->getName($item['manager_mid']); |
| @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController; | @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController; | ||
| 7 | use App\Http\Logic\Aside\Template\ATemplateLogic; | 7 | use App\Http\Logic\Aside\Template\ATemplateLogic; |
| 8 | use App\Http\Logic\Aside\Template\ATemplateModuleLogic; | 8 | use App\Http\Logic\Aside\Template\ATemplateModuleLogic; |
| 9 | use App\Http\Requests\Aside\Template\ATemplateModuleRequest; | 9 | use App\Http\Requests\Aside\Template\ATemplateModuleRequest; |
| 10 | +use App\Models\Project\Project; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * @remark :左侧模块管理 | 13 | * @remark :左侧模块管理 |
| @@ -79,5 +80,20 @@ class ATemplateModuleController extends BaseController | @@ -79,5 +80,20 @@ class ATemplateModuleController extends BaseController | ||
| 79 | $this->response('success'); | 80 | $this->response('success'); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | - | 83 | + /** |
| 84 | + * @remark :添加私有模块时获取项目列表 | ||
| 85 | + * @name :getProjectList | ||
| 86 | + * @author :lyh | ||
| 87 | + * @method :post | ||
| 88 | + * @time :2024/1/15 10:18 | ||
| 89 | + */ | ||
| 90 | + public function getProjectList(Project $project){ | ||
| 91 | + $this->map['type'] = ['!=',0]; | ||
| 92 | + $this->map['delete_status'] = 0; | ||
| 93 | + if(isset($this->map['title']) && !empty($this->map['title'])){ | ||
| 94 | + $this->map['title'] = ['like','%'.$this->map['title'].'%']; | ||
| 95 | + } | ||
| 96 | + $list = $project->list($this->map,'id',['id','title']); | ||
| 97 | + $this->response('success',Code::SUCCESS,$list); | ||
| 98 | + } | ||
| 83 | } | 99 | } |
| @@ -238,14 +238,15 @@ class BaseController extends Controller | @@ -238,14 +238,15 @@ class BaseController extends Controller | ||
| 238 | * @method :post | 238 | * @method :post |
| 239 | * @time :2023/9/13 14:02 | 239 | * @time :2023/9/13 14:02 |
| 240 | */ | 240 | */ |
| 241 | - public function getIsRenovation($source,$is_list,$template_id,$id){ | 241 | + public function getIsRenovation($source,$is_list,$template_id,$id,$is_custom = 0){ |
| 242 | $webTemplateModel = new BTemplate(); | 242 | $webTemplateModel = new BTemplate(); |
| 243 | $param = [ | 243 | $param = [ |
| 244 | 'source'=>$source, | 244 | 'source'=>$source, |
| 245 | 'project_id'=>$this->user['project_id'], | 245 | 'project_id'=>$this->user['project_id'], |
| 246 | 'source_id'=>$id, | 246 | 'source_id'=>$id, |
| 247 | 'template_id'=>$template_id, | 247 | 'template_id'=>$template_id, |
| 248 | - 'is_list'=>$is_list | 248 | + 'is_list'=>$is_list, |
| 249 | + 'is_custom'=>$is_custom | ||
| 249 | ]; | 250 | ]; |
| 250 | $templateInfo = $webTemplateModel->read($param); | 251 | $templateInfo = $webTemplateModel->read($param); |
| 251 | if($templateInfo !== false){ | 252 | if($templateInfo !== false){ |
| @@ -176,9 +176,8 @@ class BlogController extends BaseController | @@ -176,9 +176,8 @@ class BlogController extends BaseController | ||
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | /** | 178 | /** |
| 179 | - * @name :获取当前博客详情 | ||
| 180 | - * @author :liyuhang | ||
| 181 | - * @method | 179 | + * 获取当前博客详情 |
| 180 | + * @param BlogLogic $blogLogic | ||
| 182 | */ | 181 | */ |
| 183 | public function info(BlogLogic $blogLogic){ | 182 | public function info(BlogLogic $blogLogic){ |
| 184 | $this->request->validate([ | 183 | $this->request->validate([ |
| @@ -187,15 +186,17 @@ class BlogController extends BaseController | @@ -187,15 +186,17 @@ class BlogController extends BaseController | ||
| 187 | 'id.required' => 'ID不能为空' | 186 | 'id.required' => 'ID不能为空' |
| 188 | ]); | 187 | ]); |
| 189 | $info = $blogLogic->blogInfo(); | 188 | $info = $blogLogic->blogInfo(); |
| 189 | + | ||
| 190 | + $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL); | ||
| 191 | + $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id, $info['id']); | ||
| 192 | + | ||
| 190 | $this->response('success',Code::SUCCESS,$info); | 193 | $this->response('success',Code::SUCCESS,$info); |
| 191 | } | 194 | } |
| 192 | 195 | ||
| 193 | /** | 196 | /** |
| 194 | - * @remark :保存数据 | ||
| 195 | - * @name :save | ||
| 196 | - * @author :lyh | ||
| 197 | - * @method :post | ||
| 198 | - * @time :2023/9/7 13:40 | 197 | + * 保存数据 |
| 198 | + * @param BlogRequest $request | ||
| 199 | + * @param BlogLogic $blogLogic | ||
| 199 | */ | 200 | */ |
| 200 | public function save(BlogRequest $request,BlogLogic $blogLogic){ | 201 | public function save(BlogRequest $request,BlogLogic $blogLogic){ |
| 201 | $request->validated(); | 202 | $request->validated(); |
| @@ -154,18 +154,19 @@ class NewsController extends BaseController | @@ -154,18 +154,19 @@ class NewsController extends BaseController | ||
| 154 | 154 | ||
| 155 | 155 | ||
| 156 | /** | 156 | /** |
| 157 | - * @name :添加新闻时获取分类列表 | ||
| 158 | - * @author :liyuhang | ||
| 159 | - * @method | 157 | + * 添加新闻时获取分类列表 |
| 158 | + * @param NewsLogic $newsLogic | ||
| 159 | + * @throws \App\Exceptions\BsideGlobalException | ||
| 160 | */ | 160 | */ |
| 161 | public function get_category_list(NewsLogic $newsLogic){ | 161 | public function get_category_list(NewsLogic $newsLogic){ |
| 162 | $list = $newsLogic->news_get_category_list(); | 162 | $list = $newsLogic->news_get_category_list(); |
| 163 | $this->response('success',Code::SUCCESS,$list); | 163 | $this->response('success',Code::SUCCESS,$list); |
| 164 | } | 164 | } |
| 165 | + | ||
| 165 | /** | 166 | /** |
| 166 | - * @name :获取详情 | ||
| 167 | - * @author :liyuhang | ||
| 168 | - * @method | 167 | + * 获取新闻详情 |
| 168 | + * @param NewsLogic $newsLogic | ||
| 169 | + * @throws \App\Exceptions\BsideGlobalException | ||
| 169 | */ | 170 | */ |
| 170 | public function info(NewsLogic $newsLogic){ | 171 | public function info(NewsLogic $newsLogic){ |
| 171 | $this->request->validate([ | 172 | $this->request->validate([ |
| @@ -174,6 +175,10 @@ class NewsController extends BaseController | @@ -174,6 +175,10 @@ class NewsController extends BaseController | ||
| 174 | 'id.required' => 'ID不能为空', | 175 | 'id.required' => 'ID不能为空', |
| 175 | ]); | 176 | ]); |
| 176 | $info = $newsLogic->newsInfo(); | 177 | $info = $newsLogic->newsInfo(); |
| 178 | + | ||
| 179 | + $template_id = $this->getTemplateId(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL);//获取模版id | ||
| 180 | + $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id, $info['id']); | ||
| 181 | + | ||
| 177 | $this->response('success',Code::SUCCESS,$info); | 182 | $this->response('success',Code::SUCCESS,$info); |
| 178 | } | 183 | } |
| 179 | 184 |
| @@ -95,8 +95,8 @@ class KeywordController extends BaseController | @@ -95,8 +95,8 @@ class KeywordController extends BaseController | ||
| 95 | public function save(KeywordRequest $request, KeywordLogic $logic) | 95 | public function save(KeywordRequest $request, KeywordLogic $logic) |
| 96 | { | 96 | { |
| 97 | $request->validated(); | 97 | $request->validated(); |
| 98 | - $logic->keywordSave(); | ||
| 99 | - $this->response('success'); | 98 | + $data = $logic->keywordSave(); |
| 99 | + $this->response('success',Code::SUCCESS,$data); | ||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | /** | 102 | /** |
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Setting; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Setting; | ||
| 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\Setting\TranslateLogic; | 14 | use App\Http\Logic\Bside\Setting\TranslateLogic; |
| 15 | +use App\Models\RouteMap\RouteMap; | ||
| 15 | use App\Models\WebSetting\WebLanguage; | 16 | use App\Models\WebSetting\WebLanguage; |
| 16 | 17 | ||
| 17 | class TranslateController extends BaseController | 18 | class TranslateController extends BaseController |
| @@ -80,4 +81,46 @@ class TranslateController extends BaseController | @@ -80,4 +81,46 @@ class TranslateController extends BaseController | ||
| 80 | $logic->translateSave(); | 81 | $logic->translateSave(); |
| 81 | $this->response('success'); | 82 | $this->response('success'); |
| 82 | } | 83 | } |
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * @remark :获取所有路由 | ||
| 87 | + * @name :getUrl | ||
| 88 | + * @author :lyh | ||
| 89 | + * @method :post | ||
| 90 | + * @time :2024/1/12 14:34 | ||
| 91 | + */ | ||
| 92 | + public function getUrl(){ | ||
| 93 | + $data = []; | ||
| 94 | + $routeMapModel = new RouteMap(); | ||
| 95 | + $list = $routeMapModel->list(); | ||
| 96 | + foreach ($list as $k => $v){ | ||
| 97 | + switch ($v['source']){ | ||
| 98 | + case RouteMap::SOURCE_INDEX: | ||
| 99 | + $data[] = $this->user['domain']; | ||
| 100 | + break; | ||
| 101 | + case RouteMap::SOURCE_PRODUCT: | ||
| 102 | + $data[] = $this->user['domain'].$v['route'].'/'; | ||
| 103 | + break; | ||
| 104 | + case RouteMap::SOURCE_PRODUCT_CATE: | ||
| 105 | + //todo::查看当前有好多页 | ||
| 106 | + $data[] = $this->user['domain'].$v['route'].'/'; | ||
| 107 | + break; | ||
| 108 | + case RouteMap::SOURCE_BLOG: | ||
| 109 | + $data[] = $this->user['domain'].$v['path'].'/'.$v['route'].'/'; | ||
| 110 | + break; | ||
| 111 | + case RouteMap::SOURCE_BLOG_CATE: | ||
| 112 | + $data[] = $this->user['domain'].RouteMap::PATH_BLOG_CATE.'/'.$v['route'].'/'; | ||
| 113 | + break; | ||
| 114 | + case RouteMap::SOURCE_NEWS: | ||
| 115 | + $data[] = $this->user['domain'].$v['path'].'/'.$v['route'].'/'; | ||
| 116 | + break; | ||
| 117 | + case RouteMap::SOURCE_BLOG_CATE: | ||
| 118 | + $data[] = $this->user['domain'].RouteMap::PATH_NEWS_CATE.'/'.$v['route'].'/'; | ||
| 119 | + break; | ||
| 120 | + default: | ||
| 121 | + $data[] = $this->user['domain'].$v['route'].'/'; | ||
| 122 | + break; | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + } | ||
| 83 | } | 126 | } |
| @@ -26,6 +26,7 @@ class BTemplateModuleController extends BaseController | @@ -26,6 +26,7 @@ class BTemplateModuleController extends BaseController | ||
| 26 | public function lists(BTemplateModuleLogic $bTemplateModuleLogic,BTemplateModuleProjectLogic $bTemplateModuleProjectLogic){ | 26 | public function lists(BTemplateModuleLogic $bTemplateModuleLogic,BTemplateModuleProjectLogic $bTemplateModuleProjectLogic){ |
| 27 | if(!isset($this->map['test_model'])){ | 27 | if(!isset($this->map['test_model'])){ |
| 28 | $this->map['test_model'] = ['in',[0,1]]; | 28 | $this->map['test_model'] = ['in',[0,1]]; |
| 29 | + $this->map['project_id'] = 0; | ||
| 29 | } | 30 | } |
| 30 | $data = []; | 31 | $data = []; |
| 31 | $list = $bTemplateModuleLogic->ModuleList($this->map,$this->order); | 32 | $list = $bTemplateModuleLogic->ModuleList($this->map,$this->order); |
| @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | @@ -13,6 +13,7 @@ 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\BTemplateModuleProjectLogic; | 14 | use App\Http\Logic\Bside\BTemplate\BTemplateModuleProjectLogic; |
| 15 | use App\Models\Template\BModuleProject; | 15 | use App\Models\Template\BModuleProject; |
| 16 | +use App\Models\Template\TemplateModule; | ||
| 16 | 17 | ||
| 17 | class BTemplateModuleProjectController extends BaseController | 18 | class BTemplateModuleProjectController extends BaseController |
| 18 | { | 19 | { |
| @@ -23,8 +24,10 @@ class BTemplateModuleProjectController extends BaseController | @@ -23,8 +24,10 @@ class BTemplateModuleProjectController extends BaseController | ||
| 23 | * @method :post | 24 | * @method :post |
| 24 | * @time :2023/11/14 14:34 | 25 | * @time :2023/11/14 14:34 |
| 25 | */ | 26 | */ |
| 26 | - public function lists(BModuleProject $BModuleProject){ | ||
| 27 | - $list = $BModuleProject->list($this->map); | 27 | + public function lists(TemplateModule $templateModule){ |
| 28 | + $this->map['project_id'] = $this->user['project_id']; | ||
| 29 | + $this->map['type'] = 99;//私有模块类型 | ||
| 30 | + $list = $templateModule->list($this->map); | ||
| 28 | $this->response('success',Code::SUCCESS,$list); | 31 | $this->response('success',Code::SUCCESS,$list); |
| 29 | } | 32 | } |
| 30 | 33 |
| @@ -11,13 +11,14 @@ namespace App\Http\Logic\Bside\BTemplate; | @@ -11,13 +11,14 @@ namespace App\Http\Logic\Bside\BTemplate; | ||
| 11 | 11 | ||
| 12 | use App\Http\Logic\Bside\BaseLogic; | 12 | use App\Http\Logic\Bside\BaseLogic; |
| 13 | use App\Models\Template\BModuleProject; | 13 | use App\Models\Template\BModuleProject; |
| 14 | +use App\Models\Template\TemplateModule; | ||
| 14 | 15 | ||
| 15 | class BTemplateModuleProjectLogic extends BaseLogic | 16 | class BTemplateModuleProjectLogic extends BaseLogic |
| 16 | { | 17 | { |
| 17 | public function __construct() | 18 | public function __construct() |
| 18 | { | 19 | { |
| 19 | parent::__construct(); | 20 | parent::__construct(); |
| 20 | - $this->model = new BModuleProject(); | 21 | + $this->model = new TemplateModule(); |
| 21 | $this->param = $this->requestAll; | 22 | $this->param = $this->requestAll; |
| 22 | } | 23 | } |
| 23 | 24 | ||
| @@ -28,8 +29,9 @@ class BTemplateModuleProjectLogic extends BaseLogic | @@ -28,8 +29,9 @@ class BTemplateModuleProjectLogic extends BaseLogic | ||
| 28 | * @method :post | 29 | * @method :post |
| 29 | * @time :2023/6/29 13:35 | 30 | * @time :2023/6/29 13:35 |
| 30 | */ | 31 | */ |
| 31 | - public function ModuleList($map,$order = 'created_at',$filed = ['id','name','sort','status','image','html']){ | ||
| 32 | - $map['status'] = 0; | 32 | + public function ModuleList($map,$order = 'created_at',$filed = ['id','name','status','image','html','project_id']){ |
| 33 | + $map['deleted_status'] = 0; | ||
| 34 | + $map['project_id'] = $this->user['project_id']; | ||
| 33 | $lists = $this->model->list($map,$order,$filed); | 35 | $lists = $this->model->list($map,$order,$filed); |
| 34 | return $this->success($lists); | 36 | return $this->success($lists); |
| 35 | } | 37 | } |
| @@ -97,7 +97,9 @@ class CategoryLogic extends BaseLogic | @@ -97,7 +97,9 @@ class CategoryLogic extends BaseLogic | ||
| 97 | public function getCateInfo($id) | 97 | public function getCateInfo($id) |
| 98 | { | 98 | { |
| 99 | $info = $this->model->read(['id'=>$id]); | 99 | $info = $this->model->read(['id'=>$id]); |
| 100 | - $info['url'] = $info['route']; | 100 | + if($info === false){ |
| 101 | + $this->fail('当前数据不存在或者已被删除'); | ||
| 102 | + } | ||
| 101 | $info['image_link'] = getImageUrl($info['image']); | 103 | $info['image_link'] = getImageUrl($info['image']); |
| 102 | $info['describe_image'] = !empty($info['describe_image']) ? getImageUrl(json_decode($info['describe_image'])) : []; | 104 | $info['describe_image'] = !empty($info['describe_image']) ? getImageUrl(json_decode($info['describe_image'])) : []; |
| 103 | return $this->success($info); | 105 | return $this->success($info); |
| @@ -62,6 +62,7 @@ class KeywordLogic extends BaseLogic | @@ -62,6 +62,7 @@ class KeywordLogic extends BaseLogic | ||
| 62 | //TODO::不能修改路由 | 62 | //TODO::不能修改路由 |
| 63 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 63 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 64 | $route = RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD,$this->param['id'], $this->user['project_id']); | 64 | $route = RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD,$this->param['id'], $this->user['project_id']); |
| 65 | + $data = ['id'=>$this->param['id']]; | ||
| 65 | }else{ | 66 | }else{ |
| 66 | $info = $this->model->read(['title'=>$this->param['title']]); | 67 | $info = $this->model->read(['title'=>$this->param['title']]); |
| 67 | if($info !== false){ | 68 | if($info !== false){ |
| @@ -72,11 +73,12 @@ class KeywordLogic extends BaseLogic | @@ -72,11 +73,12 @@ class KeywordLogic extends BaseLogic | ||
| 72 | //路由映射 | 73 | //路由映射 |
| 73 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); | 74 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); |
| 74 | $this->model->edit(['route'=>$route],['id'=>$id]); | 75 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| 76 | + $data = ['id'=>$id]; | ||
| 75 | } | 77 | } |
| 76 | Common::del_user_cache('product_keyword',$this->user['project_id']); | 78 | Common::del_user_cache('product_keyword',$this->user['project_id']); |
| 77 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route); | 79 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route); |
| 78 | $this->curlDelRoute(['new_route'=>$route]); | 80 | $this->curlDelRoute(['new_route'=>$route]); |
| 79 | - return $this->success(); | 81 | + return $this->success($data); |
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | /** | 84 | /** |
| @@ -46,7 +46,7 @@ class TranslateLogic extends BaseLogic | @@ -46,7 +46,7 @@ class TranslateLogic extends BaseLogic | ||
| 46 | trim($v)=>$translate_list[$k], | 46 | trim($v)=>$translate_list[$k], |
| 47 | ]; | 47 | ]; |
| 48 | } | 48 | } |
| 49 | - return $this->response('success',Code::SUCCESS,$data); | 49 | + return $this->success($data); |
| 50 | } | 50 | } |
| 51 | $old_key = [];//key值组成数据 | 51 | $old_key = [];//key值组成数据 |
| 52 | $data = json_decode($info['data'],true); | 52 | $data = json_decode($info['data'],true); |
| @@ -62,7 +62,7 @@ class TranslateLogic extends BaseLogic | @@ -62,7 +62,7 @@ class TranslateLogic extends BaseLogic | ||
| 62 | ]; | 62 | ]; |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | - $this->response('success',Code::SUCCESS,$data); | 65 | + $this->success($data); |
| 66 | } | 66 | } |
| 67 | /** | 67 | /** |
| 68 | * @remark :获取图片列表 | 68 | * @remark :获取图片列表 |
| @@ -81,7 +81,7 @@ class TranslateLogic extends BaseLogic | @@ -81,7 +81,7 @@ class TranslateLogic extends BaseLogic | ||
| 81 | $v=>$v, | 81 | $v=>$v, |
| 82 | ]; | 82 | ]; |
| 83 | } | 83 | } |
| 84 | - return $this->response('success',Code::SUCCESS,$data); | 84 | + return $this->success($data); |
| 85 | } | 85 | } |
| 86 | $new_list = $this->getUrlImageRead($this->param['url']); | 86 | $new_list = $this->getUrlImageRead($this->param['url']); |
| 87 | $old_list = []; | 87 | $old_list = []; |
| @@ -100,7 +100,7 @@ class TranslateLogic extends BaseLogic | @@ -100,7 +100,7 @@ class TranslateLogic extends BaseLogic | ||
| 100 | ]; | 100 | ]; |
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| 103 | - $this->response('success',Code::SUCCESS,$data); | 103 | + return $this->success($data); |
| 104 | } | 104 | } |
| 105 | /** | 105 | /** |
| 106 | * @remark :获取语种信息 | 106 | * @remark :获取语种信息 |
| @@ -158,6 +158,21 @@ class TranslateLogic extends BaseLogic | @@ -158,6 +158,21 @@ class TranslateLogic extends BaseLogic | ||
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | /** | 160 | /** |
| 161 | + * 翻译校对 dom | ||
| 162 | + */ | ||
| 163 | + public function proofreadPhpQuery($url) | ||
| 164 | + { | ||
| 165 | + $html = file_get_contents($url); | ||
| 166 | + $dom = \phpQuery::newDocument($html); | ||
| 167 | + $dom->find('.change-language')->remove(); | ||
| 168 | + $dom->find('script')->remove(); | ||
| 169 | + $dom->find('style')->remove(); | ||
| 170 | + $test = $dom->text(); | ||
| 171 | + file_put_contents($url, $test); | ||
| 172 | + $this->success($test); | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + /** | ||
| 161 | * @remark :获取Url内容 | 176 | * @remark :获取Url内容 |
| 162 | * @name :getUrlRead | 177 | * @name :getUrlRead |
| 163 | * @author :lyh | 178 | * @author :lyh |
| @@ -195,7 +210,7 @@ class TranslateLogic extends BaseLogic | @@ -195,7 +210,7 @@ class TranslateLogic extends BaseLogic | ||
| 195 | * @time :2023/6/12 10:52 | 210 | * @time :2023/6/12 10:52 |
| 196 | */ | 211 | */ |
| 197 | public function translateSave(){ | 212 | public function translateSave(){ |
| 198 | - try { | 213 | +// try { |
| 199 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); | 214 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); |
| 200 | if($info === false){ | 215 | if($info === false){ |
| 201 | $param = [ | 216 | $param = [ |
| @@ -211,9 +226,9 @@ class TranslateLogic extends BaseLogic | @@ -211,9 +226,9 @@ class TranslateLogic extends BaseLogic | ||
| 211 | $data = json_encode($this->param['data'],true); | 226 | $data = json_encode($this->param['data'],true); |
| 212 | $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); | 227 | $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); |
| 213 | } | 228 | } |
| 214 | - }catch (\Exception $e){ | ||
| 215 | - $this->fail('系统错误请联系管理员'); | ||
| 216 | - } | ||
| 217 | - $this->response('success'); | 229 | +// }catch (\Exception $e){ |
| 230 | +// $this->fail('系统错误请联系管理员'); | ||
| 231 | +// } | ||
| 232 | + return $this->success(); | ||
| 218 | } | 233 | } |
| 219 | } | 234 | } |
| @@ -179,4 +179,22 @@ class ManageHr extends Base | @@ -179,4 +179,22 @@ class ManageHr extends Base | ||
| 179 | { | 179 | { |
| 180 | return $this->dept->name; | 180 | return $this->dept->name; |
| 181 | } | 181 | } |
| 182 | + | ||
| 183 | + /** | ||
| 184 | + * @remark :获取用户名称 | ||
| 185 | + * @name :getName | ||
| 186 | + * @author :lyh | ||
| 187 | + * @method :post | ||
| 188 | + * @time :2023/8/18 14:41 | ||
| 189 | + */ | ||
| 190 | + public function getName($id){ | ||
| 191 | + $name = ''; | ||
| 192 | + if(!empty($id)){ | ||
| 193 | + $info = $this->read(['id'=>$id],['id','name']); | ||
| 194 | + if($info !== false){ | ||
| 195 | + $name = $info['name']; | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | + return $name; | ||
| 199 | + } | ||
| 182 | } | 200 | } |
| @@ -31,18 +31,17 @@ class RouteMap extends Base | @@ -31,18 +31,17 @@ class RouteMap extends Base | ||
| 31 | const SOURCE_BLOG_CATE = 'blog_category'; | 31 | const SOURCE_BLOG_CATE = 'blog_category'; |
| 32 | const SOURCE_NEWS = 'news'; | 32 | const SOURCE_NEWS = 'news'; |
| 33 | const SOURCE_NEWS_CATE = 'news_category'; | 33 | const SOURCE_NEWS_CATE = 'news_category'; |
| 34 | + //自定义模块 | ||
| 35 | + const SOURCE_MODULE = 'module'; | ||
| 36 | + //自定义模块分类 | ||
| 37 | + const SOURCE_MODULE_CATE = 'module_category'; | ||
| 34 | 38 | ||
| 35 | //路由二级目录 | 39 | //路由二级目录 |
| 36 | const PATH_NEWS_CATE = 'news_catalog'; | 40 | const PATH_NEWS_CATE = 'news_catalog'; |
| 37 | const PATH_BLOG_CATE = 'blog_catalog'; | 41 | const PATH_BLOG_CATE = 'blog_catalog'; |
| 42 | + const PATH_MODULE_CATE = 'module_category_route';//扩展模块 | ||
| 38 | 43 | ||
| 39 | const SOURCE_NAV = 'nav'; | 44 | const SOURCE_NAV = 'nav'; |
| 40 | - | ||
| 41 | - //自定义模块 | ||
| 42 | - const SOURCE_MODULE = 'module'; | ||
| 43 | - | ||
| 44 | - //自定义模块分类 | ||
| 45 | - const SOURCE_MODULE_CATE = 'module_category'; | ||
| 46 | /** | 45 | /** |
| 47 | * 生成路由标识 | 46 | * 生成路由标识 |
| 48 | * @param $title | 47 | * @param $title |
| @@ -132,6 +131,8 @@ class RouteMap extends Base | @@ -132,6 +131,8 @@ class RouteMap extends Base | ||
| 132 | $route_map->path = self::SOURCE_NEWS; | 131 | $route_map->path = self::SOURCE_NEWS; |
| 133 | }elseif ($source == self::SOURCE_BLOG){ | 132 | }elseif ($source == self::SOURCE_BLOG){ |
| 134 | $route_map->path = self::SOURCE_BLOG.'s'; | 133 | $route_map->path = self::SOURCE_BLOG.'s'; |
| 134 | + }elseif($source == self::SOURCE_MODULE){ | ||
| 135 | + $route_map->path = self::PATH_MODULE_CATE; | ||
| 135 | } | 136 | } |
| 136 | $route_map->route = $route; | 137 | $route_map->route = $route; |
| 137 | $route_map->save(); | 138 | $route_map->save(); |
| @@ -15,7 +15,7 @@ class TemplateModule extends Base | @@ -15,7 +15,7 @@ class TemplateModule extends Base | ||
| 15 | { | 15 | { |
| 16 | protected $table = 'gl_public_template_module'; | 16 | protected $table = 'gl_public_template_module'; |
| 17 | 17 | ||
| 18 | - | 18 | + const PRIVATE_MODULES = 99;//私有模块类型 |
| 19 | /** | 19 | /** |
| 20 | * @remark :获取器image | 20 | * @remark :获取器image |
| 21 | * @name :getImageAttribute | 21 | * @name :getImageAttribute |
| @@ -343,6 +343,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -343,6 +343,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 343 | Route::any('/status', [Aside\Template\ATemplateModuleController::class, 'status'])->name('admin.ATemplateModule_status'); | 343 | Route::any('/status', [Aside\Template\ATemplateModuleController::class, 'status'])->name('admin.ATemplateModule_status'); |
| 344 | Route::any('/del', [Aside\Template\ATemplateModuleController::class, 'del'])->name('admin.ATemplateModule_del'); | 344 | Route::any('/del', [Aside\Template\ATemplateModuleController::class, 'del'])->name('admin.ATemplateModule_del'); |
| 345 | Route::any('/type', [Aside\Template\ATemplateModuleController::class, 'getType'])->name('admin.ATemplateModule_getType'); | 345 | Route::any('/type', [Aside\Template\ATemplateModuleController::class, 'getType'])->name('admin.ATemplateModule_getType'); |
| 346 | + Route::any('/getProjectList', [Aside\Template\ATemplateModuleController::class, 'getProjectList'])->name('admin.ATemplateModule_getProjectList'); | ||
| 346 | }); | 347 | }); |
| 347 | //设置类型 | 348 | //设置类型 |
| 348 | Route::prefix('type')->group(function () { | 349 | Route::prefix('type')->group(function () { |
-
请 注册 或 登录 后发表评论