|
...
|
...
|
@@ -8,6 +8,7 @@ use App\Http\Logic\Aside\Template\ATemplateLogic; |
|
|
|
use App\Http\Logic\Aside\Template\ATemplateModuleLogic;
|
|
|
|
use App\Http\Requests\Aside\Template\ATemplateModuleRequest;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Template\TemplateLabel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :左侧模块管理
|
|
...
|
...
|
@@ -25,11 +26,37 @@ class ATemplateModuleController extends BaseController |
|
|
|
* @time :2023/6/28 16:54
|
|
|
|
*/
|
|
|
|
public function lists(ATemplateModuleLogic $ATemplateModuleLogic){
|
|
|
|
$lists = $ATemplateModuleLogic->aTemplateModuleLists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
$templateLabel = new TemplateLabel();
|
|
|
|
$this->map['deleted_status'] = 0;
|
|
|
|
$this->searchLabelName($templateLabel);
|
|
|
|
$lists = $ATemplateModuleLogic->lists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
if(!empty($lists) && !empty($lists['list'])){
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
$v['label'] = $templateLabel->list(['template_id'=>$v['id'],'type'=>2],'id',['id','name'],'desc',5);
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :搜索label
|
|
|
|
* @name :searchLabelName
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/6/3 11:11
|
|
|
|
*/
|
|
|
|
public function searchLabelName($templateLabel){
|
|
|
|
if(isset($this->map['label_name']) && !empty($this->map['label_name'])){
|
|
|
|
$id_arr = $templateLabel->formatQuery(['name'=>['like','%'.$this->map['label_name'].'%'],'type'=>2])->pluck('template_id')->toArray();
|
|
|
|
$this->map['id'] = ['in',$id_arr];
|
|
|
|
unset($this->map['label_name']);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :左侧模块保存
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
...
|
...
|
|