-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ashu555
committed
Feb 1, 2020
1 parent
fb7a452
commit 39f664f
Showing
16 changed files
with
154 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,8 @@ public function advanceSearch( | |
$till = '', | ||
$domain = '', | ||
$paidUnpaid = '', | ||
$allInstallation = '' | ||
$allInstallation = '', | ||
$version = '' | ||
) { | ||
try { | ||
$join = Order::leftJoin('subscriptions', 'orders.id', '=', 'subscriptions.order_id'); | ||
|
@@ -52,6 +53,7 @@ public function advanceSearch( | |
$this->domain($domain, $join); | ||
$this->paidOrUnpaid($paidUnpaid,$join); | ||
$this->allInstallations($allInstallation,$join); | ||
$this->getSelectedVersionOrders($version,$join); | ||
$join = $join->orderBy('created_at', 'desc') | ||
->select( | ||
'orders.id', | ||
|
@@ -70,6 +72,29 @@ public function advanceSearch( | |
} | ||
} | ||
|
||
|
||
/** | ||
* Searches for order for selected versions | ||
* | ||
* @author Ashutosh Pathak <[email protected]> | ||
* | ||
* | ||
* @param string $version | ||
* @param App\Model\Order $join The order instance | ||
* | ||
* @return $join | ||
*/ | ||
private function getSelectedVersionOrders($version,$join) | ||
{ | ||
if($version) { | ||
$currentVer = ($version[0] == 'v') ? $version : 'v'.$version; | ||
$join = $join->whereHas('subscription', function($query) use($currentVer) { | ||
$query->where('version', '=', $currentVer); | ||
}); | ||
} | ||
return $join; | ||
} | ||
|
||
/** | ||
* Searches for Active/Inactive Installation | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.