Commit 2fe3ba8c by 杨树贤

修改数据脚本

parent 82e7d84b
...@@ -757,9 +757,6 @@ class DataService ...@@ -757,9 +757,6 @@ class DataService
->where('field_name', 'quality_assurance_agreement')->exists(); ->where('field_name', 'quality_assurance_agreement')->exists();
if (!$hasQualityAssuranceAgreement && !in_array($supplier['supplier_name'], if (!$hasQualityAssuranceAgreement && !in_array($supplier['supplier_name'],
config('field.SkipChangeSupplierTypeNames'))) { config('field.SkipChangeSupplierTypeNames'))) {
if ($supplier['supplier_type'] == SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY) {
continue;
}
dump("没有品质保证协议,修改为临时供应商 : " . $supplier['supplier_name']); dump("没有品质保证协议,修改为临时供应商 : " . $supplier['supplier_name']);
if ($isUpdate) { if ($isUpdate) {
SupplierChannelModel::where('supplier_id', $supplier['supplier_id'])->update([ SupplierChannelModel::where('supplier_id', $supplier['supplier_id'])->update([
...@@ -767,6 +764,12 @@ class DataService ...@@ -767,6 +764,12 @@ class DataService
'supplier_type' => SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY 'supplier_type' => SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY
]); ]);
} }
}else {
if ($isUpdate) {
SupplierChannelModel::where('supplier_id', $supplier['supplier_id'])->update([
'level' => '',
]);
}
} }
} }
} }
......
...@@ -61,5 +61,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -61,5 +61,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->repairLevelESupplierData(); (new \App\Http\Services\DataService())->repairLevelESupplierData(false);
}); });
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