Commit 6c0ba1c3 by 杨树贤

fix

parent 123ef8b6
Showing with 23 additions and 1 deletions
......@@ -1651,13 +1651,35 @@ class DataService
\dump("供应商{$value}没有找到跟单员");
continue;
}
$contact = $contact->toArray();
$contact['can_check_uids'] = 10326;
$contact['channel_user_type'] = 1;
unset($contact['contact_id']);
\dump($contact);
//判断是否存在
if (SupplierContactModel::where('supplier_id', $supplierId)->where('can_check_uids', 10326)->where('channel_user_type', 1)->exists()) {
\dump("已经存在 : " . $supplierId);
continue;
}
if ($updateData) {
SupplierContactModel::insert($contact);
$allChannelUids = SupplierContactModel::where('supplier_id', $supplierId)
->pluck('can_check_uids')->toArray();
$allChannelUids = array_unique($allChannelUids);
$allChannelUids = array_filter($allChannelUids, function ($value) {
return !empty($value);
});
\dump('供应商 :' . $supplierId . ' 最后更新的供应商采购员列表为 : ' . \implode(',', $allChannelUids));
if ($updateData) {
if ($allChannelUids) {
SupplierChannelModel::where('supplier_id', $supplierId)->update([
'channel_uid' => \implode(',', $allChannelUids),
]);
}
}
}
\dump("供应商{$value}新增跟单员记录");
}
}
......
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