| | |
| | | public function add($data) |
| | | { |
| | | $data['app_id'] = self::$app_id; |
| | | $isExist = static::where('name','=',$data['name'])->find(); |
| | | $isExist = static::where('name','=',$data['name'])->where('category_type','=',$data['category_type'])->find(); |
| | | if($isExist){ |
| | | $this->error='名称已存在'; |
| | | return false; |
| | |
| | | */ |
| | | public function edit($data) |
| | | { |
| | | $isExist = static::where('name','=',$data['name'])->where('category_id','<>',$data['category_id'])->find(); |
| | | $isExist = static::where('name','=',$data['name'])->where('category_type','=',$data['category_type'])->where('category_id','<>',$data['category_id'])->find(); |
| | | if($isExist){ |
| | | $this->error='名称已存在'; |
| | | return false; |