正在显示
9 个修改的文件
包含
84 行增加
和
11 行删除
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Aside\Drainage; | 3 | +namespace App\Http\Controllers\Aside\GoogleSeoIps; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 7 | use App\Http\Logic\Aside\Projects\ProjectsLogic; | 7 | use App\Http\Logic\Aside\Projects\ProjectsLogic; |
| 8 | +use App\Models\GoogleSeoIps\Country; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * @remark :谷歌流量系统 | 11 | * @remark :谷歌流量系统 |
| @@ -45,6 +46,7 @@ class ProjectsController extends BaseController | @@ -45,6 +46,7 @@ class ProjectsController extends BaseController | ||
| 45 | 'id.required' => 'ID不能为空' | 46 | 'id.required' => 'ID不能为空' |
| 46 | ]); | 47 | ]); |
| 47 | } | 48 | } |
| 49 | + //参数验证 | ||
| 48 | $this->verifyParam(); | 50 | $this->verifyParam(); |
| 49 | $projectsLogic->projectsSave(); | 51 | $projectsLogic->projectsSave(); |
| 50 | $this->response('success'); | 52 | $this->response('success'); |
| @@ -86,6 +88,7 @@ class ProjectsController extends BaseController | @@ -86,6 +88,7 @@ class ProjectsController extends BaseController | ||
| 86 | 'seo_type.required' => '引流方式不能为空', | 88 | 'seo_type.required' => '引流方式不能为空', |
| 87 | ]); | 89 | ]); |
| 88 | } | 90 | } |
| 91 | + | ||
| 89 | /** | 92 | /** |
| 90 | * @remark :删除记录 | 93 | * @remark :删除记录 |
| 91 | * @name :del | 94 | * @name :del |
| @@ -102,4 +105,20 @@ class ProjectsController extends BaseController | @@ -102,4 +105,20 @@ class ProjectsController extends BaseController | ||
| 102 | $projectsLogic->projectsDel(); | 105 | $projectsLogic->projectsDel(); |
| 103 | $this->response('success'); | 106 | $this->response('success'); |
| 104 | } | 107 | } |
| 108 | + | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * @remark :获取国家 | ||
| 112 | + * @name :getCountry | ||
| 113 | + * @author :lyh | ||
| 114 | + * @method :post | ||
| 115 | + * @time :2023/7/18 11:08 | ||
| 116 | + */ | ||
| 117 | + public function getCountry(ProjectsLogic $projectsLogic){ | ||
| 118 | + if(isset($this->map['cname']) && !empty( $this->map['cname'])){ | ||
| 119 | + $this->map['cname'] = ['like','%'.$this->map['cname'].'%']; | ||
| 120 | + } | ||
| 121 | + $lists = $projectsLogic->getCountryList($this->map); | ||
| 122 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 123 | + } | ||
| 105 | } | 124 | } |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Aside\Drainage; | 3 | +namespace App\Http\Controllers\Aside\GoogleSeoIps; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| @@ -30,4 +30,25 @@ class ProjectsLogController extends BaseController | @@ -30,4 +30,25 @@ class ProjectsLogController extends BaseController | ||
| 30 | $lists = $projectsLogLogic->projectsLogLists($this->map,$this->page,$this->row,$this->order); | 30 | $lists = $projectsLogLogic->projectsLogLists($this->map,$this->page,$this->row,$this->order); |
| 31 | $this->response('success',Code::SUCCESS,$lists); | 31 | $this->response('success',Code::SUCCESS,$lists); |
| 32 | } | 32 | } |
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * @remark :日志注释 | ||
| 36 | + * @name :setLog | ||
| 37 | + * @author :lyh | ||
| 38 | + * @method :post | ||
| 39 | + * @time :2023/7/18 11:00 | ||
| 40 | + */ | ||
| 41 | + public function getLog($param){ | ||
| 42 | + $data = [ | ||
| 43 | + 'domain'=>$param['domain'],//域名 | ||
| 44 | + 'seo_at'=>date('Y-m-d'),//日期 | ||
| 45 | + 'ips_num'=>$param['ips_num'],//当天引流的IP数 | ||
| 46 | + 'ips_ok'=>$param['ips_ok'],//当天已引流的IP数 | ||
| 47 | + 'is_ok'=>$param['is_ok'],//是否跑完 | ||
| 48 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 49 | + 'ok_at'=>$param['ok_at'],//任务完成时间 | ||
| 50 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 51 | + 'is_pushredis'=>$param['is_pushredis'],//是否推送redis | ||
| 52 | + ]; | ||
| 53 | + } | ||
| 33 | } | 54 | } |
| @@ -8,7 +8,7 @@ use App\Models\Inquiry\InquiryInfo; | @@ -8,7 +8,7 @@ use App\Models\Inquiry\InquiryInfo; | ||
| 8 | use App\Models\Inquiry\InquiryIP; | 8 | use App\Models\Inquiry\InquiryIP; |
| 9 | use App\Models\Project\DeployBuild; | 9 | use App\Models\Project\DeployBuild; |
| 10 | use App\Models\Project\Keywords; | 10 | use App\Models\Project\Keywords; |
| 11 | -use App\Models\Projects\InquiryUser; | 11 | +use App\Models\GoogleSeoIps\InquiryUser; |
| 12 | use Illuminate\Support\Facades\DB; | 12 | use Illuminate\Support\Facades\DB; |
| 13 | 13 | ||
| 14 | /** | 14 | /** |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Aside\Projects; | 3 | namespace App\Http\Logic\Aside\Projects; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Aside\BaseLogic; | 5 | use App\Http\Logic\Aside\BaseLogic; |
| 6 | -use App\Models\Projects\ProjectsSeoTask; | 6 | +use App\Models\GoogleSeoIps\ProjectsSeoTask; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * @remark :谷歌流量日志记录 | 9 | * @remark :谷歌流量日志记录 |
| @@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
| 3 | namespace App\Http\Logic\Aside\Projects; | 3 | namespace App\Http\Logic\Aside\Projects; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Aside\BaseLogic; | 5 | use App\Http\Logic\Aside\BaseLogic; |
| 6 | -use App\Models\Projects\Projects; | 6 | +use App\Models\GoogleSeoIps\Country as CountryModel; |
| 7 | +use App\Models\GoogleSeoIps\Projects; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * @remark :谷歌流量系统统计表 | 10 | * @remark :谷歌流量系统统计表 |
| @@ -87,4 +88,17 @@ class ProjectsLogic extends BaseLogic | @@ -87,4 +88,17 @@ class ProjectsLogic extends BaseLogic | ||
| 87 | } | 88 | } |
| 88 | return $this->success(); | 89 | return $this->success(); |
| 89 | } | 90 | } |
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * @remark :获取国家列表 | ||
| 94 | + * @name :getCountryList | ||
| 95 | + * @author :lyh | ||
| 96 | + * @method :post | ||
| 97 | + * @time :2023/7/18 11:12 | ||
| 98 | + */ | ||
| 99 | + public function getCountryList($map){ | ||
| 100 | + $countryModel = new CountryModel(); | ||
| 101 | + $lists = $countryModel->list($map); | ||
| 102 | + return $this->success($lists); | ||
| 103 | + } | ||
| 90 | } | 104 | } |
app/Models/GoogleSeoIps/Country.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\GoogleSeoIps; | ||
| 4 | + | ||
| 5 | +use App\Models\Base; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @remark :192.30.242.45引流国家设置 | ||
| 9 | + * @class :Country.php | ||
| 10 | + * @author :lyh | ||
| 11 | + * @time :2023/7/18 11:09 | ||
| 12 | + */ | ||
| 13 | +class Country extends Base | ||
| 14 | +{ | ||
| 15 | + //连接数据库 | ||
| 16 | + protected $connection = 'projects_mysql'; | ||
| 17 | + protected $table = 'country'; | ||
| 18 | +} |
| @@ -183,12 +183,13 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -183,12 +183,13 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 183 | }); | 183 | }); |
| 184 | //谷歌流量系统 | 184 | //谷歌流量系统 |
| 185 | Route::prefix('projects')->group(function () { | 185 | Route::prefix('projects')->group(function () { |
| 186 | - Route::post('/', [Aside\Drainage\ProjectsController::class, 'lists'])->name('projects_lists'); | ||
| 187 | - Route::post('/save', [Aside\Drainage\ProjectsController::class, 'save'])->name('projects_save'); | ||
| 188 | - Route::post('/del', [Aside\Drainage\ProjectsController::class, 'del'])->name('projects_del'); | 186 | + Route::post('/', [Aside\GoogleSeoIps\ProjectsController::class, 'lists'])->name('projects_lists'); |
| 187 | + Route::post('/save', [Aside\GoogleSeoIps\ProjectsController::class, 'save'])->name('projects_save'); | ||
| 188 | + Route::post('/getCountry', [Aside\GoogleSeoIps\ProjectsController::class, 'getCountry'])->name('projects_getCountry'); | ||
| 189 | + Route::post('/del', [Aside\GoogleSeoIps\ProjectsController::class, 'del'])->name('projects_del'); | ||
| 189 | //谷歌流量系统日志 | 190 | //谷歌流量系统日志 |
| 190 | Route::prefix('log')->group(function () { | 191 | Route::prefix('log')->group(function () { |
| 191 | - Route::post('/', [Aside\Drainage\ProjectsLogController::class, 'lists'])->name('projectsLog_lists'); | 192 | + Route::post('/', [Aside\GoogleSeoIps\ProjectsLogController::class, 'lists'])->name('projectsLog_lists'); |
| 192 | }); | 193 | }); |
| 193 | //优化gsc账号记录表 | 194 | //优化gsc账号记录表 |
| 194 | Route::prefix('gsc')->group(function () { | 195 | Route::prefix('gsc')->group(function () { |
-
请 注册 或 登录 后发表评论