Commit ed2a10a4 by 杨树贤

检查数据

parent 9e3c1e78
...@@ -667,11 +667,38 @@ class DataService ...@@ -667,11 +667,38 @@ class DataService
dd($mongo); dd($mongo);
} }
public static function importBrandAndMapping() public static function updateIedgeSkuName($isUpdate = false)
{ {
ini_set('memory_limit', '2048M');
$filePath = public_path('data') . DIRECTORY_SEPARATOR . '爱智平台SKU汇总表-2024.09.19.xlsx';
Excel::selectSheetsByIndex(0)->load($filePath, function ($reader) use ($isUpdate) {
$reader->sheet('细分商品分类', function () use ($reader, $isUpdate) {
foreach ($reader->all()->toArray() as $key => $item) {
if ($key == 0 || $key > 100) {
continue;
}
$skuId = trim(trim($item[1]),"\t");
$oldSkuName = trim(trim($item[2],"\t"));
$newSkuName = trim(trim($item[3],"\t"));
dump($skuId,$oldSkuName,$newSkuName);
//直接去修改sku的sku_name
$dbInfo = getSpuSkuDb($skuId);
$connection = DB::connection($dbInfo["db"]);
$table = $dbInfo['table'];
$skuName = $connection->table($table)->where('goods_id', $skuId)->value('goods_name');
if (empty($skuName)) {
dump('sku_id找不到');
}
dump($skuName);
}
});
});
} }
} }
...@@ -84,7 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -84,7 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
\App\Http\Services\DataService::getSpuAttrs(); \App\Http\Services\DataService::updateIedgeSkuName();
//\App\Http\Services\DealImageService::replaceCmsImage(); //\App\Http\Services\DealImageService::replaceCmsImage();
//\App\Http\Services\SupplierAddressService::initUnitedAddress(); //\App\Http\Services\SupplierAddressService::initUnitedAddress();
//\App\Http\Services\DataService::checkSupplierBandAccount(); //\App\Http\Services\DataService::checkSupplierBandAccount();
......
...@@ -65,7 +65,12 @@ ...@@ -65,7 +65,12 @@
let cols = [ let cols = [
{type: 'checkbox'}, {type: 'checkbox'},
{field: 'goods_id', title: 'SKUID', align: 'center', width: 180}, {field: 'goods_id', title: 'SKUID', align: 'center', width: 180},
{field: 'goods_images', title: 'goods_images', align: 'center', width: 180}, // {
// field: 'goods_images', title: '商品图片', width: 80, templet: function (data) {
// return data.brand_logo ? "<a href='" + data.goods_images + "' target='_blank'>" +
// "<img class='goods_images' style='width: 40px;height: 20px' src='" + data.goods_images + "'></a>" : '无';
// }
// },
{ {
field: 'status_name', title: '状态', align: 'center', width: 70, templet: function (d) { field: 'status_name', title: '状态', align: 'center', width: 70, templet: function (d) {
return d.goods_status == 1 ? "<a class='layui-btn layui-btn-xs'>上架</a>" : return d.goods_status == 1 ? "<a class='layui-btn layui-btn-xs'>上架</a>" :
......
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