post(); $result = validate($this->validateName)->check($data,[],''); if(true !== $result){ $this->error = validate($this->validateName)->getError(); return false; } $id = $data['id']; if(isset($data['cert_path']) && !empty($data['cert_path'])){ $cert_path = parse_url($data['cert_path']); $data['cert_path'] = $cert_path['path']; } if(isset($data['key_path']) && !empty($data['key_path'])){ $cert_path = parse_url($data['key_path']); $data['key_path'] = $cert_path['path']; } unset($data['id']); if($id > 0){ $data['update_time'] = date('Y-m-d H:i:s'); $ret = $this->allowField(true)->save($data,['id'=>$id]); }else{ $data['create_time'] = date('Y-m-d H:i:s'); $ret = $this->allowField(true)->save($data); } if(!$ret){ $this->error = '操作失败'; return false; } return true; } public function getList(){ $list =$this ->where('org_id',cur_org_id()) ->where('del',0) ->where('enable',1) ->select() ->toArray(); return $list; } }