Commit 6f6a7e4e by 杨树贤

优化调试

parent 7141c53b
...@@ -1128,12 +1128,22 @@ class DataService ...@@ -1128,12 +1128,22 @@ class DataService
'add_time' => time(), 'add_time' => time(),
'admin_id' => 1000 // 系统管理员 'admin_id' => 1000 // 系统管理员
]); ]);
//先判断是否存在相同的采购员
$sameContactId = SupplierChannelModel::where('supplier_id', $supplierId)
->where('channel_user_type', 1)->value('contact_id');
if ($sameContactId) {
\dump('已经存在普通采购员,要转换为跟单采购员: ' . $followerCodeId . ' 供应商ID : ' . $supplierId . ' 供应商名称 : ' . $supplierInfo['name']);
if ($updateData) {
SupplierContactModel::where('contact_id', $sameContactId)->update($contactData);
}
} else {
\dump('创建跟单联系人: ' . $followerCodeId . ' 供应商ID : ' . $supplierId . ' 供应商名称 : ' . $supplierInfo['name']); \dump('创建跟单联系人: ' . $followerCodeId . ' 供应商ID : ' . $supplierId . ' 供应商名称 : ' . $supplierInfo['name']);
if ($updateData) { if ($updateData) {
SupplierContactModel::insert($contactData); SupplierContactModel::insert($contactData);
} }
} }
} }
}
$allChannelUids = SupplierContactModel::where('supplier_id', $supplierId) $allChannelUids = SupplierContactModel::where('supplier_id', $supplierId)
->pluck('can_check_uids')->toArray(); ->pluck('can_check_uids')->toArray();
......
...@@ -97,7 +97,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -97,7 +97,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
DataService::initHistoricalSupplierData(false,6); DataService::initHistoricalSupplierData(false,3);
if (request()->get('delete')) { if (request()->get('delete')) {
} }
// DataService::initSupplierReceiptNationId(); // DataService::initSupplierReceiptNationId();
......
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