Commit b3db4df6 by 杨树贤

优化统计展示

parent 2e382534
Showing with 12 additions and 12 deletions
......@@ -1217,7 +1217,7 @@ class DataService
} else {
$ruler['upload_allow_brands'] = $mainBrands;
}
dump($supplier['supplier_id'],$ruler);
dump($supplier['supplier_id'], $ruler);
$redis->hset('supplier_sku_upload_ruler_v2', $supplier['supplier_id'], json_encode($ruler));
}
}
......@@ -1255,11 +1255,11 @@ class DataService
//找出哪些是云芯上传的
$yunxinUploadSupplierCodes = SkuUploadLogModel::whereIn('supplier_code', $yunxinSupplierCodes)->where('source', 2)->pluck('supplier_code')->unique()->toArray();
$skuNumYunxin = SupplierChannelModel::whereIn('supplier_code', $yunxinUploadSupplierCodes)->sum('sku_num');
dump("上架供应商数(不含代购,原厂):" . $supplierCount);
dump("上架云芯供应商数:" . count($yunxinUploadSupplierCodes));
dump("SKU 上架总条数(含API接口):" . $skuNum1);
dump("SKU上架总条数(只含云芯):" . $skuNumYunxin);
dump("SKU 上架条数(不含API接口):" . $skuNum2);
echo("<p>上架供应商数(不含代购,原厂):" . $supplierCount . '</p>');
echo("<p>上架云芯供应商数:" . count($yunxinUploadSupplierCodes) . '</p>');
echo("<p>SKU 上架总条数(含API接口):" . $skuNum1 . '</p>');
echo("<p>SKU上架总条数(只含云芯):" . $skuNumYunxin . '</p>');
echo("<p>SKU 上架条数(不含API接口):" . $skuNum2 . '</p>');
}
//获取采购系统24号作废的深圳入库明细
......@@ -1359,26 +1359,26 @@ class DataService
}
}
foreach ($allBrandsGroupBySupplierCode as $supplierCode => $brands) {
$supplier = SupplierChannelModel::select(['main_brands','supplier_id','supplier_code'])->where('supplier_code', $supplierCode)->first();
$supplier = SupplierChannelModel::select(['main_brands', 'supplier_id', 'supplier_code'])->where('supplier_code', $supplierCode)->first();
if (empty($supplier)) {
continue;
}
$supplier = $supplier->toArray();
$supplier['main_brands'] = trim($supplier['main_brands'], ',');
dump('供应商编码 : '.$supplierCode);
dump('供应商编码 : ' . $supplierCode);
//找出所有标品的id
$standardBrandIds = StandardBrandModel::whereIn('brand_name', $brands)->pluck('standard_brand_id')->toArray();
dump('excel得出的标品ids : '.implode(',', $standardBrandIds));
dump('excel得出的标品ids : ' . implode(',', $standardBrandIds));
if ($supplier['main_brands']) {
dump('原来有标品id :'. $supplier['main_brands']);
dump('原来有标品id :' . $supplier['main_brands']);
$supplier['main_brands'] = explode(',', $supplier['main_brands']);
$mainBrands = array_merge($supplier['main_brands'],$standardBrandIds);
$mainBrands = array_merge($supplier['main_brands'], $standardBrandIds);
} else {
$mainBrands = $standardBrandIds;
}
$mainBrands = implode(',', $mainBrands);
if ($isUpdate) {
SupplierChannelModel::where('supplier_code',$supplierCode)->update([
SupplierChannelModel::where('supplier_code', $supplierCode)->update([
'main_brands' => $mainBrands,
]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment