Merge remote-tracking branch 'origin/master' into akun
正在显示
10 个修改的文件
包含
99 行增加
和
26 行删除
| @@ -8,6 +8,8 @@ use App\Helper\FormGlobalsoApi; | @@ -8,6 +8,8 @@ use App\Helper\FormGlobalsoApi; | ||
| 8 | use App\Models\Domain\DomainInfo; | 8 | use App\Models\Domain\DomainInfo; |
| 9 | use App\Models\HomeCount\Count; | 9 | use App\Models\HomeCount\Count; |
| 10 | use App\Models\Inquiry\InquiryFormData; | 10 | use App\Models\Inquiry\InquiryFormData; |
| 11 | +use App\Models\Nav\BNav; | ||
| 12 | +use App\Models\Nav\BNavGroup; | ||
| 11 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 12 | use App\Services\ProjectServer; | 14 | use App\Services\ProjectServer; |
| 13 | use Illuminate\Console\Command; | 15 | use Illuminate\Console\Command; |
| @@ -52,6 +54,17 @@ class Test extends Command | @@ -52,6 +54,17 @@ class Test extends Command | ||
| 52 | */ | 54 | */ |
| 53 | public function handle() | 55 | public function handle() |
| 54 | { | 56 | { |
| 57 | + ProjectServer::useProject(1); | ||
| 58 | + $group =BNavGroup::where(['id' => 1])->first(); | ||
| 59 | + $sort_list = json_decode($group->sort_list, true); | ||
| 60 | + $nav = new BNav(); | ||
| 61 | + $map = [ | ||
| 62 | + 'project_id' => 1, | ||
| 63 | + 'group_id' => 1 | ||
| 64 | + ]; | ||
| 65 | + $list = $nav->list($map, ['sort','id']); | ||
| 66 | + $ids = array_column($group, 'id'); | ||
| 67 | + dd($list, $sort_list); | ||
| 55 | $projects = Project::all(); | 68 | $projects = Project::all(); |
| 56 | foreach ($projects as $project){ | 69 | foreach ($projects as $project){ |
| 57 | echo "project " . $project->id; | 70 | echo "project " . $project->id; |
| @@ -36,7 +36,7 @@ class Kernel extends ConsoleKernel | @@ -36,7 +36,7 @@ class Kernel extends ConsoleKernel | ||
| 36 | $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次 | 36 | $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次 |
| 37 | $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 | 37 | $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 |
| 38 | $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 | 38 | $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 |
| 39 | - $schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新 | 39 | +// $schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新 |
| 40 | $schedule->command('update_seo_tdk_crontab')->dailyAt('00:00')->withoutOverlapping(1); //更新上线项目TDK | 40 | $schedule->command('update_seo_tdk_crontab')->dailyAt('00:00')->withoutOverlapping(1); //更新上线项目TDK |
| 41 | $schedule->command('website_data')->dailyAt('01:00')->withoutOverlapping(1); // 向AICC推送数据 | 41 | $schedule->command('website_data')->dailyAt('01:00')->withoutOverlapping(1); // 向AICC推送数据 |
| 42 | $schedule->command('project_file_pdf')->dailyAt('00:00')->withoutOverlapping(1); // 网站项目数据,生成PDF文件 | 42 | $schedule->command('project_file_pdf')->dailyAt('00:00')->withoutOverlapping(1); // 网站项目数据,生成PDF文件 |
| @@ -14,6 +14,10 @@ use App\Http\Controllers\Bside\BaseController; | @@ -14,6 +14,10 @@ use App\Http\Controllers\Bside\BaseController; | ||
| 14 | use App\Http\Logic\Bside\CustomModule\CustomModuleExtendLogic; | 14 | use App\Http\Logic\Bside\CustomModule\CustomModuleExtendLogic; |
| 15 | use App\Models\CustomModule\CustomModuleExtend; | 15 | use App\Models\CustomModule\CustomModuleExtend; |
| 16 | use App\Models\CustomModule\CustomModuleExtentContent; | 16 | use App\Models\CustomModule\CustomModuleExtentContent; |
| 17 | +<<<<<<< HEAD | ||
| 18 | +use App\Models\Product\Extend; | ||
| 19 | +======= | ||
| 20 | +>>>>>>> 8cd12bff1a9683bab5e510abdf95218a42999a27 | ||
| 17 | 21 | ||
| 18 | class CustomModuleExtentController extends BaseController | 22 | class CustomModuleExtentController extends BaseController |
| 19 | { | 23 | { |
| @@ -83,6 +87,24 @@ class CustomModuleExtentController extends BaseController | @@ -83,6 +87,24 @@ class CustomModuleExtentController extends BaseController | ||
| 83 | } | 87 | } |
| 84 | 88 | ||
| 85 | /** | 89 | /** |
| 90 | +<<<<<<< HEAD | ||
| 91 | + * @remark :获取扩展模块的扩展字段 | ||
| 92 | + * @name :lists | ||
| 93 | + * @author :lyh | ||
| 94 | + * @method :post | ||
| 95 | + * @time :2023/12/21 9:25 | ||
| 96 | + */ | ||
| 97 | + public function extendContent(CustomModuleExtentContent $content){ | ||
| 98 | + $this->request->validate([ | ||
| 99 | + 'module_id'=>['required'], | ||
| 100 | + ],[ | ||
| 101 | + 'module_id.required' => 'module_id不能为空', | ||
| 102 | + ]); | ||
| 103 | + $lists = $content->list($this->map); | ||
| 104 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | +======= | ||
| 86 | * @remark : | 108 | * @remark : |
| 87 | * @name :getExtendContentList | 109 | * @name :getExtendContentList |
| 88 | * @author :lyh | 110 | * @author :lyh |
| @@ -94,4 +116,5 @@ class CustomModuleExtentController extends BaseController | @@ -94,4 +116,5 @@ class CustomModuleExtentController extends BaseController | ||
| 94 | $lists = $extend->list($this->map); | 116 | $lists = $extend->list($this->map); |
| 95 | $this->response('success',Code::SUCCESS,$lists); | 117 | $this->response('success',Code::SUCCESS,$lists); |
| 96 | } | 118 | } |
| 119 | +>>>>>>> 8cd12bff1a9683bab5e510abdf95218a42999a27 | ||
| 97 | } | 120 | } |
| @@ -31,13 +31,8 @@ class NavController extends BaseController | @@ -31,13 +31,8 @@ class NavController extends BaseController | ||
| 31 | public function index(BNav $nav,BNavGroup $navGroup){ | 31 | public function index(BNav $nav,BNavGroup $navGroup){ |
| 32 | $this->map['project_id'] = $this->user['project_id']; | 32 | $this->map['project_id'] = $this->user['project_id']; |
| 33 | $lists = $nav->list($this->map,$this->order = ['sort','id']); | 33 | $lists = $nav->list($this->map,$this->order = ['sort','id']); |
| 34 | -// //获取菜单组排序字段 | ||
| 35 | -// $groupInfo = $navGroup->read(['id'=>$this->param['group_id']]); | ||
| 36 | -// if(!empty($groupInfo['sort_list'])){ | ||
| 37 | -// $sort_list = json_decode($groupInfo['sort_list']); | ||
| 38 | -// $data = $this->findDetailsList($sort_list,$lists); | ||
| 39 | -// }else{ | ||
| 40 | - $data = array(); | 34 | + $data = array(); |
| 35 | + if(!empty($lists)){ | ||
| 41 | foreach ($lists as $v){ | 36 | foreach ($lists as $v){ |
| 42 | $v = (array)$v; | 37 | $v = (array)$v; |
| 43 | if ($v['pid'] == 0) { | 38 | if ($v['pid'] == 0) { |
| @@ -45,7 +40,14 @@ class NavController extends BaseController | @@ -45,7 +40,14 @@ class NavController extends BaseController | ||
| 45 | $data[] = $v; | 40 | $data[] = $v; |
| 46 | } | 41 | } |
| 47 | } | 42 | } |
| 48 | -// } | 43 | + //获取菜单组排序字段 |
| 44 | + $groupInfo = $navGroup->read(['id'=>$this->param['group_id']]); | ||
| 45 | + if(!empty($groupInfo['sort_list'])){ | ||
| 46 | + $sort_list = json_decode($groupInfo['sort_list']); | ||
| 47 | + $detailsList = $this->getIdDetailsList($data); | ||
| 48 | + $data = $this->findDetailsLists($sort_list,$detailsList); | ||
| 49 | + } | ||
| 50 | + } | ||
| 49 | $this->response('success',Code::SUCCESS,$data); | 51 | $this->response('success',Code::SUCCESS,$data); |
| 50 | } | 52 | } |
| 51 | 53 | ||
| @@ -56,24 +58,41 @@ class NavController extends BaseController | @@ -56,24 +58,41 @@ class NavController extends BaseController | ||
| 56 | * @method :post | 58 | * @method :post |
| 57 | * @time :2023/12/18 14:54 | 59 | * @time :2023/12/18 14:54 |
| 58 | */ | 60 | */ |
| 59 | - public function findDetailsList($data, $detailsList) { | 61 | + public function findDetailsLists($sort_list, $detailsList) |
| 62 | + { | ||
| 60 | $result = []; | 63 | $result = []; |
| 61 | - foreach ($data as $item) { | ||
| 62 | - $items = $item = (array)$item; | ||
| 63 | - $id = $item['id']; | ||
| 64 | - // 在给定的详情列表中查找匹配的id | ||
| 65 | - $matchingDetail = array_filter($detailsList, function ($detail) use ($id) { | ||
| 66 | - return $detail['id'] == $id; | ||
| 67 | - }); | ||
| 68 | - if (!empty($matchingDetail)) { | ||
| 69 | - $items = reset($matchingDetail); | 64 | + foreach ($sort_list as $val) { |
| 65 | + $val = (array)$val; | ||
| 66 | + if (!empty($val['sub']) && is_array($val['sub']) && isset($detailsList[$val['id']]['sub'])){ | ||
| 67 | + $detailsList[$val['id']]['sub'] = $this->findDetailsLists($val['sub'], $detailsList[$val['id']]['sub']); | ||
| 68 | + } | ||
| 69 | + if (empty($detailsList[$val['id']])){ | ||
| 70 | + continue; | ||
| 70 | } | 71 | } |
| 71 | - if (!empty($item['sub'])) { | ||
| 72 | - $items['sub'] = $this->findDetailsList((array)$item['sub'], $detailsList); | 72 | + $result[] = $detailsList[$val['id']]; |
| 73 | + unset($detailsList[$val['id']]); | ||
| 74 | + } | ||
| 75 | + $result = array_merge($result, $detailsList); | ||
| 76 | + return $this->success($result); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * @remark :根据id组装数据 | ||
| 82 | + * @name :getDetailsList | ||
| 83 | + * @author :lyh | ||
| 84 | + * @method :post | ||
| 85 | + * @time :2023/12/20 18:52 | ||
| 86 | + */ | ||
| 87 | + public function getIdDetailsList($data){ | ||
| 88 | + $detailsList = []; | ||
| 89 | + foreach ($data as $v) { | ||
| 90 | + if (!empty($v['sub'])){ | ||
| 91 | + $v['sub'] = $this->getIdDetailsList($v['sub']); | ||
| 73 | } | 92 | } |
| 74 | - $result[] = $items; | 93 | + $detailsList[$v['id']] = $v; |
| 75 | } | 94 | } |
| 76 | - return $result; | 95 | + return $this->success($detailsList); |
| 77 | } | 96 | } |
| 78 | 97 | ||
| 79 | /** | 98 | /** |
| @@ -99,6 +99,9 @@ class CreateKeywordLogic extends BaseLogic | @@ -99,6 +99,9 @@ class CreateKeywordLogic extends BaseLogic | ||
| 99 | if(!empty($prefix)){//前缀+关键词 | 99 | if(!empty($prefix)){//前缀+关键词 |
| 100 | foreach ($keyword as $keywordItem){ | 100 | foreach ($keyword as $keywordItem){ |
| 101 | foreach ($prefix as $prefixItem) { | 101 | foreach ($prefix as $prefixItem) { |
| 102 | + if (strpos($keywordItem, $prefixItem) === 0) { | ||
| 103 | + continue; | ||
| 104 | + } | ||
| 102 | $prefix_keyword[] =$prefixItem.' '.$keywordItem; | 105 | $prefix_keyword[] =$prefixItem.' '.$keywordItem; |
| 103 | } | 106 | } |
| 104 | } | 107 | } |
| @@ -118,6 +121,9 @@ class CreateKeywordLogic extends BaseLogic | @@ -118,6 +121,9 @@ class CreateKeywordLogic extends BaseLogic | ||
| 118 | if(!empty($suffix)){//前缀+关键词 | 121 | if(!empty($suffix)){//前缀+关键词 |
| 119 | foreach ($keyword as $keywordItem){ | 122 | foreach ($keyword as $keywordItem){ |
| 120 | foreach ($suffix as $suffixItem) { | 123 | foreach ($suffix as $suffixItem) { |
| 124 | + if (str_ends_with($keywordItem, $suffixItem)) { | ||
| 125 | + continue; | ||
| 126 | + } | ||
| 121 | $suffix_keyword[] = $keywordItem.' '.$suffixItem; | 127 | $suffix_keyword[] = $keywordItem.' '.$suffixItem; |
| 122 | } | 128 | } |
| 123 | } | 129 | } |
| @@ -137,7 +143,13 @@ class CreateKeywordLogic extends BaseLogic | @@ -137,7 +143,13 @@ class CreateKeywordLogic extends BaseLogic | ||
| 137 | if(!empty($prefix) && !empty($suffix)){ | 143 | if(!empty($prefix) && !empty($suffix)){ |
| 138 | foreach ($keyword as $keywordItem){ | 144 | foreach ($keyword as $keywordItem){ |
| 139 | foreach ($prefix as $prefixItem) { | 145 | foreach ($prefix as $prefixItem) { |
| 146 | + if (strpos($keywordItem, $prefixItem) === 0) { | ||
| 147 | + continue; | ||
| 148 | + } | ||
| 140 | foreach ($suffix as $suffixItem) { | 149 | foreach ($suffix as $suffixItem) { |
| 150 | + if (str_ends_with($keywordItem, $suffixItem)) { | ||
| 151 | + continue; | ||
| 152 | + } | ||
| 141 | $prefix_keyword_suffix[] = $prefixItem.' '.$keywordItem.' '.$suffixItem; | 153 | $prefix_keyword_suffix[] = $prefixItem.' '.$keywordItem.' '.$suffixItem; |
| 142 | } | 154 | } |
| 143 | } | 155 | } |
| @@ -174,6 +174,8 @@ class ProjectLogic extends BaseLogic | @@ -174,6 +174,8 @@ class ProjectLogic extends BaseLogic | ||
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | $param['notice_file'] = Arr::a2s($param['notice_file']); | 176 | $param['notice_file'] = Arr::a2s($param['notice_file']); |
| 177 | + }else{ | ||
| 178 | + unset($param['notice_file']); | ||
| 177 | } | 179 | } |
| 178 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ | 180 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ |
| 179 | foreach ($param['confirm_file'] as &$v2) { | 181 | foreach ($param['confirm_file'] as &$v2) { |
| @@ -182,6 +184,8 @@ class ProjectLogic extends BaseLogic | @@ -182,6 +184,8 @@ class ProjectLogic extends BaseLogic | ||
| 182 | } | 184 | } |
| 183 | } | 185 | } |
| 184 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); | 186 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); |
| 187 | + }else{ | ||
| 188 | + unset($param['confirm_file']); | ||
| 185 | } | 189 | } |
| 186 | unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']); | 190 | unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']); |
| 187 | 191 |
| @@ -80,7 +80,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -80,7 +80,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 80 | $this->model->edit(['url'=>$route],['id'=>$id]); | 80 | $this->model->edit(['url'=>$route],['id'=>$id]); |
| 81 | } | 81 | } |
| 82 | }catch (\Exception $e){ | 82 | }catch (\Exception $e){ |
| 83 | - $this->fail('error'); | 83 | + $this->fail('保存失败,请联系管理员'); |
| 84 | } | 84 | } |
| 85 | return $this->success(); | 85 | return $this->success(); |
| 86 | } | 86 | } |
| @@ -38,7 +38,8 @@ class CountLogic extends BaseLogic | @@ -38,7 +38,8 @@ class CountLogic extends BaseLogic | ||
| 38 | ]; | 38 | ]; |
| 39 | $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']); | 39 | $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']); |
| 40 | if($info === false){ | 40 | if($info === false){ |
| 41 | - $info = []; | 41 | + $info = $this->model->read(['project_id' => $this->user['project_id']], |
| 42 | + ['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']); | ||
| 42 | } | 43 | } |
| 43 | return $this->success($info); | 44 | return $this->success($info); |
| 44 | } | 45 | } |
| @@ -475,7 +475,7 @@ class ProductLogic extends BaseLogic | @@ -475,7 +475,7 @@ class ProductLogic extends BaseLogic | ||
| 475 | 'content'=>$info['content'], | 475 | 'content'=>$info['content'], |
| 476 | 'describe'=>Arr::a2s($info['describe']), | 476 | 'describe'=>Arr::a2s($info['describe']), |
| 477 | 'describe_id'=>Arr::arrToSet($info['describe_id']), | 477 | 'describe_id'=>Arr::arrToSet($info['describe_id']), |
| 478 | - 'seo_mate'=>Arr::a2s($info['seo_mate']), | 478 | +// 'seo_mate'=>Arr::a2s($info['seo_mate']), |
| 479 | 'related_product_id'=>Arr::arrToSet($info['related_product_id']), | 479 | 'related_product_id'=>Arr::arrToSet($info['related_product_id']), |
| 480 | 'sort'=>$info['sort'], | 480 | 'sort'=>$info['sort'], |
| 481 | 'status'=>0, | 481 | 'status'=>0, |
| @@ -455,6 +455,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -455,6 +455,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 455 | Route::any('/info', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'info'])->name('custom_extend_info'); | 455 | Route::any('/info', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'info'])->name('custom_extend_info'); |
| 456 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'save'])->name('custom_extend_save'); | 456 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'save'])->name('custom_extend_save'); |
| 457 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'del'])->name('custom_extend_del'); | 457 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'del'])->name('custom_extend_del'); |
| 458 | + Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent'); | ||
| 458 | }); | 459 | }); |
| 459 | }); | 460 | }); |
| 460 | }); | 461 | }); |
-
请 注册 或 登录 后发表评论