|
...
|
...
|
@@ -55,13 +55,6 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function add_news_category(){
|
|
|
|
$condition = [
|
|
|
|
'name'=>$this->param['name']
|
|
|
|
];
|
|
|
|
$info = $this->model->read($condition);
|
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前分类名称已存在');
|
|
|
|
}
|
|
|
|
//参数处理
|
|
|
|
$this->param = $this->addParamProcessing($this->param);
|
|
|
|
DB::beginTransaction();
|
|
...
|
...
|
@@ -186,8 +179,28 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
return $this->success($list);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verifyParam(){
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(验证名称是否存在)verifyParamName
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/13 11:41
|
|
|
|
*/
|
|
|
|
public function verifyParamName(){
|
|
|
|
if(isset($this->param['id'])){
|
|
|
|
$condition = [
|
|
|
|
'id'=>['!=',$this->param['id']],
|
|
|
|
'name'=>$this->param['name'],
|
|
|
|
];
|
|
|
|
}else{
|
|
|
|
$condition = [
|
|
|
|
'name'=>$this->param['name']
|
|
|
|
];
|
|
|
|
}
|
|
|
|
$info = $this->model->read($condition);
|
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前分类名称已存在');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|