正在显示
7 个修改的文件
包含
243 行增加
和
1 行删除
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Controllers\Aside\Projects; | ||
| 4 | + | ||
| 5 | +use App\Enums\Common\Code; | ||
| 6 | +use App\Http\Controllers\Aside\BaseController; | ||
| 7 | +use App\Http\Logic\Aside\Projects\ProjectsLogic; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @remark :谷歌流量系统 | ||
| 11 | + * @class :ProjectsController.php | ||
| 12 | + * @author :lyh | ||
| 13 | + * @time :2023/7/11 9:46 | ||
| 14 | + */ | ||
| 15 | +class ProjectsController extends BaseController | ||
| 16 | +{ | ||
| 17 | + /** | ||
| 18 | + * @remark :流量系统列表 | ||
| 19 | + * @name :lists | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/7/11 9:52 | ||
| 23 | + */ | ||
| 24 | + public function lists(ProjectsLogic $projectsLogic){ | ||
| 25 | + //域名搜索 | ||
| 26 | + if(isset($this->map['domain']) && !empty($this->map['domain'])){ | ||
| 27 | + $this->map['domain'] = ['like',','.$this->map['domain'].',']; | ||
| 28 | + } | ||
| 29 | + $lists = $projectsLogic->projectsLists($this->map,$this->page,$this->row,$this->order); | ||
| 30 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * @remark :编辑谷歌流量系统 | ||
| 35 | + * @name :save | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2023/7/11 9:53 | ||
| 39 | + */ | ||
| 40 | + public function save(ProjectsLogic $projectsLogic){ | ||
| 41 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 42 | + $this->request->validate([ | ||
| 43 | + 'id'=>'required' | ||
| 44 | + ],[ | ||
| 45 | + 'id.required' => 'ID不能为空' | ||
| 46 | + ]); | ||
| 47 | + } | ||
| 48 | + $projectsLogic->projectsSave(); | ||
| 49 | + $this->response('success'); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * @remark :删除记录 | ||
| 54 | + * @name :del | ||
| 55 | + * @author :lyh | ||
| 56 | + * @method :post | ||
| 57 | + * @time :2023/7/11 9:53 | ||
| 58 | + */ | ||
| 59 | + public function del(ProjectsLogic $projectsLogic){ | ||
| 60 | + $this->request->validate([ | ||
| 61 | + 'id'=>'required' | ||
| 62 | + ],[ | ||
| 63 | + 'id.required' => 'ID不能为空' | ||
| 64 | + ]); | ||
| 65 | + $projectsLogic->projectsDel(); | ||
| 66 | + $this->response('success'); | ||
| 67 | + } | ||
| 68 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Controllers\Aside\Projects; | ||
| 4 | + | ||
| 5 | +use App\Enums\Common\Code; | ||
| 6 | +use App\Http\Controllers\Aside\BaseController; | ||
| 7 | +use App\Http\Logic\Aside\Projects\ProjectsLogLogic; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @remark :谷歌流量系统日记 | ||
| 11 | + * @class :ProjectsLogController.php | ||
| 12 | + * @author :lyh | ||
| 13 | + * @time :2023/7/11 10:36 | ||
| 14 | + */ | ||
| 15 | +class ProjectsLogController extends BaseController | ||
| 16 | +{ | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * @remark :获取列表 | ||
| 20 | + * @name :lists | ||
| 21 | + * @author :lyh | ||
| 22 | + * @method :post | ||
| 23 | + * @time :2023/7/11 10:39 | ||
| 24 | + */ | ||
| 25 | + public function lists(ProjectsLogLogic $projectsLogLogic){ | ||
| 26 | + $lists = $projectsLogLogic->projectsLogLists($this->map,$this->page,$this->row,$this->order); | ||
| 27 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 28 | + } | ||
| 29 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\Projects; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\Projects\ProjectsSeoTask; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @remark :谷歌流量日志记录 | ||
| 10 | + * @class :ProjectsLogLogic.php | ||
| 11 | + * @author :lyh | ||
| 12 | + * @time :2023/7/11 10:37 | ||
| 13 | + */ | ||
| 14 | +class ProjectsLogLogic extends BaseLogic | ||
| 15 | +{ | ||
| 16 | + public function __construct() | ||
| 17 | + { | ||
| 18 | + parent::__construct(); | ||
| 19 | + $this->param = $this->requestAll; | ||
| 20 | + $this->model = new ProjectsSeoTask(); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * @remark :获取列表 | ||
| 25 | + * @name :projectsLists | ||
| 26 | + * @author :lyh | ||
| 27 | + * @method :post | ||
| 28 | + * @time :2023/7/11 9:56 | ||
| 29 | + */ | ||
| 30 | + public function projectsLogLists($map,$page,$row,$order = 'id',$filed = ['*']){ | ||
| 31 | + $lists = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 32 | + return $this->success($lists); | ||
| 33 | + } | ||
| 34 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\Projects; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\Projects\Projects; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @remark :谷歌流量系统统计表 | ||
| 10 | + * @class :ProjectsLogic.php | ||
| 11 | + * @author :lyh | ||
| 12 | + * @time :2023/7/11 9:54 | ||
| 13 | + */ | ||
| 14 | +class ProjectsLogic extends BaseLogic | ||
| 15 | +{ | ||
| 16 | + public function __construct() | ||
| 17 | + { | ||
| 18 | + parent::__construct(); | ||
| 19 | + $this->param = $this->requestAll; | ||
| 20 | + $this->model = new Projects(); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * @remark :获取列表 | ||
| 25 | + * @name :projectsLists | ||
| 26 | + * @author :lyh | ||
| 27 | + * @method :post | ||
| 28 | + * @time :2023/7/11 9:56 | ||
| 29 | + */ | ||
| 30 | + public function projectsLists($map,$page,$row,$order = 'id',$filed = ['*']){ | ||
| 31 | + $lists = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 32 | + return $this->success($lists); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * @remark :更新 | ||
| 37 | + * @name :projectsSave | ||
| 38 | + * @author :lyh | ||
| 39 | + * @method :post | ||
| 40 | + * @time :2023/7/11 10:05 | ||
| 41 | + */ | ||
| 42 | + public function projectsSave(){ | ||
| 43 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 44 | + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | ||
| 45 | + }else{ | ||
| 46 | + $rs = $this->model->add($this->param); | ||
| 47 | + } | ||
| 48 | + if($rs === false){ | ||
| 49 | + $this->fail('error'); | ||
| 50 | + } | ||
| 51 | + return $this->success(); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * @remark :删除 | ||
| 56 | + * @name :projectsDel | ||
| 57 | + * @author :lyh | ||
| 58 | + * @method :post | ||
| 59 | + * @time :2023/7/11 10:07 | ||
| 60 | + */ | ||
| 61 | + public function projectsDel(){ | ||
| 62 | + $rs = $this->model->del($this->param); | ||
| 63 | + if($rs === false){ | ||
| 64 | + $this->fail('error'); | ||
| 65 | + } | ||
| 66 | + return $this->success(); | ||
| 67 | + } | ||
| 68 | +} |
app/Models/Projects/Projects.php
0 → 100644
app/Models/Projects/ProjectsSeoTask.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\Projects; | ||
| 4 | + | ||
| 5 | +use App\Models\Base; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @remark :谷歌流量系统日志记录表 | ||
| 9 | + * @class :ProjectsSeoTask.php | ||
| 10 | + * @author :lyh | ||
| 11 | + * @time :2023/7/11 9:50 | ||
| 12 | + */ | ||
| 13 | +class ProjectsSeoTask extends Base | ||
| 14 | +{ | ||
| 15 | + protected $table = 'gl_project_seo_task'; | ||
| 16 | +} |
| @@ -191,10 +191,21 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -191,10 +191,21 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 191 | Route::prefix('images')->group(function () { | 191 | Route::prefix('images')->group(function () { |
| 192 | Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('image_upload'); | 192 | Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('image_upload'); |
| 193 | }); | 193 | }); |
| 194 | - //文件上传第三方操作 | 194 | + //文件操作 |
| 195 | Route::prefix('files')->group(function () { | 195 | Route::prefix('files')->group(function () { |
| 196 | Route::post('/upload', [\App\Http\Controllers\File\FileController::class, 'upload'])->name('files_upload'); | 196 | Route::post('/upload', [\App\Http\Controllers\File\FileController::class, 'upload'])->name('files_upload'); |
| 197 | }); | 197 | }); |
| 198 | + //谷歌流量系统 | ||
| 199 | + Route::prefix('projects')->group(function () { | ||
| 200 | + Route::post('/', [Aside\Projects\ProjectsController::class, 'lists'])->name('projects_lists'); | ||
| 201 | + Route::post('/save', [Aside\Projects\ProjectsController::class, 'save'])->name('projects_save'); | ||
| 202 | + Route::post('/del', [Aside\Projects\ProjectsController::class, 'del'])->name('projects_del'); | ||
| 203 | + //谷歌流量系统日志 | ||
| 204 | + Route::prefix('log')->group(function () { | ||
| 205 | + Route::post('/', [Aside\Projects\ProjectsLogController::class, 'lists'])->name('projectsLog_lists'); | ||
| 206 | + }); | ||
| 207 | + }); | ||
| 208 | + | ||
| 198 | // // 公共主题模版 | 209 | // // 公共主题模版 |
| 199 | // Route::prefix('template')->group(function () { | 210 | // Route::prefix('template')->group(function () { |
| 200 | // Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists'); | 211 | // Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists'); |
-
请 注册 或 登录 后发表评论