Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into dev
正在显示
27 个修改的文件
包含
417 行增加
和
84 行删除
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Controllers\Aside; | 3 | namespace App\Http\Controllers\Aside; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Enums\Common\Common; | ||
| 6 | use App\Http\Controllers\Controller; | 7 | use App\Http\Controllers\Controller; |
| 7 | use Illuminate\Http\JsonResponse; | 8 | use Illuminate\Http\JsonResponse; |
| 8 | use Illuminate\Http\Request; | 9 | use Illuminate\Http\Request; |
| @@ -21,7 +22,7 @@ class BaseController extends Controller | @@ -21,7 +22,7 @@ class BaseController extends Controller | ||
| 21 | protected $order = 'id'; | 22 | protected $order = 'id'; |
| 22 | protected $map = [];//处理后的参数 | 23 | protected $map = [];//处理后的参数 |
| 23 | protected $uid = 0; | 24 | protected $uid = 0; |
| 24 | - protected $user = [];//当前登录用户详情 | 25 | + protected $manage = [];//当前登录用户详情 |
| 25 | /** | 26 | /** |
| 26 | * 获取所有参数 | 27 | * 获取所有参数 |
| 27 | */ | 28 | */ |
| @@ -31,9 +32,9 @@ class BaseController extends Controller | @@ -31,9 +32,9 @@ class BaseController extends Controller | ||
| 31 | $this->param = $this->request->all(); | 32 | $this->param = $this->request->all(); |
| 32 | $this->token = $this->request->header('token'); | 33 | $this->token = $this->request->header('token'); |
| 33 | $this->get_param(); | 34 | $this->get_param(); |
| 34 | - if(!empty($this->token) && !empty(Cache::get($this->token))){ | ||
| 35 | - $info = Cache::get($this->token); | ||
| 36 | - $this->user = $info; | 35 | + if(!empty($this->token) && !empty(Cache::get(Common::MANAGE_TOKEN . $this->token))){ |
| 36 | + $info = Cache::get(Common::MANAGE_TOKEN . $this->token); | ||
| 37 | + $this->manage = $info; | ||
| 37 | $this->uid = $info['id']; | 38 | $this->uid = $info['id']; |
| 38 | } | 39 | } |
| 39 | } | 40 | } |
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Aside; | 3 | namespace App\Http\Controllers\Aside; |
| 4 | 4 | ||
| 5 | -use App\Http\Controllers\Controller; | ||
| 6 | -use Illuminate\Http\Request; | 5 | +use App\Http\Logic\Aside\Manage\MenuLogic; |
| 6 | +use App\Models\Manage\Manage; | ||
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * Class IndexController | 9 | * Class IndexController |
| @@ -11,16 +11,25 @@ use Illuminate\Http\Request; | @@ -11,16 +11,25 @@ use Illuminate\Http\Request; | ||
| 11 | * @author zbj | 11 | * @author zbj |
| 12 | * @date 2023/4/19 | 12 | * @date 2023/4/19 |
| 13 | */ | 13 | */ |
| 14 | -class IndexController extends Controller | 14 | +class IndexController extends BaseController |
| 15 | { | 15 | { |
| 16 | /** | 16 | /** |
| 17 | - * 首页 | ||
| 18 | - * @param Request $request | 17 | + * 用户菜单 |
| 18 | + * @param MenuLogic $logic | ||
| 19 | * @return \Illuminate\Http\JsonResponse | 19 | * @return \Illuminate\Http\JsonResponse |
| 20 | + * @throws \Psr\Container\ContainerExceptionInterface | ||
| 21 | + * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 22 | + * @author zbj | ||
| 23 | + * @date 2023/6/21 | ||
| 20 | */ | 24 | */ |
| 21 | - public function index(Request $request) | 25 | + public function get_menu(MenuLogic $logic) |
| 22 | { | 26 | { |
| 23 | - | 27 | + if($this->manage['id'] == Manage::ADMINISTRATOR_ID){ //超级管理员 |
| 28 | + $menus = $logic->getAllMenu(); | ||
| 29 | + }else{ | ||
| 30 | + $menus = $logic->getMenuByGroupId($this->manage['gid']); | ||
| 31 | + } | ||
| 32 | + return $this->success($menus); | ||
| 24 | } | 33 | } |
| 25 | 34 | ||
| 26 | } | 35 | } |
| @@ -6,8 +6,11 @@ use App\Helper\Arr; | @@ -6,8 +6,11 @@ use App\Helper\Arr; | ||
| 6 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 7 | use App\Http\Logic\Aside\Manage\MenuLogic; | 7 | use App\Http\Logic\Aside\Manage\MenuLogic; |
| 8 | use App\Http\Requests\Aside\Manage\MenuRequest; | 8 | use App\Http\Requests\Aside\Manage\MenuRequest; |
| 9 | +use App\Models\Manage\Menu; | ||
| 9 | use App\Rules\Ids; | 10 | use App\Rules\Ids; |
| 10 | use Illuminate\Http\Request; | 11 | use Illuminate\Http\Request; |
| 12 | +use Illuminate\Support\Facades\Route; | ||
| 13 | +use Illuminate\Support\Str; | ||
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| 13 | * 后台菜单 | 16 | * 后台菜单 |
| @@ -23,10 +26,24 @@ class MenuController extends BaseController | @@ -23,10 +26,24 @@ class MenuController extends BaseController | ||
| 23 | { | 26 | { |
| 24 | $map = []; | 27 | $map = []; |
| 25 | $sort = ['id' => 'desc']; | 28 | $sort = ['id' => 'desc']; |
| 26 | - $list = $logic->getList($map, $sort, ['*'],0); | 29 | + $list = $logic->getList($map, $sort, ['id', 'pid', 'title', 'icon', 'type'],0); |
| 27 | return $this->success(Arr::listToTree($list)); | 30 | return $this->success(Arr::listToTree($list)); |
| 28 | } | 31 | } |
| 29 | 32 | ||
| 33 | + public function routes(Request $request){ | ||
| 34 | + //已绑定菜单的路由 | ||
| 35 | + $menu_route = array_filter(Menu::pluck('route_name')->toArray()); | ||
| 36 | + //路由 | ||
| 37 | + $list = []; | ||
| 38 | + $routes = Route::getRoutes()->getRoutesByName(); | ||
| 39 | + foreach ($routes as $name => $route) { | ||
| 40 | + if(Str::startsWith($name, 'admin.') && !Str::endsWith($name, '.white') && !in_array($name, $menu_route)){ | ||
| 41 | + $list[] = $name; | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + return $this->success($list); | ||
| 45 | + } | ||
| 46 | + | ||
| 30 | public function info(Request $request, MenuLogic $logic){ | 47 | public function info(Request $request, MenuLogic $logic){ |
| 31 | $request->validate([ | 48 | $request->validate([ |
| 32 | 'id'=>'required' | 49 | 'id'=>'required' |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Controllers\Aside\Project; | ||
| 4 | + | ||
| 5 | +use App\Http\Controllers\Aside\BaseController; | ||
| 6 | +use App\Http\Logic\Aside\Project\OptimizeLogic; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @remark :优化方案设置 | ||
| 10 | + * @name :OptimizeController | ||
| 11 | + * @author :lyh | ||
| 12 | + * @time :2023/6/20 14:33 | ||
| 13 | + */ | ||
| 14 | +class OptimizeController extends BaseController | ||
| 15 | +{ | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * @remark :授权域名 | ||
| 19 | + * @name :empowerDomain | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/6/20 15:10 | ||
| 23 | + */ | ||
| 24 | + public function empowerDomain(OptimizeLogic $optimizeLogic){ | ||
| 25 | + $this->request->validate([ | ||
| 26 | + 'id'=>'required', | ||
| 27 | + 'gsc_id'=>'required' | ||
| 28 | + ],[ | ||
| 29 | + 'id.required' => '审核域名ID不能为空', | ||
| 30 | + 'gsc_id.required' => 'GSC账号ID不能为空' | ||
| 31 | + ]); | ||
| 32 | + $optimizeLogic->empowerDomain(); | ||
| 33 | + $this->response('success'); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @remark :优化设置 | ||
| 38 | + * @name :save | ||
| 39 | + * @author :lyh | ||
| 40 | + * @method :post | ||
| 41 | + * @time :2023/6/20 14:33 | ||
| 42 | + */ | ||
| 43 | + public function save(){ | ||
| 44 | + $this->response('success'); | ||
| 45 | + } | ||
| 46 | +} |
| @@ -24,8 +24,11 @@ class ProjectController extends BaseController | @@ -24,8 +24,11 @@ class ProjectController extends BaseController | ||
| 24 | public function list(ProjectLogic $logic) | 24 | public function list(ProjectLogic $logic) |
| 25 | { | 25 | { |
| 26 | $map = []; | 26 | $map = []; |
| 27 | + if(!empty($this->param['type'])){ | ||
| 28 | + $map[] = ['type', $this->param['type']]; | ||
| 29 | + } | ||
| 27 | if(!empty($this->param['search'])){ | 30 | if(!empty($this->param['search'])){ |
| 28 | - $map[] = ['title', 'like', "%{$this->param['search']}%"]; | 31 | + $map[] = ['title|company', $this->param['search']]; |
| 29 | } | 32 | } |
| 30 | $sort = ['id' => 'desc']; | 33 | $sort = ['id' => 'desc']; |
| 31 | $data = $logic->getList($map, $sort); | 34 | $data = $logic->getList($map, $sort); |
| @@ -78,4 +81,19 @@ class ProjectController extends BaseController | @@ -78,4 +81,19 @@ class ProjectController extends BaseController | ||
| 78 | $data = $logic->saveInquirySet($this->param); | 81 | $data = $logic->saveInquirySet($this->param); |
| 79 | return $this->success($data); | 82 | return $this->success($data); |
| 80 | } | 83 | } |
| 84 | + | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 数据源 | ||
| 88 | + * @param ProjectLogic $logic | ||
| 89 | + * @return \Illuminate\Http\JsonResponse | ||
| 90 | + * @throws \Psr\Container\ContainerExceptionInterface | ||
| 91 | + * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 92 | + * @author zbj | ||
| 93 | + * @date 2023/6/20 | ||
| 94 | + */ | ||
| 95 | + public function data_source(ProjectLogic $logic){ | ||
| 96 | + $data = $logic->dataSource(); | ||
| 97 | + return $this->success($data); | ||
| 98 | + } | ||
| 81 | } | 99 | } |
| @@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Aside\User; | 3 | namespace App\Http\Controllers\Aside\User; |
| 4 | 4 | ||
| 5 | +use App\Enums\Common\Code; | ||
| 5 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 7 | +use App\Http\Logic\Aside\User\DeptLogic; | ||
| 6 | 8 | ||
| 7 | /** | 9 | /** |
| 8 | * @remark :b端用户组织架构 | 10 | * @remark :b端用户组织架构 |
| @@ -18,8 +20,9 @@ class ProjectDeptController extends BaseController | @@ -18,8 +20,9 @@ class ProjectDeptController extends BaseController | ||
| 18 | * @method :post | 20 | * @method :post |
| 19 | * @time :2023/6/17 16:13 | 21 | * @time :2023/6/17 16:13 |
| 20 | */ | 22 | */ |
| 21 | - public function lists(){ | ||
| 22 | - | 23 | + public function lists(DeptLogic $deptLogic){ |
| 24 | + $lists = $deptLogic->DeptLists($this->map,$this->page,$this->row,$this->order); | ||
| 25 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | /** | 28 | /** |
| @@ -28,8 +31,14 @@ class ProjectDeptController extends BaseController | @@ -28,8 +31,14 @@ class ProjectDeptController extends BaseController | ||
| 28 | * @method :post | 31 | * @method :post |
| 29 | * @time :2023/6/17 16:13 | 32 | * @time :2023/6/17 16:13 |
| 30 | */ | 33 | */ |
| 31 | - public function read(){ | ||
| 32 | - | 34 | + public function read(DeptLogic $deptLogic){ |
| 35 | + $this->request->validate([ | ||
| 36 | + 'id'=>'required' | ||
| 37 | + ],[ | ||
| 38 | + 'id.required' => 'ID不能为空' | ||
| 39 | + ]); | ||
| 40 | + $info = $deptLogic->DeptRead(); | ||
| 41 | + $this->response('success',Code::SUCCESS,$info); | ||
| 33 | } | 42 | } |
| 34 | 43 | ||
| 35 | } | 44 | } |
| @@ -20,7 +20,8 @@ class MailController extends BaseController | @@ -20,7 +20,8 @@ class MailController extends BaseController | ||
| 20 | public function lists(){ | 20 | public function lists(){ |
| 21 | $mailModel = new MailModel(); | 21 | $mailModel = new MailModel(); |
| 22 | //获取当前用户下的所有站内信 | 22 | //获取当前用户下的所有站内信 |
| 23 | - $lists = $mailModel->where('user_list','like','%,'.$this->uid.',%')->orWhere('user_list', '')->select(['*'])->orderBy($this->order,'desc') | 23 | + $lists = $mailModel->where('status',0) |
| 24 | + ->where('user_list','like','%,'.$this->uid.',%')->orWhere('user_list', '')->select(['*'])->orderBy($this->order,'desc') | ||
| 24 | ->paginate($this->row, ['*'], 'page', $this->page); | 25 | ->paginate($this->row, ['*'], 'page', $this->page); |
| 25 | if(!empty($lists)){ | 26 | if(!empty($lists)){ |
| 26 | $lists = $lists->toArray(); | 27 | $lists = $lists->toArray(); |
| @@ -195,8 +195,7 @@ class TemplateController extends BaseController | @@ -195,8 +195,7 @@ class TemplateController extends BaseController | ||
| 195 | */ | 195 | */ |
| 196 | public function chunk(){ | 196 | public function chunk(){ |
| 197 | 197 | ||
| 198 | - $lists = TemplateChunkLogic::instance()->getList([['status','=',1]],['sort'=>'asc'],['*'],false)->toArray(); | ||
| 199 | - | 198 | + $lists = TemplateChunkLogic::instance()->getList([['status','=',1]],['sort'=>'asc'],['*'],false); |
| 200 | foreach ($lists as &$list){ | 199 | foreach ($lists as &$list){ |
| 201 | unset($list['created_at']); | 200 | unset($list['created_at']); |
| 202 | unset($list['updated_at']); | 201 | unset($list['updated_at']); |
| @@ -27,8 +27,7 @@ class LoginLogic extends BaseLogic | @@ -27,8 +27,7 @@ class LoginLogic extends BaseLogic | ||
| 27 | 27 | ||
| 28 | public function login() | 28 | public function login() |
| 29 | { | 29 | { |
| 30 | - $manage = $this->model->select('id', 'name', 'password', 'token')->where('mobile', $this->requestAll['mobile'])->first(); | ||
| 31 | - | 30 | + $manage = $this->model->select('id', 'name', 'password', 'token', 'status', 'gid', 'dept_id')->where('mobile', $this->requestAll['mobile'])->first(); |
| 32 | if (!$manage){ | 31 | if (!$manage){ |
| 33 | $this->fail('登录用户名不存在'); | 32 | $this->fail('登录用户名不存在'); |
| 34 | } | 33 | } |
| @@ -54,7 +53,7 @@ class LoginLogic extends BaseLogic | @@ -54,7 +53,7 @@ class LoginLogic extends BaseLogic | ||
| 54 | $this->fail('系统错误,请联系管理员'); | 53 | $this->fail('系统错误,请联系管理员'); |
| 55 | } | 54 | } |
| 56 | LoginLog::addLog($manage->id); | 55 | LoginLog::addLog($manage->id); |
| 57 | - return $this->success($manage->toArray()); | 56 | + return $this->success($manage->makeVisible('token')->toArray()); |
| 58 | } | 57 | } |
| 59 | 58 | ||
| 60 | public function logout(){ | 59 | public function logout(){ |
| @@ -28,4 +28,10 @@ class ManageLogic extends BaseLogic | @@ -28,4 +28,10 @@ class ManageLogic extends BaseLogic | ||
| 28 | } | 28 | } |
| 29 | return parent::save($param); | 29 | return parent::save($param); |
| 30 | } | 30 | } |
| 31 | + | ||
| 32 | + | ||
| 33 | + public static function getCacheName($id){ | ||
| 34 | + $info = (new self())->getCacheInfo($id); | ||
| 35 | + return $info['name'] ?? ''; | ||
| 36 | + } | ||
| 31 | } | 37 | } |
| @@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside\Manage; | @@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside\Manage; | ||
| 5 | 5 | ||
| 6 | use App\Helper\Arr; | 6 | use App\Helper\Arr; |
| 7 | use App\Http\Logic\Aside\BaseLogic; | 7 | use App\Http\Logic\Aside\BaseLogic; |
| 8 | +use App\Models\Manage\Group; | ||
| 8 | use App\Models\Manage\Menu; | 9 | use App\Models\Manage\Menu; |
| 9 | use Illuminate\Support\Facades\Route; | 10 | use Illuminate\Support\Facades\Route; |
| 10 | use Illuminate\Support\Str; | 11 | use Illuminate\Support\Str; |
| @@ -27,18 +28,6 @@ class MenuLogic extends BaseLogic | @@ -27,18 +28,6 @@ class MenuLogic extends BaseLogic | ||
| 27 | public function getInfo($id) | 28 | public function getInfo($id) |
| 28 | { | 29 | { |
| 29 | $info = parent::getInfo($id); | 30 | $info = parent::getInfo($id); |
| 30 | - | ||
| 31 | - //已绑定菜单的路由 | ||
| 32 | - $menu_route = array_filter(Menu::pluck('route_name')->toArray()); | ||
| 33 | - //路由 | ||
| 34 | - $info['route'] = []; | ||
| 35 | - $routes = Route::getRoutes()->getRoutesByName(); | ||
| 36 | - foreach ($routes as $name => $route) { | ||
| 37 | - if(Str::startsWith($name, 'admin.') && !Str::endsWith($name, '.white') && !in_array($name, $menu_route)){ | ||
| 38 | - $info['route'][] = $name; | ||
| 39 | - } | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | return $this->success($info); | 31 | return $this->success($info); |
| 43 | } | 32 | } |
| 44 | 33 | ||
| @@ -69,4 +58,20 @@ class MenuLogic extends BaseLogic | @@ -69,4 +58,20 @@ class MenuLogic extends BaseLogic | ||
| 69 | } | 58 | } |
| 70 | return parent::delete($ids); | 59 | return parent::delete($ids); |
| 71 | } | 60 | } |
| 61 | + | ||
| 62 | + public function getAllMenu(){ | ||
| 63 | + $map[] = ['type' => Menu::TYPE_MENU]; | ||
| 64 | + $map[] = ['status' => Menu::STATUS_NORMAL]; | ||
| 65 | + $list = parent::getList($map, ['id' => 'desc'], ['id', 'pid', 'title', 'icon', 'type'], 0); | ||
| 66 | + return $this->success(Arr::listToTree($list)); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public function getMenuByGroupId($gid){ | ||
| 70 | + $rights = Group::where(['id' => $gid, 'status' => Group::STATUS_NORMAL])->pluck('rights')->first(); | ||
| 71 | + $map[] = ['type' => Menu::TYPE_MENU]; | ||
| 72 | + $map[] = ['status' => Menu::STATUS_NORMAL]; | ||
| 73 | + $map[] = ['id', 'in', $rights]; | ||
| 74 | + $list = parent::getList($map, ['id' => 'desc'], ['id', 'pid', 'title', 'icon', 'type'], 0); | ||
| 75 | + return $this->success(Arr::listToTree($list)); | ||
| 76 | + } | ||
| 72 | } | 77 | } |
| @@ -29,7 +29,7 @@ class GscLogic extends BaseLogic | @@ -29,7 +29,7 @@ class GscLogic extends BaseLogic | ||
| 29 | $domainInfoModel = new DomainInfo(); | 29 | $domainInfoModel = new DomainInfo(); |
| 30 | foreach ($lists['list'] as $k => $v){ | 30 | foreach ($lists['list'] as $k => $v){ |
| 31 | $lists['list'][$k]['tal'] = $domainInfoModel->formatQuery(['gsc_id'=>$v['id']])->count(); | 31 | $lists['list'][$k]['tal'] = $domainInfoModel->formatQuery(['gsc_id'=>$v['id']])->count(); |
| 32 | - $lists['list'][$k]['pub'] = $domainInfoModel->formatQuery(['gsc_id'=>$v['id']])->count(); | 32 | + $lists['list'][$k]['pub'] = $domainInfoModel->formatQuery(['gsc_id'=>$v['id'],'status'=>$domainInfoModel::STATUS_TRUE])->count(); |
| 33 | $lists['list'][$k]['num'] = $lists['list'][$k]['tal'] - $lists['list'][$k]['pub']; | 33 | $lists['list'][$k]['num'] = $lists['list'][$k]['tal'] - $lists['list'][$k]['pub']; |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
| @@ -37,7 +37,7 @@ class GscLogic extends BaseLogic | @@ -37,7 +37,7 @@ class GscLogic extends BaseLogic | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | /** | 39 | /** |
| 40 | - * @remark :gsc账号列表 | 40 | + * @remark :gsc账号审核域名列表 |
| 41 | * @name :DomainLists | 41 | * @name :DomainLists |
| 42 | * @author :lyh | 42 | * @author :lyh |
| 43 | * @method :post | 43 | * @method :post |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\Project; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\Project\DeployOptimize; | ||
| 7 | +use App\Models\Project\DomainInfo; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @remark :优化授权域名 | ||
| 11 | + * @name :OptimizeLogic | ||
| 12 | + * @author :lyh | ||
| 13 | + * @time :2023/6/20 15:14 | ||
| 14 | + */ | ||
| 15 | +class OptimizeLogic extends BaseLogic | ||
| 16 | +{ | ||
| 17 | + public function __construct() | ||
| 18 | + { | ||
| 19 | + parent::__construct(); | ||
| 20 | + $this->model = new DeployOptimize(); | ||
| 21 | + $this->param = $this->requestAll; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :授权域名 | ||
| 26 | + * @name :empowerDomain | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2023/6/20 15:12 | ||
| 30 | + */ | ||
| 31 | + public function empowerDomain(){ | ||
| 32 | + $domain = new DomainInfo(); | ||
| 33 | + $rs = $domain->edit($this->param,['id'=>$this->param['id']]); | ||
| 34 | + if($rs === false){ | ||
| 35 | + $this->fail('error'); | ||
| 36 | + } | ||
| 37 | + return $this->success(); | ||
| 38 | + } | ||
| 39 | +} |
| @@ -6,12 +6,16 @@ namespace App\Http\Logic\Aside\Project; | @@ -6,12 +6,16 @@ namespace App\Http\Logic\Aside\Project; | ||
| 6 | use App\Helper\Arr; | 6 | use App\Helper\Arr; |
| 7 | use App\Helper\FormGlobalsoApi; | 7 | use App\Helper\FormGlobalsoApi; |
| 8 | use App\Http\Logic\Aside\BaseLogic; | 8 | use App\Http\Logic\Aside\BaseLogic; |
| 9 | +use App\Http\Logic\Aside\Manage\ManageLogic; | ||
| 10 | +use App\Models\City; | ||
| 9 | use App\Models\InquirySet; | 11 | use App\Models\InquirySet; |
| 12 | +use App\Models\Manage\Manage; | ||
| 10 | use App\Models\Project\DeployBuild; | 13 | use App\Models\Project\DeployBuild; |
| 11 | use App\Models\Project\DeployOptimize; | 14 | use App\Models\Project\DeployOptimize; |
| 12 | use App\Models\Project\Payment; | 15 | use App\Models\Project\Payment; |
| 13 | use App\Models\Project\Project; | 16 | use App\Models\Project\Project; |
| 14 | use Illuminate\Database\Eloquent\Model; | 17 | use Illuminate\Database\Eloquent\Model; |
| 18 | +use Illuminate\Support\Facades\Cache; | ||
| 15 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
| 16 | 20 | ||
| 17 | /** | 21 | /** |
| @@ -32,7 +36,30 @@ class ProjectLogic extends BaseLogic | @@ -32,7 +36,30 @@ class ProjectLogic extends BaseLogic | ||
| 32 | public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20) | 36 | public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20) |
| 33 | { | 37 | { |
| 34 | parent::setWith(['payment', 'deploy_build', 'deploy_optimize']); | 38 | parent::setWith(['payment', 'deploy_build', 'deploy_optimize']); |
| 35 | - return parent::getList($map, $sort, $columns, $limit); | 39 | + $list = parent::getList($map, $sort, ['id', 'title', 'channel', 'type', 'created_at'], $limit); |
| 40 | + foreach ($list['list'] as &$item){ | ||
| 41 | + $item = [ | ||
| 42 | + 'id' => $item['id'], | ||
| 43 | + 'title' => $item['title'], | ||
| 44 | + 'channel' => $item['channel']['channel'] . ' - ' . $item['channel']['saler'], | ||
| 45 | + 'key' => $item['deploy_build']['keyword_num'], | ||
| 46 | + 'day' => $item['deploy_build']['service_duration'], | ||
| 47 | + 'amount' => $item['payment']['amount'], | ||
| 48 | + 'build_leader' => ManageLogic::getCacheName($item['deploy_build']['leader_mid']), //组长 | ||
| 49 | + 'build_manager' => ManageLogic::getCacheName($item['deploy_build']['manager_mid']), //项目经理 | ||
| 50 | + 'build_designer' => ManageLogic::getCacheName($item['deploy_build']['designer_mid']), //设计师 | ||
| 51 | + 'build_tech' => ManageLogic::getCacheName($item['deploy_build']['tech_mid']), //技术助理 | ||
| 52 | + 'optimize_manager' => ManageLogic::getCacheName($item['deploy_optimize']['manager_mid']), //优化服务经理 | ||
| 53 | + 'optimize_optimist' => ManageLogic::getCacheName($item['deploy_optimize']['optimist_mid']), //优化师 | ||
| 54 | + 'optimize_assist' => ManageLogic::getCacheName($item['deploy_optimize']['assist_mid']), //优化助理 | ||
| 55 | + 'optimize_tech' => ManageLogic::getCacheName($item['deploy_optimize']['tech_mid']), //售后技术 | ||
| 56 | + 'type' => $this->model::typeMap()[$item['type']] ?: '', | ||
| 57 | + 'test_domain' => $item['deploy_build']['test_domain'], | ||
| 58 | + 'domain' => $item['deploy_optimize']['domain'], | ||
| 59 | + 'crated_at' => date('Y年m月d日', strtotime($item['created_at'])), | ||
| 60 | + ]; | ||
| 61 | + } | ||
| 62 | + return $list; | ||
| 36 | } | 63 | } |
| 37 | 64 | ||
| 38 | public function getInfo($id) | 65 | public function getInfo($id) |
| @@ -159,4 +186,15 @@ class ProjectLogic extends BaseLogic | @@ -159,4 +186,15 @@ class ProjectLogic extends BaseLogic | ||
| 159 | $set->save(); | 186 | $set->save(); |
| 160 | return $this->success(); | 187 | return $this->success(); |
| 161 | } | 188 | } |
| 189 | + | ||
| 190 | + public function dataSource(){ | ||
| 191 | + $data = []; | ||
| 192 | + $data['level'] = $this->model::levelMap(); | ||
| 193 | + $data['type'] = $this->model::typeMap(); | ||
| 194 | + $data['special'] = $this->model::specialMap(); | ||
| 195 | + $data['city'] = City::getTreeList(); | ||
| 196 | + return $data; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + | ||
| 162 | } | 200 | } |
app/Http/Logic/Aside/User/DeptLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\User; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\User\ProjectDept; | ||
| 7 | + | ||
| 8 | +class DeptLogic extends BaseLogic | ||
| 9 | +{ | ||
| 10 | + public function __construct() | ||
| 11 | + { | ||
| 12 | + parent::__construct(); | ||
| 13 | + $this->model = new ProjectDept(); | ||
| 14 | + $this->param = $this->requestAll; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * @remark :Dept组织价格列表 | ||
| 19 | + * @name :DeptLists | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/6/21 14:56 | ||
| 23 | + */ | ||
| 24 | + public function DeptLists($map,$page,$row,$order = 'created_at',$filed = ['*']){ | ||
| 25 | + $lists = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 26 | + return $this->success($lists); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * @remark :组织架构详情 | ||
| 31 | + * @name :DeptRead | ||
| 32 | + * @author :lyh | ||
| 33 | + * @method :post | ||
| 34 | + * @time :2023/6/21 15:01 | ||
| 35 | + */ | ||
| 36 | + public function DeptRead(){ | ||
| 37 | + $info = $this->model->read($this->param); | ||
| 38 | + if($info === false){ | ||
| 39 | + $this->fail('当前数据不存在,或者被删除'); | ||
| 40 | + } | ||
| 41 | + return $this->success($info); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | +} |
| @@ -133,10 +133,12 @@ class CountLogic extends BaseLogic | @@ -133,10 +133,12 @@ class CountLogic extends BaseLogic | ||
| 133 | ->select('referrer_url', DB::raw('COUNT(*) as count'))->groupBy('referrer_url') | 133 | ->select('referrer_url', DB::raw('COUNT(*) as count'))->groupBy('referrer_url') |
| 134 | ->orderByDesc('count')->limit(8)->get()->toArray(); | 134 | ->orderByDesc('count')->limit(8)->get()->toArray(); |
| 135 | $total = DB::table('gl_customer_visit')->count(); | 135 | $total = DB::table('gl_customer_visit')->count(); |
| 136 | + if(!empty($data)){ | ||
| 136 | $data = object_to_array($data); | 137 | $data = object_to_array($data); |
| 137 | foreach ($data as $k=>$v){ | 138 | foreach ($data as $k=>$v){ |
| 138 | $data[$k]['proportion'] = ($v['count']/$total) * 100; | 139 | $data[$k]['proportion'] = ($v['count']/$total) * 100; |
| 139 | } | 140 | } |
| 141 | + } | ||
| 140 | return $this->success($data); | 142 | return $this->success($data); |
| 141 | } | 143 | } |
| 142 | 144 | ||
| @@ -150,11 +152,13 @@ class CountLogic extends BaseLogic | @@ -150,11 +152,13 @@ class CountLogic extends BaseLogic | ||
| 150 | $data = DB::table('gl_customer_visit') | 152 | $data = DB::table('gl_customer_visit') |
| 151 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) | 153 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) |
| 152 | ->groupBy('country')->orderBy('ip','desc')->limit(20)->get()->toArray(); | 154 | ->groupBy('country')->orderBy('ip','desc')->limit(20)->get()->toArray(); |
| 155 | + if(!empty($data)){ | ||
| 153 | $data = object_to_array($data); | 156 | $data = object_to_array($data); |
| 154 | foreach ($data as $k => $v){ | 157 | foreach ($data as $k => $v){ |
| 155 | $v['pv'] = (int)$v['pv']; | 158 | $v['pv'] = (int)$v['pv']; |
| 156 | $data[$k] = $v; | 159 | $data[$k] = $v; |
| 157 | } | 160 | } |
| 161 | + } | ||
| 158 | return $this->success($data); | 162 | return $this->success($data); |
| 159 | } | 163 | } |
| 160 | 164 |
| @@ -26,8 +26,8 @@ class MailLogic extends BaseLogic | @@ -26,8 +26,8 @@ class MailLogic extends BaseLogic | ||
| 26 | //生成一条阅读记录 | 26 | //生成一条阅读记录 |
| 27 | $mailUserModel = new MailUserModel(); | 27 | $mailUserModel = new MailUserModel(); |
| 28 | $data = [ | 28 | $data = [ |
| 29 | - 'user_id'=>$info['id'], | ||
| 30 | - 'mail_id'=>$this->user['id'], | 29 | + 'user_id'=>$this->user['id'], |
| 30 | + 'mail_id'=>$info['id'], | ||
| 31 | ]; | 31 | ]; |
| 32 | //查询当前记录是否存在 | 32 | //查询当前记录是否存在 |
| 33 | $read_info = $mailUserModel->read($data); | 33 | $read_info = $mailUserModel->read($data); |
| @@ -46,6 +46,7 @@ class ProofreadingLogic extends BaseLogic | @@ -46,6 +46,7 @@ class ProofreadingLogic extends BaseLogic | ||
| 46 | $v['project_id'] = $this->user['project_id']; | 46 | $v['project_id'] = $this->user['project_id']; |
| 47 | $v['language_id'] = $this->param['language_id']; | 47 | $v['language_id'] = $this->param['language_id']; |
| 48 | $v['type'] = $this->param['type']; | 48 | $v['type'] = $this->param['type']; |
| 49 | + $v['alias'] = $this->param['alias']; | ||
| 49 | $this->param['data'][$k] = $v; | 50 | $this->param['data'][$k] = $v; |
| 50 | } | 51 | } |
| 51 | //新增 | 52 | //新增 |
| @@ -35,7 +35,7 @@ class ManageRequest extends FormRequest | @@ -35,7 +35,7 @@ class ManageRequest extends FormRequest | ||
| 35 | return [ | 35 | return [ |
| 36 | 'name'=>'required|max:20', | 36 | 'name'=>'required|max:20', |
| 37 | 'email'=>'email|max:64', | 37 | 'email'=>'email|max:64', |
| 38 | - 'mobile' => ['required', new Mobile()], | 38 | + 'mobile' => ['required', new Mobile(), Rule::unique('gl_manage')->ignore(request()->get('id',0))], |
| 39 | 'password' => 'required|min:6', | 39 | 'password' => 'required|min:6', |
| 40 | 'status' => ['required', Rule::in(array_keys(Manage::statusMap()))], | 40 | 'status' => ['required', Rule::in(array_keys(Manage::statusMap()))], |
| 41 | ]; | 41 | ]; |
| @@ -49,6 +49,7 @@ class ManageRequest extends FormRequest | @@ -49,6 +49,7 @@ class ManageRequest extends FormRequest | ||
| 49 | 'email.email' => '邮箱格式不正确', | 49 | 'email.email' => '邮箱格式不正确', |
| 50 | 'email.max' => '邮箱不能超过64个字', | 50 | 'email.max' => '邮箱不能超过64个字', |
| 51 | 'mobile.required' => '请输入手机号', | 51 | 'mobile.required' => '请输入手机号', |
| 52 | + 'mobile.unique' => '手机号已存在', | ||
| 52 | 'password.required' => '请输入密码', | 53 | 'password.required' => '请输入密码', |
| 53 | 'password.min' => '密码长度不能小于6位', | 54 | 'password.min' => '密码长度不能小于6位', |
| 54 | 'status.required' => '请选择状态', | 55 | 'status.required' => '请选择状态', |
app/Models/City.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +use App\Helper\Arr; | ||
| 7 | +use Illuminate\Database\Eloquent\Model; | ||
| 8 | +use Illuminate\Support\Facades\Cache; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * Class City | ||
| 12 | + * @package App\Models | ||
| 13 | + * @author zbj | ||
| 14 | + * @date 2023/6/20 | ||
| 15 | + */ | ||
| 16 | +class City extends Model | ||
| 17 | +{ | ||
| 18 | + //设置关联表名 | ||
| 19 | + protected $table = 'gl_system_city'; | ||
| 20 | + | ||
| 21 | + public static function getTreeList(){ | ||
| 22 | + $cache_key = 'city_select_tree'; | ||
| 23 | + $data = Cache::get($cache_key); | ||
| 24 | + if(!$data){ | ||
| 25 | + $list = self::select(['city_id', 'parent_id', 'name'])->whereIn('level', [0,1])->get()->toArray(); | ||
| 26 | + $data = Arr::listToTree($list, 'city_id', 'parent_id'); | ||
| 27 | + Cache::put($cache_key, $data, 24 * 3600); | ||
| 28 | + } | ||
| 29 | + return $data; | ||
| 30 | + } | ||
| 31 | +} |
| @@ -11,8 +11,8 @@ class Group extends Base | @@ -11,8 +11,8 @@ class Group extends Base | ||
| 11 | { | 11 | { |
| 12 | protected $table = 'gl_manage_group'; | 12 | protected $table = 'gl_manage_group'; |
| 13 | 13 | ||
| 14 | - const STATUS_NORMAL = 0; | ||
| 15 | - const STATUS_ABNORMAL = 1; | 14 | + const STATUS_NORMAL = 1; |
| 15 | + const STATUS_ABNORMAL = 0; | ||
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | * @return string[] | 18 | * @return string[] |
| @@ -9,10 +9,10 @@ class Manage extends Base | @@ -9,10 +9,10 @@ class Manage extends Base | ||
| 9 | //设置关联表名 | 9 | //设置关联表名 |
| 10 | protected $table = 'gl_manage'; | 10 | protected $table = 'gl_manage'; |
| 11 | 11 | ||
| 12 | - protected $hidden = ['password']; | 12 | + protected $hidden = ['password', 'token']; |
| 13 | 13 | ||
| 14 | - const STATUS_ACTIVE = 0; | ||
| 15 | - const STATUS_DISABLE = 1; | 14 | + const STATUS_ACTIVE = 1; |
| 15 | + const STATUS_DISABLE = 0; | ||
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | * 超级管理员ID, 当前ID拥有所有权限, 不能进行修改 | 18 | * 超级管理员ID, 当前ID拥有所有权限, 不能进行修改 |
| @@ -9,12 +9,11 @@ class Menu extends Base | @@ -9,12 +9,11 @@ class Menu extends Base | ||
| 9 | { | 9 | { |
| 10 | protected $table = 'gl_manage_menu'; | 10 | protected $table = 'gl_manage_menu'; |
| 11 | 11 | ||
| 12 | - const STATUS_NORMAL = 0; | ||
| 13 | - const STATUS_ABNORMAL = 1; | 12 | + const STATUS_NORMAL = 1; |
| 13 | + const STATUS_ABNORMAL = 0; | ||
| 14 | 14 | ||
| 15 | - const TYPE_SHOW = 'show'; | ||
| 16 | - const TYPE_SAVE = 'save'; | ||
| 17 | - const TYPE_DELETE = 'delete'; | 15 | + const TYPE_MENU = 'menu'; |
| 16 | + const TYPE_NODE = 'node'; | ||
| 18 | 17 | ||
| 19 | /** | 18 | /** |
| 20 | * @return string[] | 19 | * @return string[] |
| @@ -33,9 +32,8 @@ class Menu extends Base | @@ -33,9 +32,8 @@ class Menu extends Base | ||
| 33 | public static function typeMap(): array | 32 | public static function typeMap(): array |
| 34 | { | 33 | { |
| 35 | return [ | 34 | return [ |
| 36 | - self::TYPE_SHOW => '查看', | ||
| 37 | - self::TYPE_SAVE => '保存', | ||
| 38 | - self::TYPE_DELETE => '删除', | 35 | + self::TYPE_MENU => '菜单', |
| 36 | + self::TYPE_NODE => '权限节点', | ||
| 39 | ]; | 37 | ]; |
| 40 | } | 38 | } |
| 41 | 39 |
| @@ -9,6 +9,8 @@ use Illuminate\Support\Facades\Cache; | @@ -9,6 +9,8 @@ use Illuminate\Support\Facades\Cache; | ||
| 9 | 9 | ||
| 10 | class DomainInfo extends Base | 10 | class DomainInfo extends Base |
| 11 | { | 11 | { |
| 12 | + const STATUS_TRUE = 1;//审核成功状态 | ||
| 13 | + | ||
| 12 | //设置关联表名 | 14 | //设置关联表名 |
| 13 | protected $table = 'gl_project_domain_info'; | 15 | protected $table = 'gl_project_domain_info'; |
| 14 | 16 |
| @@ -5,6 +5,7 @@ namespace App\Models\Project; | @@ -5,6 +5,7 @@ namespace App\Models\Project; | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Base; | 6 | use App\Models\Base; |
| 7 | use App\Models\Devops\ServerConfig; | 7 | use App\Models\Devops\ServerConfig; |
| 8 | +use App\Services\Facades\Upload; | ||
| 8 | use Illuminate\Support\Facades\Cache; | 9 | use Illuminate\Support\Facades\Cache; |
| 9 | 10 | ||
| 10 | class Project extends Base | 11 | class Project extends Base |
| @@ -50,26 +51,39 @@ class Project extends Base | @@ -50,26 +51,39 @@ class Project extends Base | ||
| 50 | ]; | 51 | ]; |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | - public static function planMap(){ | 54 | + public static function planMap() |
| 55 | + { | ||
| 54 | return [ | 56 | return [ |
| 55 | - '营销大师-体验版', | ||
| 56 | - '营销大师-标准版', | ||
| 57 | - '营销大师-商务版', | ||
| 58 | - '营销大师-旗舰版', | ||
| 59 | - '数据大师-体验版', | ||
| 60 | - '数据大师-智能版', | ||
| 61 | - '数据大师-智慧版', | ||
| 62 | - 'PLUS-尊享版', | ||
| 63 | - 'PLUS-尊贵版', | ||
| 64 | - 'PLUS-至尊版', | ||
| 65 | - '防疫物质推广方案', | ||
| 66 | - '疫情期间免费版', | ||
| 67 | - '建站大师定制优化方案', | ||
| 68 | - '星链网站(1年版)', | ||
| 69 | - '星链网站(2年版)', | 57 | + 1 => '营销大师-体验版', |
| 58 | + 2 => '营销大师-标准版', | ||
| 59 | + 3 => '营销大师-商务版', | ||
| 60 | + 4 => '营销大师-旗舰版', | ||
| 61 | + 5 => '数据大师-体验版', | ||
| 62 | + 6 => '数据大师-智能版', | ||
| 63 | + 7 => '数据大师-智慧版', | ||
| 64 | + 8 => 'PLUS-尊享版', | ||
| 65 | + 9 => 'PLUS-尊贵版', | ||
| 66 | + 10 => 'PLUS-至尊版', | ||
| 67 | + 11 => '防疫物质推广方案', | ||
| 68 | + 12 => '疫情期间免费版', | ||
| 69 | + 13 => '建站大师定制优化方案', | ||
| 70 | + 14 => '星链网站(1年版)', | ||
| 71 | + 15 => '星链网站(2年版)', | ||
| 70 | ]; | 72 | ]; |
| 71 | } | 73 | } |
| 72 | 74 | ||
| 75 | + public static function specialMap() | ||
| 76 | + { | ||
| 77 | + return [ | ||
| 78 | + 1 => '自建站项目', | ||
| 79 | + 2 => '重点跟进', | ||
| 80 | + 3 => '推广案例', | ||
| 81 | + 4 => '全球搜案例', | ||
| 82 | + 5 => '设计师案例', | ||
| 83 | + ]; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + | ||
| 73 | /** | 87 | /** |
| 74 | * 项目部署服务器信息 | 88 | * 项目部署服务器信息 |
| 75 | * @return \Illuminate\Database\Eloquent\Relations\HasOne | 89 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
| @@ -141,28 +155,62 @@ class Project extends Base | @@ -141,28 +155,62 @@ class Project extends Base | ||
| 141 | return self::hasOne(DeployOptimize::class, 'project_id', 'id'); | 155 | return self::hasOne(DeployOptimize::class, 'project_id', 'id'); |
| 142 | } | 156 | } |
| 143 | 157 | ||
| 144 | - public function setLevelAttribute($value){ | 158 | + public function setLevelAttribute($value) |
| 159 | + { | ||
| 145 | $this->attributes['level'] = Arr::arrToSet($value); | 160 | $this->attributes['level'] = Arr::arrToSet($value); |
| 146 | } | 161 | } |
| 147 | 162 | ||
| 148 | - public function getLevelAttribute($value){ | 163 | + public function getLevelAttribute($value) |
| 164 | + { | ||
| 149 | return Arr::setToArr($value); | 165 | return Arr::setToArr($value); |
| 150 | } | 166 | } |
| 151 | 167 | ||
| 152 | - public function setChannelAttribute($value){ | 168 | + public function setChannelAttribute($value) |
| 169 | + { | ||
| 153 | $this->attributes['channel'] = Arr::a2s($value); | 170 | $this->attributes['channel'] = Arr::a2s($value); |
| 154 | } | 171 | } |
| 155 | 172 | ||
| 156 | - public function getChannelAttribute($value){ | 173 | + public function getChannelAttribute($value) |
| 174 | + { | ||
| 157 | return Arr::s2a($value); | 175 | return Arr::s2a($value); |
| 158 | } | 176 | } |
| 159 | 177 | ||
| 160 | - public function setNoticeAttribute($value){ | ||
| 161 | - $this->attributes['notice'] = Arr::a2s($value); | 178 | + public function setNoticeFileAttribute($value) |
| 179 | + { | ||
| 180 | + foreach ($value as &$v) { | ||
| 181 | + $v = Upload::url2path($v); | ||
| 182 | + } | ||
| 183 | + $this->attributes['notice_file'] = Arr::a2s($value); | ||
| 162 | } | 184 | } |
| 163 | 185 | ||
| 164 | - public function getNoticeAttribute($value){ | ||
| 165 | - return Arr::s2a($value); | 186 | + public function getNoticeFileAttribute($value) |
| 187 | + { | ||
| 188 | + $value = Arr::s2a($value); | ||
| 189 | + if(!empty($value)){ | ||
| 190 | + foreach ($value as &$v) { | ||
| 191 | + $v = Upload::path2url($v); | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + return $value; | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + public function setConfirmFileAttribute($value) | ||
| 198 | + { | ||
| 199 | + foreach ($value as &$v) { | ||
| 200 | + $v = Upload::url2path($v); | ||
| 201 | + } | ||
| 202 | + $this->attributes['confirm_file'] = Arr::a2s($value); | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + public function getConfirmFileAttribute($value) | ||
| 206 | + { | ||
| 207 | + $value = Arr::s2a($value); | ||
| 208 | + if(!empty($value)) { | ||
| 209 | + foreach ($value as &$v) { | ||
| 210 | + $v = Upload::path2url($v); | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + return $value; | ||
| 166 | } | 214 | } |
| 167 | 215 | ||
| 168 | /** | 216 | /** |
| @@ -170,21 +218,22 @@ class Project extends Base | @@ -170,21 +218,22 @@ class Project extends Base | ||
| 170 | * @author zbj | 218 | * @author zbj |
| 171 | * @date 2023/5/5 | 219 | * @date 2023/5/5 |
| 172 | */ | 220 | */ |
| 173 | - public static function getProjectByDomain($domain){ | ||
| 174 | - $cache_key = 'project_'.$domain; | 221 | + public static function getProjectByDomain($domain) |
| 222 | + { | ||
| 223 | + $cache_key = 'project_' . $domain; | ||
| 175 | $data = Cache::get($cache_key); | 224 | $data = Cache::get($cache_key); |
| 176 | - if(!$data){ | 225 | + if (!$data) { |
| 177 | //是否测试域名 | 226 | //是否测试域名 |
| 178 | $project_id = DeployBuild::where('test_domain', $domain)->value('project_id'); | 227 | $project_id = DeployBuild::where('test_domain', $domain)->value('project_id'); |
| 179 | //是否正式域名 | 228 | //是否正式域名 |
| 180 | - if(!$project_id){ | 229 | + if (!$project_id) { |
| 181 | $project_id = DeployOptimize::where('domain', $domain)->value('project_id'); | 230 | $project_id = DeployOptimize::where('domain', $domain)->value('project_id'); |
| 182 | } | 231 | } |
| 183 | - if(!$project_id){ | 232 | + if (!$project_id) { |
| 184 | return []; | 233 | return []; |
| 185 | } | 234 | } |
| 186 | $data = self::find($project_id); | 235 | $data = self::find($project_id); |
| 187 | - if($data){ | 236 | + if ($data) { |
| 188 | Cache::put($cache_key, $data); | 237 | Cache::put($cache_key, $data); |
| 189 | } | 238 | } |
| 190 | } | 239 | } |
| @@ -8,6 +8,7 @@ use \App\Http\Controllers\Aside; | @@ -8,6 +8,7 @@ use \App\Http\Controllers\Aside; | ||
| 8 | //必须登录验证的路由组 | 8 | //必须登录验证的路由组 |
| 9 | Route::middleware(['aloginauth'])->group(function () { | 9 | Route::middleware(['aloginauth'])->group(function () { |
| 10 | Route::get('/', [Aside\IndexController::class, 'index'])->name('admin.home.white'); | 10 | Route::get('/', [Aside\IndexController::class, 'index'])->name('admin.home.white'); |
| 11 | + Route::get('/get_menu', [Aside\IndexController::class, 'get_menu'])->name('admin.get_menu.white'); | ||
| 11 | Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); | 12 | Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); |
| 12 | //会员相关 | 13 | //会员相关 |
| 13 | Route::prefix('user')->group(function () { | 14 | Route::prefix('user')->group(function () { |
| @@ -76,6 +77,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -76,6 +77,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 76 | Route::get('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info'); | 77 | Route::get('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info'); |
| 77 | Route::post('/save', [Aside\Manage\MenuController::class, 'save'])->name('admin.menu_save'); | 78 | Route::post('/save', [Aside\Manage\MenuController::class, 'save'])->name('admin.menu_save'); |
| 78 | Route::any('/delete', [Aside\Manage\MenuController::class, 'delete'])->name('admin.menu_delete'); | 79 | Route::any('/delete', [Aside\Manage\MenuController::class, 'delete'])->name('admin.menu_delete'); |
| 80 | + Route::any('/routes', [Aside\Manage\MenuController::class, 'routes'])->name('admin.menu_routes'); | ||
| 79 | }); | 81 | }); |
| 80 | 82 | ||
| 81 | //权限组 | 83 | //权限组 |
| @@ -103,12 +105,19 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -103,12 +105,19 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 103 | Route::any('/save', [Aside\Project\ProjectGscController::class, 'save'])->name('admin.save'); | 105 | Route::any('/save', [Aside\Project\ProjectGscController::class, 'save'])->name('admin.save'); |
| 104 | Route::any('/del', [Aside\Project\ProjectGscController::class, 'del'])->name('admin.del'); | 106 | Route::any('/del', [Aside\Project\ProjectGscController::class, 'del'])->name('admin.del'); |
| 105 | }); | 107 | }); |
| 108 | + | ||
| 109 | + //优化gsc账号记录表 | ||
| 110 | + Route::prefix('optimize')->group(function () { | ||
| 111 | + Route::any('/empowerDomain', [Aside\Project\OptimizeController::class, 'empowerDomain'])->name('admin.empowerDomain'); | ||
| 112 | + }); | ||
| 113 | + | ||
| 106 | //项目管理 | 114 | //项目管理 |
| 107 | Route::prefix('project')->group(function () { | 115 | Route::prefix('project')->group(function () { |
| 108 | Route::get('/', [Aside\Project\ProjectController::class, 'list'])->name('admin.project'); | 116 | Route::get('/', [Aside\Project\ProjectController::class, 'list'])->name('admin.project'); |
| 109 | Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); | 117 | Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); |
| 110 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); | 118 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); |
| 111 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); | 119 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); |
| 120 | + Route::any('/data_source', [Aside\Project\ProjectController::class, 'data_source'])->name('admin.project_data_source'); | ||
| 112 | }); | 121 | }); |
| 113 | 122 | ||
| 114 | //工单管理 | 123 | //工单管理 |
-
请 注册 或 登录 后发表评论