作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6

<?php
/**
* @remark :
* @name :CustomModuleCategoryController.php
* @author :lyh
* @method :post
* @time :2023/12/4 15:54
*/
namespace App\Http\Controllers\Bside\CustomModule;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\CustomModule\CustomModuleCategoryLogic;
use App\Models\CustomModule\CustomModuleCategory;
class CustomModuleCategoryController extends BaseController
{
/**
* @remark :获取自定义模块列表
* @name :ModuleList
* @author :lyh
* @method :post
* @time :2023/12/4 15:43
*/
public function list(CustomModuleCategory $customModuleCategory){
$this->map['project_id'] = $this->user['project_id'];
$lists = $customModuleCategory->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取当前数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/12/4 16:09
*/
public function info(CustomModuleCategoryLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$info = $logic->getCustomModuleCategoryInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/12/4 15:45
*/
public function save(CustomModuleCategoryLogic $logic){
$logic->customModuleCategorySave();
$this->response('success');
}
/**
* @remark :删除数据
* @name :del
* @author :lyh
* @method :post
* @time :2023/12/4 16:14
*/
public function del(CustomModuleCategoryLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$logic->customModuleCategoryDel();
$this->response('success');
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleContentController.php
* @author :lyh
* @method :post
* @time :2023/12/4 15:55
*/
namespace App\Http\Controllers\Bside\CustomModule;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic;
use App\Models\CustomModule\CustomModuleContent;
class CustomModuleContentController extends BaseController
{
/**
* @remark :获取自定义模块列表
* @name :ModuleList
* @author :lyh
* @method :post
* @time :2023/12/4 15:43
*/
public function list(CustomModuleContent $customModuleContent){
$this->map['project_id'] = $this->user['project_id'];
$lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取当前数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/12/4 16:09
*/
public function info(CustomModuleContentLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$info = $logic->getCustomModuleContentInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/12/4 15:45
*/
public function save(CustomModuleContentLogic $logic){
$logic->customModuleContentSave();
$this->response('success');
}
/**
* @remark :删除数据
* @name :del
* @author :lyh
* @method :post
* @time :2023/12/4 16:14
*/
public function del(CustomModuleContentLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$logic->customModuleContentDel();
$this->response('success');
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleController.php
* @author :lyh
* @method :post
* @time :2023/12/4 15:42
*/
namespace App\Http\Controllers\Bside\CustomModule;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\CustomModule\CustomModuleLogic;
use App\Models\CustomModule\CustomModule;
/**
* @remark :自定义模块
* @name :CustomModuleController
* @author :lyh
* @method :post
* @time :2023/12/4 15:42
*/
class CustomModuleController extends BaseController
{
/**
* @remark :获取自定义模块列表
* @name :ModuleList
* @author :lyh
* @method :post
* @time :2023/12/4 15:43
*/
public function list(CustomModule $customModule){
$this->map['project_id'] = $this->user['project_id'];
$lists = $customModule->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取当前数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/12/4 16:09
*/
public function info(CustomModuleLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$info = $logic->getCustomModuleInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/12/4 15:45
*/
public function save(CustomModuleLogic $logic){
$logic->customModuleSave();
$this->response('success');
}
public function del(CustomModuleLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$logic->customModuleDel();
$this->response('success');
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleExtentController.php
* @author :lyh
* @method :post
* @time :2023/12/4 15:58
*/
namespace App\Http\Controllers\Bside\CustomModule;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\CustomModule\CustomModuleExtendLogic;
use App\Models\CustomModule\CustomModuleExtend;
class CustomModuleExtentController extends BaseController
{
/**
* @remark :获取自定义模块列表
* @name :ModuleList
* @author :lyh
* @method :post
* @time :2023/12/4 15:43
*/
public function list(CustomModuleExtend $customModuleExtend){
$this->map['project_id'] = $this->user['project_id'];
$lists = $customModuleExtend->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取当前数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/12/4 16:09
*/
public function info(CustomModuleExtendLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$info = $logic->getCustomModuleExtendInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/12/4 15:45
*/
public function save(CustomModuleExtendLogic $logic){
$logic->customModuleExtendSave();
$this->response('success');
}
/**
* @remark :删除数据
* @name :del
* @author :lyh
* @method :post
* @time :2023/12/4 16:14
*/
public function del(CustomModuleExtendLogic $logic){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => 'ID不能为空',
]);
$logic->customModuleExtendDel();
$this->response('success');
}
}
... ...
... ... @@ -21,11 +21,11 @@ class NavController extends BaseController
/**
* 列表数据
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @author:dc
* @time 2023/5/8 16:37
* @remark :获取列表数据
* @name :index
* @author :lyh
* @method :post
* @time :2023/12/4 15:00
*/
public function index(BNav $nav){
$this->map['project_id'] = $this->user['project_id'];
... ... @@ -42,6 +42,19 @@ class NavController extends BaseController
}
/**
* @remark :获取当前id下的所有子集
* @name :getSubList
* @author :lyh
* @method :post
* @time :2023/12/4 15:04
*/
public function getSubList(NavLogic $logic){
$data = $logic->getSubList();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存数据
* @name :save
... ...
... ... @@ -35,7 +35,7 @@ class OnlineCheckLogic extends BaseLogic
$optimizeInfo = $optimizeModel->read(['project_id'=>$this->param['id']]);
//查看当前用户是否有权限审核
if($this->param['type'] == 'optimist'){
if(($info['optimist_mid'] != $this->manager['id']) && ($optimizeInfo['assist_mid'] != $this->manager['id'])){
if(($optimizeInfo['optimist_mid'] != $this->manager['id']) && ($optimizeInfo['assist_mid'] != $this->manager['id'])){
$this->fail('你无权限提交审核');
}
}else{
... ... @@ -43,7 +43,7 @@ class OnlineCheckLogic extends BaseLogic
if($info['optimist_status'] != 1){
$this->fail('请先优化师审核');
}
if($info['qa_mid'] != 0 && $info['qa_mid'] != $this->manager['id']){
if(($info['qa_mid'] != 0) && ($info['qa_mid'] != $this->manager['id'])){
$this->fail('你无权限提交审核');
}
if(isset($this->param['project_type']) && !empty($this->param['project_type'])){
... ... @@ -73,7 +73,7 @@ class OnlineCheckLogic extends BaseLogic
$this->fail('已提交,请勿重复提交');
}else{
if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){
$this->fail('请先选择优化师和品控');
$this->fail('请先选择优化师和品控,在提交审核');
}
//组装数据
$data = [
... ... @@ -90,7 +90,7 @@ class OnlineCheckLogic extends BaseLogic
}
$projectModel = new Project();
//提交审核修改状态为审核中
$projectModel->edit(['status'=>1],['id'=>$info['project_id']]);
$projectModel->edit(['status'=>1],['id'=>$this->param['id']]);
return $this->success();
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleCategoryLogic.php
* @author :lyh
* @method :post
* @time :2023/12/4 16:07
*/
namespace App\Http\Logic\Bside\CustomModule;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\CustomModule\CustomModuleCategory;
class CustomModuleCategoryLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new CustomModuleCategory();
}
/**
* @remark :获取当前数据详情
* @name :getCustomModuleInfo
* @author :lyh
* @method :post
* @time :2023/12/4 16:10
*/
public function getCustomModuleCategoryInfo(){
}
/**
* @remark :保存数据
* @name :ModuleSave
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleCategorySave(){
}
/**
* @remark :删除数据
* @name :ModuleDel
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleCategoryDel(){
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleContentLogic.php
* @author :lyh
* @method :post
* @time :2023/12/4 16:06
*/
namespace App\Http\Logic\Bside\CustomModule;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\CustomModule\CustomModuleContent;
class CustomModuleContentLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new CustomModuleContent();
}
/**
* @remark :获取当前数据详情
* @name :getCustomModuleInfo
* @author :lyh
* @method :post
* @time :2023/12/4 16:10
*/
public function getCustomModuleContentInfo(){
}
/**
* @remark :保存数据
* @name :ModuleSave
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleContentSave(){
}
/**
* @remark :删除数据
* @name :ModuleDel
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleContentDel(){
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleExtendLogic.php
* @author :lyh
* @method :post
* @time :2023/12/4 16:07
*/
namespace App\Http\Logic\Bside\CustomModule;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\CustomModule\CustomModuleExtend;
class CustomModuleExtendLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new CustomModuleExtend();
}
/**
* @remark :获取当前数据详情
* @name :getCustomModuleInfo
* @author :lyh
* @method :post
* @time :2023/12/4 16:10
*/
public function getCustomModuleExtendInfo(){
}
/**
* @remark :保存数据
* @name :ModuleSave
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleExtendSave(){
}
/**
* @remark :删除数据
* @name :ModuleDel
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleExtendDel(){
}
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleLogic.php
* @author :lyh
* @method :post
* @time :2023/12/4 15:46
*/
namespace App\Http\Logic\Bside\CustomModule;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\CustomModule\CustomModule;
class CustomModuleLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new CustomModule();
}
/**
* @remark :获取当前数据详情
* @name :getCustomModuleInfo
* @author :lyh
* @method :post
* @time :2023/12/4 16:10
*/
public function getCustomModuleInfo(){
}
/**
* @remark :保存数据
* @name :ModuleSave
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleSave(){
}
/**
* @remark :删除数据
* @name :ModuleDel
* @author :lyh
* @method :post
* @time :2023/12/4 15:47
*/
public function customModuleDel(){
}
}
... ...
... ... @@ -26,6 +26,52 @@ class NavLogic extends BaseLogic
$this->model = new BNav();
}
/**
* @remark :获取当前id下所有子集
* @name :getSubList
* @author :lyh
* @method :post
* @time :2023/12/4 15:11
*/
public function getSubList(){
//编辑时
if(isset($this->param['id']) && !empty($this->param['id'])) {
$str = [];
//排序掉当前id下所有子集
$str = $this->getAllSub($this->param['id'], $str);
$str[] = $this->param['id'];
$this->param['id'] = ['not in', $str];
}
$this->param['project_id'] = $this->user['project_id'];
$list = $this->model->list($this->param);
$data = array();
foreach ($list as $v){
$v = (array)$v;
if ($v['pid'] == 0) {
$v['sub'] = _get_child($v['id'], $list);
$data[] = $v;
}
}
return $this->success($data);
}
/**
* @remark :获取当前id下所有子集
* @name :getAllSub
* @author :lyh
* @method :post
* @time :2023/10/18 15:10
*/
public function getAllSub($id,&$str = []){
$list = $this->model->list(['pid'=>$id,'status'=>1],['id','pid']);
if(!empty($list)){
foreach ($list as $v){
$str[] = $v['id'];
$this->getAllSub($v['id'],$str);
}
}
return $str;
}
/**
* @remark :保存数据
... ... @@ -71,10 +117,10 @@ class NavLogic extends BaseLogic
if($this->param['pid'] == $info['id']){
$this->fail('不允许成为自己的上级');
}
$pid_info = $this->model->read(['pid'=>$this->param['id']]);
if(($pid_info !== false) && $this->param['pid'] != $info['pid']){
$this->fail('当前菜单拥有子集不允许修改上级');
}
// $pid_info = $this->model->read(['pid'=>$this->param['id']]);
// if(($pid_info !== false) && $this->param['pid'] != $info['pid']){
// $this->fail('当前菜单拥有子集不允许修改上级');
// }
return $this->success();
}
... ...
<?php
/**
* @remark :
* @name :CustomModuleLabel.php
* @name :CustomModuleExtend.php
* @author :lyh
* @method :post
* @time :2023/11/6 10:05
* @time :2023/12/4 15:42
*/
namespace App\Models\CustomModule;
use App\Models\Base;
class CustomModuleLabel extends Base
class CustomModuleExtend extends Base
{
protected $table = 'gl_custom_module_label';
protected $table = 'gl_custom_module_extent';
}
... ...
... ... @@ -363,6 +363,7 @@ Route::middleware(['bloginauth'])->group(function () {
// 导航栏编辑
Route::prefix('nav')->group(function () {
Route::get('/', [\App\Http\Controllers\Bside\Nav\NavController::class, 'index'])->name('nav');
Route::any('/get', [\App\Http\Controllers\Bside\Nav\NavController::class, 'getSubList'])->name('nav_getSubList');
Route::post('/create', [\App\Http\Controllers\Bside\Nav\NavController::class, 'save'])->name('nav_create');
Route::post('/update', [\App\Http\Controllers\Bside\Nav\NavController::class, 'save'])->name('nav_update');
Route::delete('/delete', [\App\Http\Controllers\Bside\Nav\NavController::class, 'delete'])->name('nav_delete');
... ...