Commit 78e85313 authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

issue seach ownertype

parent 72cee43a
...@@ -83,8 +83,10 @@ class SendPatchEdit extends Component ...@@ -83,8 +83,10 @@ class SendPatchEdit extends Component
if (!empty($this->cur_ver)) { if (!empty($this->cur_ver)) {
$query->where('CUR_VERSION', 'LIKE', '%' . $this->cur_ver . '%'); $query->where('CUR_VERSION', 'LIKE', '%' . $this->cur_ver . '%');
} }
if (!empty($this->selectedOwnerType)) {
$this->resultsServerkey = $query->take(50)->get(); $query->where('OWNERTYPE', $this->selectedOwnerType);
}
$this->resultsServerkey = $query->get();
$this->showSearch = true; $this->showSearch = true;
$this->searchInProgress = false; $this->searchInProgress = false;
} }
...@@ -112,17 +114,18 @@ class SendPatchEdit extends Component ...@@ -112,17 +114,18 @@ class SendPatchEdit extends Component
public function updatedSelectedOwnerType($value) public function updatedSelectedOwnerType($value)
{ {
if (!empty($value)) { // if (!empty($value)) {
$serverKeyOwnerType = $this->fetchServerKeyOption($value); // $serverKeyOwnerType = $this->fetchServerKeyOption($value);
if (count($serverKeyOwnerType) > 0) { // if (count($serverKeyOwnerType) > 0) {
foreach ($serverKeyOwnerType as $sk) { // foreach ($serverKeyOwnerType as $sk) {
$this->selectResult($sk["name"]); // $this->selectResult($sk["name"]);
} // }
} // }
} else { // } else {
$this->serverKeyOwnerType = []; // $this->serverKeyOwnerType = [];
} // }
$this->serverkey = ''; // $this->serverkey = '';
$this->searchResults();
} }
protected function fetchServerKeyOption($ownerType) protected function fetchServerKeyOption($ownerType)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment