fix(product): add queue goods filter and fix date range query
Support filtering by queue goods in admin product lists and correct product create-time range query to use add_time. Also update README default admin account note and restore app auth key config reference. Made-with: Cursor
This commit is contained in:
@@ -61,6 +61,7 @@ class StoreProduct extends AuthController
|
||||
['stock_range', ''],//库存区间
|
||||
['collect_range', ''],//收藏区间
|
||||
['product_clear', ''],//适用群体
|
||||
['is_queue_goods', ''],//报单商品
|
||||
]);
|
||||
|
||||
if ($this->adminType == 4) {
|
||||
@@ -201,6 +202,7 @@ class StoreProduct extends AuthController
|
||||
['stock_range', ''],//库存区间
|
||||
['collect_range', ''],//收藏区间
|
||||
['product_clear', ''],//适用群体
|
||||
['is_queue_goods', ''],//报单商品
|
||||
]);
|
||||
if ($this->adminType == 4) {
|
||||
$where['supplier_id'] = $this->adminId;
|
||||
|
||||
@@ -145,7 +145,7 @@ class StoreProductDao extends BaseDao
|
||||
$start_time = strtotime($create_range[0]);
|
||||
$end_time = strtotime($create_range[1]);
|
||||
if ($start_time && $end_time) {
|
||||
$query->whereBetween('price', [$start_time, $end_time]);
|
||||
$query->whereBetween('add_time', [$start_time, $end_time]);
|
||||
}
|
||||
})
|
||||
//活动类型
|
||||
|
||||
@@ -765,6 +765,11 @@ class StoreProduct extends BaseModel
|
||||
if ('' !== $value) $query->where('is_brokerage', $value);
|
||||
}
|
||||
|
||||
public function searchIsQueueGoodsAttr($query, $value)
|
||||
{
|
||||
if ('' !== $value) $query->where('is_queue_goods', $value);
|
||||
}
|
||||
|
||||
public function searchisChannelProductAttr($query, $value)
|
||||
{
|
||||
if ('' !== $value) $query->where('is_channel_product', $value);
|
||||
|
||||
Reference in New Issue
Block a user