mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Expand Invoice Searching
This commit is contained in:
@@ -73,8 +73,8 @@ namespace BTCPayServer.Controllers
|
|||||||
Skip = offset,
|
Skip = offset,
|
||||||
EndDate = dateEnd,
|
EndDate = dateEnd,
|
||||||
StartDate = dateStart,
|
StartDate = dateStart,
|
||||||
OrderId = orderId,
|
OrderId = orderId == null ? null : new[] { orderId },
|
||||||
ItemCode = itemCode,
|
ItemCode = itemCode == null ? null : new[] { itemCode },
|
||||||
Status = status == null ? null : new[] { status },
|
Status = status == null ? null : new[] { status },
|
||||||
StoreId = new[] { this.HttpContext.GetStoreData().Id }
|
StoreId = new[] { this.HttpContext.GetStoreData().Id }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -463,11 +463,16 @@ retry:
|
|||||||
if (queryObject.EndDate != null)
|
if (queryObject.EndDate != null)
|
||||||
query = query.Where(i => i.Created <= queryObject.EndDate.Value);
|
query = query.Where(i => i.Created <= queryObject.EndDate.Value);
|
||||||
|
|
||||||
if (queryObject.ItemCode != null)
|
if (queryObject.OrderId != null && queryObject.OrderId.Length > 0)
|
||||||
query = query.Where(i => i.ItemCode == queryObject.ItemCode);
|
{
|
||||||
|
var statusSet = queryObject.OrderId.ToHashSet();
|
||||||
if (queryObject.OrderId != null)
|
query = query.Where(i => statusSet.Contains(i.OrderId));
|
||||||
query = query.Where(i => i.OrderId == queryObject.OrderId);
|
}
|
||||||
|
if (queryObject.ItemCode != null && queryObject.ItemCode.Length > 0)
|
||||||
|
{
|
||||||
|
var statusSet = queryObject.ItemCode.ToHashSet();
|
||||||
|
query = query.Where(i => statusSet.Contains(i.ItemCode));
|
||||||
|
}
|
||||||
|
|
||||||
if (queryObject.Status != null && queryObject.Status.Length > 0)
|
if (queryObject.Status != null && queryObject.Status.Length > 0)
|
||||||
{
|
{
|
||||||
@@ -694,12 +699,12 @@ retry:
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string OrderId
|
public string[] OrderId
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ItemCode
|
public string[] ItemCode
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>storeid:id</code> for filtering a specific store</li>
|
<li><code>storeid:id</code> for filtering a specific store</li>
|
||||||
|
<li><code>orderid:id</code> for filtering a specific order</li>
|
||||||
|
<li><code>itemcode:code</code> for filtering a specific type of item purchased through the pos or crowdfund apps</li>
|
||||||
<li><code>status:(expired|invalid|complete|confirmed|paid|new)</code> for filtering a specific status</li>
|
<li><code>status:(expired|invalid|complete|confirmed|paid|new)</code> for filtering a specific status</li>
|
||||||
<li><code>exceptionstatus:(paidover|paidlate|paidpartial)</code> for filtering a specific exception state</li>
|
<li><code>exceptionstatus:(paidover|paidlate|paidpartial)</code> for filtering a specific exception state</li>
|
||||||
<li><code>unusual:(true|false)</code> for filtering invoices which might requires merchant attention (those invalid or with an exceptionstatus)</li>
|
<li><code>unusual:(true|false)</code> for filtering invoices which might requires merchant attention (those invalid or with an exceptionstatus)</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user