|
@@ -67,14 +67,10 @@ class BasicPanel extends Controller
|
|
|
// 低价挂网商品数量查询
|
|
// 低价挂网商品数量查询
|
|
|
$lowPriceGoodsCount = $lowPriceGoodsModel->where($map)
|
|
$lowPriceGoodsCount = $lowPriceGoodsModel->where($map)
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
- ->groupBy('product_name')
|
|
|
|
|
- ->select('product_name')
|
|
|
|
|
->get()->count();
|
|
->get()->count();
|
|
|
// 禁止挂网商品数量查询
|
|
// 禁止挂网商品数量查询
|
|
|
$violationProductCount = $violationProductModel->where($map)
|
|
$violationProductCount = $violationProductModel->where($map)
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
- ->groupBy('product_name')
|
|
|
|
|
- ->select('product_name')
|
|
|
|
|
->get()->count();
|
|
->get()->count();
|
|
|
|
|
|
|
|
$store_map = [];
|
|
$store_map = [];
|
|
@@ -83,15 +79,22 @@ class BasicPanel extends Controller
|
|
|
// 违规店铺数量查询
|
|
// 违规店铺数量查询
|
|
|
$violationStoreCount = $violationStoreModel->where($store_map)
|
|
$violationStoreCount = $violationStoreModel->where($store_map)
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
- ->groupBy('company_name')
|
|
|
|
|
- ->select('company_name')
|
|
|
|
|
|
|
+ ->groupBy('store_name')
|
|
|
|
|
+ ->select('store_name')
|
|
|
->get()->count();
|
|
->get()->count();
|
|
|
|
|
|
|
|
//获取终端类型B端、C端、OTO,配置品规数量
|
|
//获取终端类型B端、C端、OTO,配置品规数量
|
|
|
$productModel = new ProductModel();
|
|
$productModel = new ProductModel();
|
|
|
$productModel_map = [];
|
|
$productModel_map = [];
|
|
|
- if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
|
|
- if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
|
|
|
|
+ $productModel_other_map = [];
|
|
|
|
|
+ if ($start_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($end_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '<=', $end_time];
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '!=', '0'];
|
|
|
|
|
+ }
|
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
|
} else {
|
|
} else {
|
|
@@ -107,6 +110,7 @@ class BasicPanel extends Controller
|
|
|
})
|
|
})
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
->where($productModel_map)
|
|
->where($productModel_map)
|
|
|
|
|
+ ->whereOr($productModel_other_map)
|
|
|
->distinct('product_name')
|
|
->distinct('product_name')
|
|
|
->pluck('product_name');
|
|
->pluck('product_name');
|
|
|
|
|
|
|
@@ -121,8 +125,15 @@ class BasicPanel extends Controller
|
|
|
|
|
|
|
|
$productModel = new ProductModel();
|
|
$productModel = new ProductModel();
|
|
|
$productModel_map = [];
|
|
$productModel_map = [];
|
|
|
- if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
|
|
- if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
|
|
|
|
+ $productModel_other_map = [];
|
|
|
|
|
+ if ($start_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($end_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '<=', $end_time];
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '!=', '0'];
|
|
|
|
|
+ }
|
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
|
} else {
|
|
} else {
|
|
@@ -138,6 +149,7 @@ class BasicPanel extends Controller
|
|
|
})
|
|
})
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
->where($productModel_map)
|
|
->where($productModel_map)
|
|
|
|
|
+ ->whereOr($productModel_other_map)
|
|
|
->distinct('product_name')
|
|
->distinct('product_name')
|
|
|
->pluck('product_name');
|
|
->pluck('product_name');
|
|
|
|
|
|
|
@@ -152,8 +164,15 @@ class BasicPanel extends Controller
|
|
|
|
|
|
|
|
$productModel = new ProductModel();
|
|
$productModel = new ProductModel();
|
|
|
$productModel_map = [];
|
|
$productModel_map = [];
|
|
|
- if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
|
|
- if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
|
|
|
|
+ $productModel_other_map = [];
|
|
|
|
|
+ if ($start_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($end_time){
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '<=', $end_time];
|
|
|
|
|
+ $productModel_map[] = ['sampling_end_time', '!=', '0'];
|
|
|
|
|
+ }
|
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
if ($is_admin != 1 && $company_id != 0) {
|
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
$productModel = $productModel->where('company_id', $company_id);
|
|
|
} else {
|
|
} else {
|
|
@@ -169,6 +188,7 @@ class BasicPanel extends Controller
|
|
|
})
|
|
})
|
|
|
->where('status', 0)
|
|
->where('status', 0)
|
|
|
->where($productModel_map)
|
|
->where($productModel_map)
|
|
|
|
|
+ ->whereOr($productModel_other_map)
|
|
|
->distinct('product_name')
|
|
->distinct('product_name')
|
|
|
->pluck('product_name');
|
|
->pluck('product_name');
|
|
|
|
|
|