修复分类显示与筛选

This commit is contained in:
evoxwht 2023-04-03 15:58:43 +08:00
parent 403bb34b81
commit 092e52d9fd
3 changed files with 2 additions and 3 deletions

View File

@ -15,6 +15,7 @@ Route::group('product', function () {
Route::get('category', 'v1.product.StoreCategory/index')->option(['real_name' => '商品分类列表']);
//商品树形列表
Route::get('category/tree/:type', 'v1.product.StoreCategory/tree_list')->option(['real_name' => '商品分类树形列表']);
Route::get('category/cascader/:type', 'v1.product.StoreCategory/cascader_list')->option(['real_name' => '商品分类树形列表']);
//商品分类新增表单
Route::get('category/create', 'v1.product.StoreCategory/create')->option(['real_name' => '商品分类新增表单']);
//商品分类新增

View File

@ -310,7 +310,7 @@ abstract class BaseDao
if ($responses->hasMethod($method)) {
$with[] = $key;
} else {
if ($key != 'timeKey') {
if (!in_array($key, ['timeKey', 'store_stock'])) {
$otherWhere[] = is_array($value) ? $value : [$key, '=', $value];
}
}

View File

@ -326,8 +326,6 @@ class StoreProduct extends BaseModel
$query->whereIn('id', function ($query) use ($store_stock) {
$query->name('store_product_attr_value')->where('stock', '<', $store_stock)->where('stock', '>', 0)->where('type', 0)->field('product_id')->select();
});
// $query->where(['is_show' => 1, 'is_del' => 0])->where('stock', '<=', $store_stock)->where('stock', '>', 0);
} else {
$query->where(['is_show' => 1, 'is_del' => 0])->where('stock', '>', 0);
}