作者 lyh

gx

@@ -30,6 +30,15 @@ class DeptLogic extends BaseLogic @@ -30,6 +30,15 @@ class DeptLogic extends BaseLogic
30 */ 30 */
31 public function deptSave(){ 31 public function deptSave(){
32 if(isset($this->param['id']) && !empty($this->param['id'])){ 32 if(isset($this->param['id']) && !empty($this->param['id'])){
  33 + if(isset($this->param['pid']) && !empty($this->param['pid'])){
  34 + if($this->param['pid'] == $this->param['id']){
  35 + $this->fail('当前上级分类不能为自己');
  36 + }
  37 + $info = $this->model->read(['id'=>$this->param['pid']]);
  38 + if($info !== false && ($this->param['id']) == $info['pid']){
  39 + $this->fail('不能选择自己的下级');
  40 + }
  41 + }
33 $this->model->edit($this->param,['id'=>$this->param['id']]); 42 $this->model->edit($this->param,['id'=>$this->param['id']]);
34 }else{ 43 }else{
35 $this->model->add($this->param); 44 $this->model->add($this->param);
@@ -80,6 +80,8 @@ class KeywordLogic extends BaseLogic @@ -80,6 +80,8 @@ class KeywordLogic extends BaseLogic
80 */ 80 */
81 public function batchAdd(){ 81 public function batchAdd(){
82 $ids = []; 82 $ids = [];
  83 + var_dump($this->param['title']);
  84 + die();
83 if(!empty($this->param['title']) && is_array($this->param['title'])){ 85 if(!empty($this->param['title']) && is_array($this->param['title'])){
84 foreach ($this->param['title'] as $k => $v){ 86 foreach ($this->param['title'] as $k => $v){
85 $param['project_id'] = $this->user['project_id']; 87 $param['project_id'] = $this->user['project_id'];