Merge remote-tracking branch 'origin/master' into zhl
正在显示
7 个修改的文件
包含
213 行增加
和
163 行删除
| @@ -11,6 +11,7 @@ namespace App\Console\Commands\DayCount; | @@ -11,6 +11,7 @@ namespace App\Console\Commands\DayCount; | ||
| 11 | 11 | ||
| 12 | use App\Models\Manage\ManageHr; | 12 | use App\Models\Manage\ManageHr; |
| 13 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 14 | +use App\Models\RankData\RankDataLog; | ||
| 14 | use Carbon\Carbon; | 15 | use Carbon\Carbon; |
| 15 | use App\Models\HomeCount\AfterCount as AfterCountModel; | 16 | use App\Models\HomeCount\AfterCount as AfterCountModel; |
| 16 | use Illuminate\Console\Command; | 17 | use Illuminate\Console\Command; |
| @@ -58,17 +59,49 @@ class AfterCount extends Command | @@ -58,17 +59,49 @@ class AfterCount extends Command | ||
| 58 | public function _action(){ | 59 | public function _action(){ |
| 59 | $this->managerHrModel = new ManageHr(); | 60 | $this->managerHrModel = new ManageHr(); |
| 60 | $projectModel = new Project(); | 61 | $projectModel = new Project(); |
| 62 | + $rankDataLogModel = new RankDataLog(); | ||
| 61 | $todayMidnight = date('Y-m-d 00:00:00', strtotime('today')); | 63 | $todayMidnight = date('Y-m-d 00:00:00', strtotime('today')); |
| 62 | $saveData = []; | 64 | $saveData = []; |
| 65 | + $projectIdArr = $rankDataLogModel->selectField(['is_compliance'=>1,'date'=>date('Y-m-d', strtotime('-3 months'))],'project_id');//3个月前达标的项目id | ||
| 63 | foreach ($this->after_manager as $key => $valM){ | 66 | foreach ($this->after_manager as $key => $valM){ |
| 64 | $idArr = $this->managerHrModel->selectField(['name'=>['in',$valM]],'id'); | 67 | $idArr = $this->managerHrModel->selectField(['name'=>['in',$valM]],'id'); |
| 65 | - $project_count = $projectModel->where('gl_project.extend_type',0)->where('gl_project.delete_status',0)->where('gl_project.created_at','<=',$todayMidnight)->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr)->whereIn('gl_project.type',[2,4])->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 66 | - $qualified_count = $projectModel->where('gl_project.extend_type',0)->where('gl_project.delete_status',0)->where('gl_project.created_at','<=',$todayMidnight)->where('gl_project.is_remain_today',1)->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr)->whereIn('gl_project.type',[2,4])->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | 68 | + $project_count = $projectModel->where('gl_project.extend_type',0) |
| 69 | + ->where('gl_project.delete_status',0) | ||
| 70 | + ->where('gl_project.created_at','<=',$todayMidnight) | ||
| 71 | + ->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr) | ||
| 72 | + ->whereIn('gl_project.type',[2,4]) | ||
| 73 | + ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 74 | + $qualified_count = $projectModel->where('gl_project.extend_type',0) | ||
| 75 | + ->where('gl_project.delete_status',0) | ||
| 76 | + ->where('gl_project.created_at','<=',$todayMidnight) | ||
| 77 | + ->where('gl_project.is_remain_today',1) | ||
| 78 | + ->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr) | ||
| 79 | + ->whereIn('gl_project.type',[2,4]) | ||
| 80 | + ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 67 | $rate = number_format($qualified_count / $project_count, 2); | 81 | $rate = number_format($qualified_count / $project_count, 2); |
| 68 | $threeMonthsAgo = date('Y-m-d 00:00:00', strtotime('-3 months')); | 82 | $threeMonthsAgo = date('Y-m-d 00:00:00', strtotime('-3 months')); |
| 69 | - $three_project_count = $projectModel->where('gl_project.extend_type',0)->where('gl_project.delete_status',0)->where('gl_project.created_at','<=',$threeMonthsAgo)->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr)->whereIn('gl_project.type',[2,4])->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 70 | - $three_qualified_count = $projectModel->where('gl_project.extend_type',0)->where('gl_project.delete_status',0)->where('gl_project.created_at','<=',$threeMonthsAgo)->where('gl_project.is_remain_today',1)->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr)->whereIn('gl_project.type',[2,4])->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | 83 | + $three_project_count = $projectModel->where('gl_project.extend_type',0) |
| 84 | + ->where('gl_project.delete_status',0) | ||
| 85 | + ->where('gl_project.created_at','<=',$threeMonthsAgo) | ||
| 86 | + ->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr) | ||
| 87 | + ->whereIn('gl_project.type',[2,4]) | ||
| 88 | + ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 89 | + $three_qualified_count = $projectModel->where('gl_project.extend_type',0) | ||
| 90 | + ->whereIn('gl_project.id',$projectIdArr) | ||
| 91 | + ->where('gl_project.delete_status',0) | ||
| 92 | + ->where('gl_project.created_at','<=',$threeMonthsAgo) | ||
| 93 | + ->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr) | ||
| 94 | + ->whereIn('gl_project.type',[2,4]) | ||
| 95 | + ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')->count(); | ||
| 71 | $three_rate = number_format($three_qualified_count / $three_project_count, 2); | 96 | $three_rate = number_format($three_qualified_count / $three_project_count, 2); |
| 97 | + $data = $projectModel->where('gl_project.extend_type',0) | ||
| 98 | + ->where('gl_project.delete_status',0) | ||
| 99 | + ->where('gl_project.created_at','<=',$todayMidnight) | ||
| 100 | + ->where('gl_project.is_remain_today',1) | ||
| 101 | + ->whereIn('gl_project_deploy_optimize.optimist_mid',$idArr) | ||
| 102 | + ->whereIn('gl_project.type',[2,4]) | ||
| 103 | + ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | ||
| 104 | + ->pluck('gl_project.title')->toArray(); | ||
| 72 | $saveData[] = [ | 105 | $saveData[] = [ |
| 73 | 'date'=>date('Y-m-d', strtotime('yesterday')), | 106 | 'date'=>date('Y-m-d', strtotime('yesterday')), |
| 74 | 'type'=> $key, | 107 | 'type'=> $key, |
| @@ -78,6 +111,7 @@ class AfterCount extends Command | @@ -78,6 +111,7 @@ class AfterCount extends Command | ||
| 78 | 'three_project_count'=>$three_project_count, | 111 | 'three_project_count'=>$three_project_count, |
| 79 | 'three_qualified_count'=>$three_qualified_count, | 112 | 'three_qualified_count'=>$three_qualified_count, |
| 80 | 'three_rate'=>$three_rate, | 113 | 'three_rate'=>$three_rate, |
| 114 | + 'data' => json_encode($data,true) | ||
| 81 | ]; | 115 | ]; |
| 82 | } | 116 | } |
| 83 | return $saveData; | 117 | return $saveData; |
| @@ -16,6 +16,8 @@ use App\Models\Product\CategoryRelated; | @@ -16,6 +16,8 @@ use App\Models\Product\CategoryRelated; | ||
| 16 | use App\Models\Product\Product; | 16 | use App\Models\Product\Product; |
| 17 | use App\Models\ProjectAssociation\ProjectAssociation; | 17 | use App\Models\ProjectAssociation\ProjectAssociation; |
| 18 | use App\Models\RouteMap\RouteMap; | 18 | use App\Models\RouteMap\RouteMap; |
| 19 | +use App\Models\Visit\Visit; | ||
| 20 | +use App\Models\Visit\VisitItem; | ||
| 19 | use App\Models\Workchat\MessagePush; | 21 | use App\Models\Workchat\MessagePush; |
| 20 | use App\Services\ProjectServer; | 22 | use App\Services\ProjectServer; |
| 21 | use Illuminate\Console\Command; | 23 | use Illuminate\Console\Command; |
| @@ -40,96 +42,113 @@ class DownloadProject extends Command | @@ -40,96 +42,113 @@ class DownloadProject extends Command | ||
| 40 | protected $description = '导出项目数据'; | 42 | protected $description = '导出项目数据'; |
| 41 | 43 | ||
| 42 | public function handle(){ | 44 | public function handle(){ |
| 43 | - $v6WeekModel = new V6WeeklyReport(); | ||
| 44 | - $lists = $v6WeekModel->list([],'id',['*'],'desc',100); | ||
| 45 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; | 45 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; |
| 46 | - foreach ($lists as $data){ | ||
| 47 | - $this->workChatMessage($data,$data['project_id']); | ||
| 48 | - } | 46 | + ProjectServer::useProject(535); |
| 47 | + $this->model = new Visit(); | ||
| 48 | + $data = $this->importVisit(); | ||
| 49 | + dd($data); | ||
| 50 | + DB::disconnect('custom_mysql'); | ||
| 49 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 51 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 50 | return true; | 52 | return true; |
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | - public function downloadProduct() | 55 | + /** |
| 56 | + * @remark :导出明细 | ||
| 57 | + * @name :importVisit | ||
| 58 | + * @author :lyh | ||
| 59 | + * @method :post | ||
| 60 | + * @time :2025/4/8 11:34 | ||
| 61 | + */ | ||
| 62 | + public function importVisit() | ||
| 54 | { | 63 | { |
| 55 | - $product = new Product(); | ||
| 56 | -// $filed = ['id', 'project_id', 'title' ,'thumb' , 'route' ,'intro','content', | ||
| 57 | -// 'category_id', 'status','seo_mate']; | ||
| 58 | - $filed = ['id','title']; | ||
| 59 | - $this->order = 'sort'; | ||
| 60 | - $lists = $product->list(['status'=>1],'id',$filed); | ||
| 61 | - if(!empty($lists)){ | ||
| 62 | -// $cate_data = $this->getCategoryList();//分类 | ||
| 63 | - foreach ($lists as $k => $v){ | ||
| 64 | - echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; | ||
| 65 | -// $v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']); | ||
| 66 | -// $v['category_id_text'] = $this->categoryName($v['id'],$cate_data); | ||
| 67 | -// //ToDo::处理图片及文件 | ||
| 68 | -// if(!empty($v['thumb']) && !empty($v['thumb']['url'])){ | ||
| 69 | -// $v['images'] = getImageUrl($v['thumb']['url']); | ||
| 70 | -// }else{ | ||
| 71 | -// $v['images'] = ''; | ||
| 72 | -// } | ||
| 73 | - $lists[$k] = $v; | 64 | + $lists = $this->model->list(); |
| 65 | + if(!empty($lists) && !empty($lists['list'])){ | ||
| 66 | + foreach ($lists as $v){ | ||
| 67 | + $customer_visit_id[] = $v['id']; | ||
| 74 | } | 68 | } |
| 75 | - } | ||
| 76 | - return $lists; | ||
| 77 | - } | ||
| 78 | - public function categoryName($product_id,$data){ | ||
| 79 | - $cateRelatedModel = new CategoryRelated(); | ||
| 80 | - $category_id = $cateRelatedModel->where('product_id',$product_id)->pluck('cate_id')->toArray(); | ||
| 81 | - $category_name = ''; | ||
| 82 | - if(!empty($category_id) && !empty($data)){ | ||
| 83 | - foreach ($category_id as $v){ | ||
| 84 | - if(isset($data[$v])){ | ||
| 85 | - $category_name .= $data[$v].','; | 69 | + $itemModel = new VisitItem(); |
| 70 | + $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']); | ||
| 71 | + foreach ($lists as $key => $value){ | ||
| 72 | + $sub = []; | ||
| 73 | + foreach ($itemList as $sonValue){ | ||
| 74 | + if($value['id'] == $sonValue['customer_visit_id']){ | ||
| 75 | + $sub[] = $sonValue; | ||
| 76 | + } | ||
| 86 | } | 77 | } |
| 78 | + $value['sub'] = $sub; | ||
| 79 | + $lists[$key] = $value; | ||
| 87 | } | 80 | } |
| 88 | - $category_name = trim($category_name,','); | ||
| 89 | } | 81 | } |
| 90 | - return $category_name; | 82 | + return $lists; |
| 91 | } | 83 | } |
| 84 | + | ||
| 92 | /** | 85 | /** |
| 93 | - * @remark :获取所有分类 | ||
| 94 | - * @name :getCategoryList | 86 | + * @remark :导出访问明细 |
| 87 | + * @name :exportData | ||
| 95 | * @author :lyh | 88 | * @author :lyh |
| 96 | * @method :post | 89 | * @method :post |
| 97 | - * @time :2023/9/14 13:56 | 90 | + * @time :2025/4/8 11:32 |
| 98 | */ | 91 | */ |
| 99 | - public function getCategoryList(){ | ||
| 100 | - $data = Common::get_user_cache('product_category',1225); | ||
| 101 | - if(empty($data)){ | ||
| 102 | - $categoryModel = new Category(); | ||
| 103 | - $data = []; | ||
| 104 | - $cateList = $categoryModel->list(['project_id'=>1225],['id','title']); | ||
| 105 | - if(!empty($cateList)){ | ||
| 106 | - foreach ($cateList as $value){ | ||
| 107 | - $data[$value['id']] = $value['title']; | ||
| 108 | - } | ||
| 109 | - } | ||
| 110 | - Common::set_user_cache($data,'product_category',1225); | 92 | + public function exportData($data){ |
| 93 | + // 创建一个新的 Excel 电子表格实例 | ||
| 94 | + $spreadsheet = new Spreadsheet(); | ||
| 95 | + $sheet = $spreadsheet->getActiveSheet(); | ||
| 96 | + // 添加表头 | ||
| 97 | + $sheet->setCellValue('A1', '浏览时间'); | ||
| 98 | + $sheet->setCellValue('B1', '访客来源'); | ||
| 99 | + $sheet->setCellValue('C1', '访客入路页面'); | ||
| 100 | + $sheet->setCellValue('D1', '终端'); | ||
| 101 | + $sheet->setCellValue('E1', '国家ip'); | ||
| 102 | + $sheet->setCellValue('F1', '深度访问页数'); | ||
| 103 | + $rowCount = 2; | ||
| 104 | + foreach ($data as $v) { | ||
| 105 | + $sheet->setCellValue('A' . $rowCount, $v['created_at']); | ||
| 106 | + $sheet->setCellValue('B' . $rowCount, $v['referrer_url']); | ||
| 107 | + $sheet->setCellValue('C' . $rowCount, $v['url']); | ||
| 108 | + $sheet->setCellValue('D' . $rowCount, $v['device_text']); | ||
| 109 | + $sheet->setCellValue('E' . $rowCount, $v['ip']); | ||
| 110 | + $sheet->setCellValue('F' . $rowCount, $v['depth']); | ||
| 111 | + $rowCount++; | ||
| 111 | } | 112 | } |
| 112 | - return $data; | 113 | + // 创建一个新的 Excel Writer 对象 |
| 114 | + $writer = new Xlsx($spreadsheet); | ||
| 115 | + $filename = time().'.xlsx'; | ||
| 116 | + // 设置导出文件的保存路径和文件名 | ||
| 117 | + $filePath = public_path('upload/excel/'.$filename); | ||
| 118 | + // 导出 Excel 文件 | ||
| 119 | + $writer->save($filePath); | ||
| 120 | + echo date('Y-m-d H:i:s') . 'file_link:'.url('upload/excel/'.$filename) . PHP_EOL; | ||
| 121 | + // 返回导出文件的响应 | ||
| 122 | + return ['file_link'=>url('upload/excel/'.$filename)]; | ||
| 113 | } | 123 | } |
| 124 | + | ||
| 114 | // public function exportData($data){ | 125 | // public function exportData($data){ |
| 115 | // // 创建一个新的 Excel 电子表格实例 | 126 | // // 创建一个新的 Excel 电子表格实例 |
| 116 | // $spreadsheet = new Spreadsheet(); | 127 | // $spreadsheet = new Spreadsheet(); |
| 117 | // $sheet = $spreadsheet->getActiveSheet(); | 128 | // $sheet = $spreadsheet->getActiveSheet(); |
| 118 | // // 添加表头 | 129 | // // 添加表头 |
| 119 | -// $sheet->setCellValue('A1', '浏览时间'); | ||
| 120 | -// $sheet->setCellValue('B1', '访客来源'); | ||
| 121 | -// $sheet->setCellValue('C1', '访客入路页面'); | ||
| 122 | -// $sheet->setCellValue('D1', '终端'); | ||
| 123 | -// $sheet->setCellValue('E1', '国家ip'); | ||
| 124 | -// $sheet->setCellValue('F1', '深度访问页数'); | 130 | +// $sheet->setCellValue('A1', '产品名称'); |
| 131 | +//// $sheet->setCellValue('B1', '产品短描述'); | ||
| 132 | +//// $sheet->setCellValue('C1', '产品内容'); | ||
| 133 | +//// $sheet->setCellValue('D1', '产品路由'); | ||
| 134 | +//// $sheet->setCellValue('E1', '产品分类'); | ||
| 135 | +//// $sheet->setCellValue('F1', '产品状态'); | ||
| 136 | +//// $sheet->setCellValue('G1', '产品主图'); | ||
| 137 | +//// $sheet->setCellValue('H1', '产品seo_title'); | ||
| 138 | +//// $sheet->setCellValue('I1', '产品seo_keyword'); | ||
| 139 | +//// $sheet->setCellValue('J1', '产品seo_title'); | ||
| 125 | // $rowCount = 2; | 140 | // $rowCount = 2; |
| 126 | // foreach ($data as $v) { | 141 | // foreach ($data as $v) { |
| 127 | -// $sheet->setCellValue('A' . $rowCount, $v['created_at']); | ||
| 128 | -// $sheet->setCellValue('B' . $rowCount, $v['referrer_url']); | ||
| 129 | -// $sheet->setCellValue('C' . $rowCount, $v['url']); | ||
| 130 | -// $sheet->setCellValue('D' . $rowCount, $v['device_text']); | ||
| 131 | -// $sheet->setCellValue('E' . $rowCount, $v['ip']); | ||
| 132 | -// $sheet->setCellValue('F' . $rowCount, $v['depth']); | 142 | +// $sheet->setCellValue('A' . $rowCount, $v['title']); |
| 143 | +//// $sheet->setCellValue('B' . $rowCount, $v['intro']); | ||
| 144 | +//// $sheet->setCellValue('C' . $rowCount, $v['content']); | ||
| 145 | +//// $sheet->setCellValue('D' . $rowCount, $v['url']); | ||
| 146 | +//// $sheet->setCellValue('E' . $rowCount, $v['category_id_text']); | ||
| 147 | +//// $sheet->setCellValue('F' . $rowCount, '发布中'); | ||
| 148 | +//// $sheet->setCellValue('G' . $rowCount, $v['images']); | ||
| 149 | +//// $sheet->setCellValue('H' . $rowCount, $v['seo_mate']['title']); | ||
| 150 | +//// $sheet->setCellValue('I' . $rowCount, $v['seo_mate']['keyword']); | ||
| 151 | +//// $sheet->setCellValue('J' . $rowCount, $v['seo_mate']['description']); | ||
| 133 | // $rowCount++; | 152 | // $rowCount++; |
| 134 | // } | 153 | // } |
| 135 | // // 创建一个新的 Excel Writer 对象 | 154 | // // 创建一个新的 Excel Writer 对象 |
| @@ -143,69 +162,28 @@ class DownloadProject extends Command | @@ -143,69 +162,28 @@ class DownloadProject extends Command | ||
| 143 | // // 返回导出文件的响应 | 162 | // // 返回导出文件的响应 |
| 144 | // return ['file_link'=>url('upload/excel/'.$filename)]; | 163 | // return ['file_link'=>url('upload/excel/'.$filename)]; |
| 145 | // } | 164 | // } |
| 146 | - | ||
| 147 | - public function exportData($data){ | ||
| 148 | - // 创建一个新的 Excel 电子表格实例 | ||
| 149 | - $spreadsheet = new Spreadsheet(); | ||
| 150 | - $sheet = $spreadsheet->getActiveSheet(); | ||
| 151 | - // 添加表头 | ||
| 152 | - $sheet->setCellValue('A1', '产品名称'); | ||
| 153 | -// $sheet->setCellValue('B1', '产品短描述'); | ||
| 154 | -// $sheet->setCellValue('C1', '产品内容'); | ||
| 155 | -// $sheet->setCellValue('D1', '产品路由'); | ||
| 156 | -// $sheet->setCellValue('E1', '产品分类'); | ||
| 157 | -// $sheet->setCellValue('F1', '产品状态'); | ||
| 158 | -// $sheet->setCellValue('G1', '产品主图'); | ||
| 159 | -// $sheet->setCellValue('H1', '产品seo_title'); | ||
| 160 | -// $sheet->setCellValue('I1', '产品seo_keyword'); | ||
| 161 | -// $sheet->setCellValue('J1', '产品seo_title'); | ||
| 162 | - $rowCount = 2; | ||
| 163 | - foreach ($data as $v) { | ||
| 164 | - $sheet->setCellValue('A' . $rowCount, $v['title']); | ||
| 165 | -// $sheet->setCellValue('B' . $rowCount, $v['intro']); | ||
| 166 | -// $sheet->setCellValue('C' . $rowCount, $v['content']); | ||
| 167 | -// $sheet->setCellValue('D' . $rowCount, $v['url']); | ||
| 168 | -// $sheet->setCellValue('E' . $rowCount, $v['category_id_text']); | ||
| 169 | -// $sheet->setCellValue('F' . $rowCount, '发布中'); | ||
| 170 | -// $sheet->setCellValue('G' . $rowCount, $v['images']); | ||
| 171 | -// $sheet->setCellValue('H' . $rowCount, $v['seo_mate']['title']); | ||
| 172 | -// $sheet->setCellValue('I' . $rowCount, $v['seo_mate']['keyword']); | ||
| 173 | -// $sheet->setCellValue('J' . $rowCount, $v['seo_mate']['description']); | ||
| 174 | - $rowCount++; | ||
| 175 | - } | ||
| 176 | - // 创建一个新的 Excel Writer 对象 | ||
| 177 | - $writer = new Xlsx($spreadsheet); | ||
| 178 | - $filename = time().'.xlsx'; | ||
| 179 | - // 设置导出文件的保存路径和文件名 | ||
| 180 | - $filePath = public_path('upload/excel/'.$filename); | ||
| 181 | - // 导出 Excel 文件 | ||
| 182 | - $writer->save($filePath); | ||
| 183 | - echo date('Y-m-d H:i:s') . 'file_link:'.url('upload/excel/'.$filename) . PHP_EOL; | ||
| 184 | - // 返回导出文件的响应 | ||
| 185 | - return ['file_link'=>url('upload/excel/'.$filename)]; | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - public function downloadItem($filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){ | ||
| 189 | - $visitModel = new Visit(); | ||
| 190 | - $page = 1; | ||
| 191 | - $pageSize = 3000; | ||
| 192 | - $lists = $visitModel->lists(['updated_date'=>['between',['2025-02-01','2025-02-31']]],$page,$pageSize,'id',$filed); | ||
| 193 | - foreach ($lists as $v){ | ||
| 194 | - $customer_visit_id[] = $v['id']; | ||
| 195 | - } | ||
| 196 | - $itemModel = new VisitItem(); | ||
| 197 | - $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']); | ||
| 198 | - foreach ($lists as $key => $value){ | ||
| 199 | - $sub = []; | ||
| 200 | - foreach ($itemList as $sonValue){ | ||
| 201 | - if($value['id'] == $sonValue['customer_visit_id']){ | ||
| 202 | - $sub[] = $sonValue; | ||
| 203 | - } | ||
| 204 | - } | ||
| 205 | - $value['sub'] = $sub; | ||
| 206 | - $lists[$key] = $value; | ||
| 207 | - } | ||
| 208 | - return $lists; | ||
| 209 | - } | 165 | +// |
| 166 | +// public function downloadItem($filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){ | ||
| 167 | +// $visitModel = new Visit(); | ||
| 168 | +// $page = 1; | ||
| 169 | +// $pageSize = 3000; | ||
| 170 | +// $lists = $visitModel->lists(['updated_date'=>['between',['2025-02-01','2025-02-31']]],$page,$pageSize,'id',$filed); | ||
| 171 | +// foreach ($lists as $v){ | ||
| 172 | +// $customer_visit_id[] = $v['id']; | ||
| 173 | +// } | ||
| 174 | +// $itemModel = new VisitItem(); | ||
| 175 | +// $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']); | ||
| 176 | +// foreach ($lists as $key => $value){ | ||
| 177 | +// $sub = []; | ||
| 178 | +// foreach ($itemList as $sonValue){ | ||
| 179 | +// if($value['id'] == $sonValue['customer_visit_id']){ | ||
| 180 | +// $sub[] = $sonValue; | ||
| 181 | +// } | ||
| 182 | +// } | ||
| 183 | +// $value['sub'] = $sub; | ||
| 184 | +// $lists[$key] = $value; | ||
| 185 | +// } | ||
| 186 | +// return $lists; | ||
| 187 | +// } | ||
| 210 | 188 | ||
| 211 | } | 189 | } |
| @@ -52,9 +52,9 @@ class LyhImportTest extends Command | @@ -52,9 +52,9 @@ class LyhImportTest extends Command | ||
| 52 | * @time :2023/11/20 15:13 | 52 | * @time :2023/11/20 15:13 |
| 53 | */ | 53 | */ |
| 54 | public function handle(){ | 54 | public function handle(){ |
| 55 | - ProjectServer::useProject(2878); | 55 | + ProjectServer::useProject(3283); |
| 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; | 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; |
| 57 | - $this->importProductCategory('https://ecdn6.globalso.com/upload/p/2878/file/2025-03/products.csv',2878); | 57 | + $this->importProductCategory('https://ecdn6.globalso.com/upload/p/3283/file/2025-04/zhouyongpaxu.csv',3283); |
| 58 | DB::disconnect('custom_mysql'); | 58 | DB::disconnect('custom_mysql'); |
| 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 60 | } | 60 | } |
| @@ -93,18 +93,19 @@ class LyhImportTest extends Command | @@ -93,18 +93,19 @@ class LyhImportTest extends Command | ||
| 93 | continue; | 93 | continue; |
| 94 | } | 94 | } |
| 95 | try { | 95 | try { |
| 96 | - $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]); | ||
| 97 | - $pid = 0; | ||
| 98 | - if($val[2] != 0){ | ||
| 99 | - //查询上级id | ||
| 100 | - $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 101 | - if($pidCate !== false){ | ||
| 102 | - $pid = $pidCate['id']; | ||
| 103 | - } | ||
| 104 | - } | ||
| 105 | - $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 106 | - $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); | ||
| 107 | - echo date('Y-m-d H:i:s') . '产品分类id:'. $id.PHP_EOL; | 96 | + $categoryModel->edit(['sort'=>$val[1]],['title'=>$val[0]]); |
| 97 | +// $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]); | ||
| 98 | +// $pid = 0; | ||
| 99 | +// if($val[2] != 0){ | ||
| 100 | +// //查询上级id | ||
| 101 | +// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 102 | +// if($pidCate !== false){ | ||
| 103 | +// $pid = $pidCate['id']; | ||
| 104 | +// } | ||
| 105 | +// } | ||
| 106 | +// $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 107 | +// $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); | ||
| 108 | + echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; | ||
| 108 | }catch (\Exception $e){ | 109 | }catch (\Exception $e){ |
| 109 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; | 110 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; |
| 110 | continue; | 111 | continue; |
| @@ -281,13 +281,12 @@ class WeekProject extends Command | @@ -281,13 +281,12 @@ class WeekProject extends Command | ||
| 281 | foreach ($arr as $key => $val){ | 281 | foreach ($arr as $key => $val){ |
| 282 | $content .= ($key+1).','.$val.PHP_EOL.PHP_EOL; | 282 | $content .= ($key+1).','.$val.PHP_EOL.PHP_EOL; |
| 283 | } | 283 | } |
| 284 | - $timestamp = strtotime('tomorrow 9:00 AM'); | ||
| 285 | - $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); | 284 | + $tomorrowNineAM = date('Y-m-d 09:00:00', time()); |
| 286 | if(empty($content)){ | 285 | if(empty($content)){ |
| 287 | return true; | 286 | return true; |
| 288 | } | 287 | } |
| 289 | $tips = 'Tips:'.PHP_EOL.'1、全球搜V6.0系统提供网页TDK、H标签、Img标签等用户自定义编辑接口且辅以AI创作工具,用户可进一步对相关优化设置进行精细化优化与调整;'.PHP_EOL.'2、全球搜V6.0系统提供小语种页面精准校对翻译功能,用户可进一步对已翻译小语种页面进行人工翻译校对;'.PHP_EOL.'3、全球搜V6.0系统支持绑定Facebook、LinkedIn、X(原Twitter)等社媒账号,可一键同步转发网站上发布的产品和新闻至社媒账号动态,建议用户用起来哦;'.PHP_EOL.'4、如用户有较丰富的企业、产品、服务相关视频素材,全球搜建议用户及时创建YouTube主页,并在YouTube和网站相关网页上同步发布视频;'; | 288 | $tips = 'Tips:'.PHP_EOL.'1、全球搜V6.0系统提供网页TDK、H标签、Img标签等用户自定义编辑接口且辅以AI创作工具,用户可进一步对相关优化设置进行精细化优化与调整;'.PHP_EOL.'2、全球搜V6.0系统提供小语种页面精准校对翻译功能,用户可进一步对已翻译小语种页面进行人工翻译校对;'.PHP_EOL.'3、全球搜V6.0系统支持绑定Facebook、LinkedIn、X(原Twitter)等社媒账号,可一键同步转发网站上发布的产品和新闻至社媒账号动态,建议用户用起来哦;'.PHP_EOL.'4、如用户有较丰富的企业、产品、服务相关视频素材,全球搜建议用户及时创建YouTube主页,并在YouTube和网站相关网页上同步发布视频;'; |
| 290 | - $message = "【全球搜V6.0周报】- 项目ID:" . PHP_EOL . $content . PHP_EOL . $tips; | 289 | + $message = "【全球搜V6.0周报】" . PHP_EOL . $content . PHP_EOL . $tips; |
| 291 | $param = [ | 290 | $param = [ |
| 292 | 'project_id'=>$project_id, | 291 | 'project_id'=>$project_id, |
| 293 | 'friend_id'=>$friend_id, | 292 | 'friend_id'=>$friend_id, |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :AfterCountController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/4/8 9:56 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Optimize; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Models\HomeCount\AfterCount; | ||
| 15 | + | ||
| 16 | +class AfterCountController extends BaseController | ||
| 17 | +{ | ||
| 18 | + /** | ||
| 19 | + * @remark :售后数据统计 | ||
| 20 | + * @name :getAfterCount | ||
| 21 | + * @author :lyh | ||
| 22 | + * @method :post | ||
| 23 | + * @time :2025/3/27 17:21 | ||
| 24 | + */ | ||
| 25 | + public function getAfterCount(AfterCount $afterCount){ | ||
| 26 | + $list = $afterCount->lists($this->map,$this->page,$this->row); | ||
| 27 | + $this->response('success',Code::SUCCESS,$list); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * @remark :获取当前售后数据详情 | ||
| 32 | + * @name :getAfterCountInfo | ||
| 33 | + * @author :lyh | ||
| 34 | + * @method :post | ||
| 35 | + * @time :2025/4/8 9:56 | ||
| 36 | + */ | ||
| 37 | + public function getAfterCountInfo(AfterCount $afterCount){ | ||
| 38 | + $this->request->validate([ | ||
| 39 | + 'id' => 'required', | ||
| 40 | + ], [ | ||
| 41 | + 'id.required' => 'id不能为空', | ||
| 42 | + ]); | ||
| 43 | + $info = $afterCount->read($this->map,['id','data']); | ||
| 44 | + $info['data'] = json_decode($info['data'],true); | ||
| 45 | + $this->response('success',Code::SUCCESS,$info); | ||
| 46 | + } | ||
| 47 | +} |
| @@ -593,15 +593,5 @@ class OptimizeController extends BaseController | @@ -593,15 +593,5 @@ class OptimizeController extends BaseController | ||
| 593 | $this->response('success',Code::SUCCESS,$resultData); | 593 | $this->response('success',Code::SUCCESS,$resultData); |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | - /** | ||
| 597 | - * @remark :售后数据统计 | ||
| 598 | - * @name :getAfterCount | ||
| 599 | - * @author :lyh | ||
| 600 | - * @method :post | ||
| 601 | - * @time :2025/3/27 17:21 | ||
| 602 | - */ | ||
| 603 | - public function getAfterCount(AfterCount $afterCount){ | ||
| 604 | - $list = $afterCount->lists($this->map,$this->page,$this->row); | ||
| 605 | - $this->response('success',Code::SUCCESS,$list); | ||
| 606 | - } | 596 | + |
| 607 | } | 597 | } |
| @@ -304,7 +304,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -304,7 +304,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 304 | Route::any('/saveMinorLanguages', [Aside\Optimize\OptimizeController::class, 'saveMinorLanguages'])->name('admin.optimize_saveMinorLanguages');//设置小语种监控开关 | 304 | Route::any('/saveMinorLanguages', [Aside\Optimize\OptimizeController::class, 'saveMinorLanguages'])->name('admin.optimize_saveMinorLanguages');//设置小语种监控开关 |
| 305 | Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 | 305 | Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 |
| 306 | Route::any('/getAnchorLink', [Aside\Optimize\OptimizeController::class, 'getAnchorLink'])->name('admin.optimize_getAnchorLink');//设置robots开关 | 306 | Route::any('/getAnchorLink', [Aside\Optimize\OptimizeController::class, 'getAnchorLink'])->name('admin.optimize_getAnchorLink');//设置robots开关 |
| 307 | - Route::any('/getAfterCount', [Aside\Optimize\OptimizeController::class, 'getAfterCount'])->name('admin.optimize_getAfterCount');//设置robots开关 | 307 | + Route::any('/getAfterCount', [Aside\Optimize\AfterCountController::class, 'getAfterCount'])->name('admin.optimize_getAfterCount');//售后统计数据 |
| 308 | + Route::any('/getAfterCountInfo', [Aside\Optimize\AfterCountController::class, 'getAfterCountInfo'])->name('admin.optimize_getAfterCountInfo');//售后统计数据详情 | ||
| 308 | }); | 309 | }); |
| 309 | //生成关键字 | 310 | //生成关键字 |
| 310 | Route::prefix('create_keyword')->group(function () { | 311 | Route::prefix('create_keyword')->group(function () { |
-
请 注册 或 登录 后发表评论