|
|
@@ -95,34 +95,78 @@ class BasicPanel extends Controller
|
|
|
if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
|
|
|
- $collect_b_product_count = $productModel->where(function ($query) {
|
|
|
- $platforms = ['0', '5', '6', '7', '8', '9', '10'];
|
|
|
- foreach ($platforms as $platform) {
|
|
|
- $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
- }
|
|
|
- })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
+ $productNames = $productModel
|
|
|
+ ->where(function ($query) {
|
|
|
+ $platforms = ['0', '5', '6', '7', '8', '9', '10'];
|
|
|
+ foreach ($platforms as $platform) {
|
|
|
+ $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->distinct('product_name')
|
|
|
+ ->pluck('product_name');
|
|
|
+
|
|
|
+ $collect_b_product_count = $productModel
|
|
|
+ ->whereIn('product_name', $productNames)
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->sum('product_specs_number');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
$productModel = new ProductModel();
|
|
|
$productModel_map = [];
|
|
|
if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
- $collect_c_product_count = $productModel->where(function ($query) {
|
|
|
- $platforms = ['0', '1', '2', '3', '4'];
|
|
|
- foreach ($platforms as $platform) {
|
|
|
- $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
- }
|
|
|
- })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
+
|
|
|
+ $productNames = $productModel
|
|
|
+ ->where(function ($query) {
|
|
|
+ $platforms = ['0', '1', '2', '3', '4'];
|
|
|
+ foreach ($platforms as $platform) {
|
|
|
+ $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->distinct('product_name')
|
|
|
+ ->pluck('product_name');
|
|
|
+
|
|
|
+ $collect_c_product_count = $productModel
|
|
|
+ ->whereIn('product_name', $productNames)
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->sum('product_specs_number');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
$productModel = new ProductModel();
|
|
|
$productModel_map = [];
|
|
|
if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
- $collect_oto_product_count = $productModel->where(function ($query) {
|
|
|
- $platforms = ['0'];
|
|
|
- foreach ($platforms as $platform) {
|
|
|
- $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
- }
|
|
|
- })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
+
|
|
|
+
|
|
|
+ $productNames = $productModel
|
|
|
+ ->where(function ($query) {
|
|
|
+ $platforms = ['0'];
|
|
|
+ foreach ($platforms as $platform) {
|
|
|
+ $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->distinct('product_name')
|
|
|
+ ->pluck('product_name');
|
|
|
+
|
|
|
+ $collect_oto_product_count = $productModel
|
|
|
+ ->whereIn('product_name', $productNames)
|
|
|
+ ->where('status', 0)
|
|
|
+ ->where($productModel_map)
|
|
|
+ ->sum('product_specs_number');
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 所有终端品规数量
|
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count + $collect_oto_product_count;
|
|
|
@@ -183,10 +227,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -244,10 +288,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -313,10 +357,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -386,10 +430,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -449,10 +493,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -509,10 +553,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -571,10 +615,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|
|
|
@@ -641,10 +685,10 @@ class BasicPanel extends Controller
|
|
|
$platform = [];
|
|
|
switch ($terminal_type) {
|
|
|
case '1': //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药
|
|
|
- $platform = ['0','5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '5', '6', '7', '8', '9', '10']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '2': //C端:美团、拼多多、天猫、京东
|
|
|
- $platform = ['0','1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
+ $platform = ['0', '1', '2', '3', '4']; //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药
|
|
|
break;
|
|
|
case '3': //OTO:美团买药、淘宝闪送、京东秒送
|
|
|
$platform = ['0'];
|