|
...
|
...
|
@@ -37,13 +37,18 @@ class ProjectWhiteHatAffixController extends BaseController |
|
|
|
* @time :2025/6/23 11:00
|
|
|
|
* @param :project_id->项目id
|
|
|
|
*/
|
|
|
|
public function read(){
|
|
|
|
public function list(){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
'type'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => '项目id不能为空',
|
|
|
|
'type.required' => '类型不能为空',
|
|
|
|
]);
|
|
|
|
$data = $this->model->read($this->map);
|
|
|
|
if(isset($this->map['project_id']) && !empty($this->map['project_id'])){
|
|
|
|
$this->map['project_id'] = ['in',[0,$this->map['project_id']]];
|
|
|
|
}
|
|
|
|
$data = $this->model->list($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -60,12 +65,12 @@ class ProjectWhiteHatAffixController extends BaseController |
|
|
|
public function save(){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
'prefix'=>'required',
|
|
|
|
'suffix'=>'required',
|
|
|
|
'name'=>'required',
|
|
|
|
'type'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => '项目id不能为空',
|
|
|
|
'prefix.required' => '前缀不能为空,一行一个',
|
|
|
|
'suffix.required' => '项目id不能为空,一行一个',
|
|
|
|
'name.required' => '前后缀名称不能为空',
|
|
|
|
'type.required' => '类型不能为空',
|
|
|
|
]);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
...
|
...
|
@@ -75,4 +80,20 @@ class ProjectWhiteHatAffixController extends BaseController |
|
|
|
$this->response('success',Code::SUCCESS,['id'=>$id]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除数据
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/6/23 11:08
|
|
|
|
*/
|
|
|
|
public function del(){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '项目id不能为空',
|
|
|
|
]);
|
|
|
|
$data = $this->model->del(['id'=>$this->param['id']]);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|