Commit d28c0603 by 杨树贤

修改统计

parent 7f2699d3
Showing with 30 additions and 15 deletions
...@@ -145,7 +145,7 @@ class DataService ...@@ -145,7 +145,7 @@ class DataService
echo "-------------------------" . PHP_EOL; echo "-------------------------" . PHP_EOL;
//然后随机取出云芯的供应商(1139) //然后随机取出芯链的供应商(1139)
//先剔除api对接的供应商 //先剔除api对接的供应商
$ycYunxinTypeCount = 113; $ycYunxinTypeCount = 113;
$dlsYunxinTypeCount = 302; $dlsYunxinTypeCount = 302;
...@@ -223,7 +223,7 @@ class DataService ...@@ -223,7 +223,7 @@ class DataService
]); ]);
} }
//处理云芯接入的不同类型的数据 //处理芯链接入的不同类型的数据
public function dealYunxinSupplier($supplierGroup, $totalYunxinCount) public function dealYunxinSupplier($supplierGroup, $totalYunxinCount)
{ {
...@@ -241,7 +241,7 @@ class DataService ...@@ -241,7 +241,7 @@ class DataService
array_flip(is_array($rand) ? $rand : [$rand])); array_flip(is_array($rand) ? $rand : [$rand]));
$yunxinSupplierIds = array_column($yunxinSuppliers, 'supplier_id'); $yunxinSupplierIds = array_column($yunxinSuppliers, 'supplier_id');
echo "供应商性质为 : $supplierGroup 的供应商修改云芯上传类型数量 : " . count(array_unique($yunxinSupplierIds)) . PHP_EOL; echo "供应商性质为 : $supplierGroup 的供应商修改芯链上传类型数量 : " . count(array_unique($yunxinSupplierIds)) . PHP_EOL;
// foreach ($yunxinSupplierIds as $supplierId) { // foreach ($yunxinSupplierIds as $supplierId) {
// SupplierChannelModel::where('supplier_id', $supplierId)->update([ // SupplierChannelModel::where('supplier_id', $supplierId)->update([
...@@ -352,7 +352,7 @@ class DataService ...@@ -352,7 +352,7 @@ class DataService
} }
} }
//生成云芯账号 //生成芯链账号
public function generateYunxinAccount($isUpdate = false) public function generateYunxinAccount($isUpdate = false)
{ {
ini_set('memory_limit', -1); ini_set('memory_limit', -1);
...@@ -380,7 +380,7 @@ class DataService ...@@ -380,7 +380,7 @@ class DataService
} }
} }
//处理云芯账号的创建时间 //处理芯链账号的创建时间
public function dealYunxinAccountCreateTime() public function dealYunxinAccountCreateTime()
{ {
$preYearTimestamp = time() - 24 * 3600 * 252 * 1; $preYearTimestamp = time() - 24 * 3600 * 252 * 1;
...@@ -482,7 +482,7 @@ class DataService ...@@ -482,7 +482,7 @@ class DataService
'等级', '等级',
'品质协议是否签署', '品质协议是否签署',
'是否平台供应商', '是否平台供应商',
'是否云芯商家', '是否芯链商家',
'是否SKU上架中', '是否SKU上架中',
'现有SKU采购员或者意向分配采购员', '现有SKU采购员或者意向分配采购员',
'采购所在采购部门', '采购所在采购部门',
...@@ -503,7 +503,7 @@ class DataService ...@@ -503,7 +503,7 @@ class DataService
$isYunxin = '否'; $isYunxin = '否';
if ($supplier['stockup_type']) { if ($supplier['stockup_type']) {
if (strpos($supplier['stockup_type'], "5") !== false) { if (strpos($supplier['stockup_type'], "5") !== false) {
dump("是云芯"); dump("是芯链");
$isYunxin = '是'; $isYunxin = '是';
} }
} }
...@@ -1243,22 +1243,37 @@ class DataService ...@@ -1243,22 +1243,37 @@ class DataService
public function statisticsSkuNumber() public function statisticsSkuNumber()
{ {
$excludeSupplierCodeList = [
'L0004938',
'L0007913',
'L0011546',
'L0001175',
'L0007243',
'L0015040',
];
$dataManagerSupplierCodeList = DataManageModel::where('is_type', 0)->where('canal', '!=', '')->pluck('canal')->toArray(); $dataManagerSupplierCodeList = DataManageModel::where('is_type', 0)->where('canal', '!=', '')->pluck('canal')->toArray();
$excludeSupplierCodeList = array_merge($excludeSupplierCodeList, $dataManagerSupplierCodeList);
//sku上架总数含api接口 //sku上架总数含api接口
$skuNum1 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->sum('sku_num'); $skuNum1 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $excludeSupplierCodeList)->sum('sku_num');
//sku上架总数,不含api接口 //sku上架总数,不含api接口
$skuNum2 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $dataManagerSupplierCodeList)->sum('sku_num'); $skuNum2 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $excludeSupplierCodeList)->sum('sku_num');
//有上架sku的供应商 //有上架sku的供应商
$supplierCount = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->where('sku_num', '>', 0)->count(); $supplierCount = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $excludeSupplierCodeList)->where('sku_num', '>', 0)->count();
$yunxinSupplierCodes = SupplierChannelModel::where('is_type', 0)->where('stockup_type', 'like', '%5%')->where('sku_num', '>', 0)->pluck('supplier_code');
//找出哪些是云芯上传的 //云芯供应商编码
$yunxinSupplierCodes = SupplierChannelModel::where('is_type', 0)->where('stockup_type', 'like', '%5%')->where('sku_num', '>', 0)->pluck('supplier_code')->toArray();
//找出哪些是芯链上传的
$yunxinUploadSupplierCodes = SkuUploadLogModel::whereIn('supplier_code', $yunxinSupplierCodes)->where('source', 2)->pluck('supplier_code')->unique()->toArray(); $yunxinUploadSupplierCodes = SkuUploadLogModel::whereIn('supplier_code', $yunxinSupplierCodes)->where('source', 2)->pluck('supplier_code')->unique()->toArray();
$skuNumYunxin = SupplierChannelModel::whereIn('supplier_code', $yunxinUploadSupplierCodes)->sum('sku_num'); $skuNumYunxin = SupplierChannelModel::whereIn('supplier_code', $yunxinUploadSupplierCodes)->sum('sku_num');
echo("<p>上架供应商数(不含代购,原厂):" . $supplierCount . '</p>'); echo("<p>上架供应商数(不含代购,原厂):" . $supplierCount . '</p>');
echo("<p>上架云芯供应商数:" . count($yunxinUploadSupplierCodes) . '</p>'); echo("<p>上架芯链供应商数:" . count($yunxinUploadSupplierCodes) . '</p>');
echo("<p>SKU 上架总条数(含API接口):" . $skuNum1 . '</p>'); echo("<p>SKU 上架总条数(含API接口):" . $skuNum1 . '</p>');
echo("<p>SKU上架总条数(只含云芯):" . $skuNumYunxin . '</p>'); echo("<p>SKU上架总条数(只含芯链):" . $skuNumYunxin . '</p>');
echo("<p>SKU 上架条数(不含API接口):" . $skuNum2 . '</p>'); echo("<p>SKU 上架条数(不含API接口):" . $skuNum2 . '</p>');
} }
...@@ -1294,7 +1309,7 @@ class DataService ...@@ -1294,7 +1309,7 @@ class DataService
'供应商性质', '供应商性质',
'供应商编码', '供应商编码',
'供应商名称', '供应商名称',
'是否开通云芯', '是否开通芯链',
'接入方式', '接入方式',
'sku上架数量', 'sku上架数量',
'末次更新时间' '末次更新时间'
......
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