作者 lyh

gx

@@ -62,12 +62,9 @@ class NewsCategoryLogic extends BaseLogic @@ -62,12 +62,9 @@ class NewsCategoryLogic extends BaseLogic
62 if($info !== false){ 62 if($info !== false){
63 $this->fail('当前分类名称已存在'); 63 $this->fail('当前分类名称已存在');
64 } 64 }
  65 + //参数处理
  66 + $this->param = $this->addParamProcessing($this->param);
65 DB::beginTransaction(); 67 DB::beginTransaction();
66 - $this->param['project_id'] = $this->user['project_id'];  
67 - $this->param['operator_id'] = $this->user['id'];  
68 - $this->param['create_id'] = $this->user['id'];  
69 - $this->param['created_at'] = date('Y-m-d H:i:s');  
70 - $this->param['updated_at'] = date('Y-m-d H:i:s');  
71 try { 68 try {
72 $cate_id = $this->model->insertGetId($this->param); 69 $cate_id = $this->model->insertGetId($this->param);
73 if(isset($this->param['pid']) && !empty($this->param['pid'])) { 70 if(isset($this->param['pid']) && !empty($this->param['pid'])) {
@@ -188,4 +185,33 @@ class NewsCategoryLogic extends BaseLogic @@ -188,4 +185,33 @@ class NewsCategoryLogic extends BaseLogic
188 $list = $this->model->list($map); 185 $list = $this->model->list($map);
189 return $this->success($list); 186 return $this->success($list);
190 } 187 }
  188 +
  189 + public function verifyParam(){
  190 +
  191 + }
  192 +
  193 + /**
  194 + * @name :(参数处理)paramProcessing
  195 + * @author :lyh
  196 + * @method :post
  197 + * @time :2023/6/13 11:30
  198 + */
  199 + public function addParamProcessing($param){
  200 + $param['project_id'] = $this->user['project_id'];
  201 + $param['operator_id'] = $this->user['id'];
  202 + $param['create_id'] = $this->user['id'];
  203 + $param['created_at'] = date('Y-m-d H:i:s');
  204 + $param['updated_at'] = date('Y-m-d H:i:s');
  205 + return $this->success($param);
  206 + }
  207 +
  208 + /**
  209 + * @name :(添加分类时处理子集分类)addProcessingSon
  210 + * @author :lyh
  211 + * @method :post
  212 + * @time :2023/6/13 11:34
  213 + */
  214 + public function addProcessingSon(){
  215 +
  216 + }
191 } 217 }