|
...
|
...
|
@@ -25,17 +25,14 @@ class ATemplateController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/28 16:34
|
|
|
|
*/
|
|
|
|
public function lists(ATemplateLogic $aTemplateLogic,TemplateLabel $templateLabel){
|
|
|
|
if(isset($this->map['label_name']) && !empty($this->map['label_name'])){
|
|
|
|
$id_arr = $templateLabel->formatQuery(['name'=>['like','%'.$this->map['label_name'].'%']])->pluck('template_id')->toArray();
|
|
|
|
$this->map['id'] = ['in',$id_arr];
|
|
|
|
unset($this->map['label_name']);
|
|
|
|
}
|
|
|
|
public function lists(ATemplateLogic $aTemplateLogic){
|
|
|
|
$templateLabel = new TemplateLabel();
|
|
|
|
$this->searchLabelName($templateLabel);
|
|
|
|
$filed = ['id','name','image','url','status','sort','deleted_status','test_model','created_at','project_id'];
|
|
|
|
$lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order,$filed);
|
|
|
|
if(!empty($lists) && !empty($lists['list'])){
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
$v['label'] = $templateLabel->list(['template_id'=>$v['id']],'id',['id','name'],'desc',5);
|
|
|
|
$v['label'] = $templateLabel->list(['template_id'=>$v['id'],'type'=>1],'id',['id','name'],'desc',5);
|
|
|
|
$v['image_link'] = getImageUrl($v['image']);
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
...
|
...
|
@@ -44,6 +41,22 @@ class ATemplateController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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'].'%']])->pluck('template_id')->toArray();
|
|
|
|
$this->map['id'] = ['in',$id_arr];
|
|
|
|
unset($this->map['label_name']);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取选择的模版
|
|
|
|
* @name :getTemplateInfo
|
|
|
|
* @author :lyh
|
...
|
...
|
|