Commit 178ea522 by 杨树贤

优化

parent b384ad5f
......@@ -40,6 +40,11 @@ class AdminUserService
return UserInfoModel::where('name', $userName)->value('userId');
}
public function getAdminIdByEmail($email)
{
return UserInfoModel::where('email', $email)->value('userId');
}
public function getCodeIdsByUserIds($userIds)
{
$intraCodeModel = new IntracodeModel();
......
......@@ -775,9 +775,9 @@ class DataService
}
//导出某个人创建的供应商在采购系统里面是哪个采购做了单
public function exportSupplierChannelUser($createName)
public function exportSupplierChannelUser($email)
{
$adminId = (new AdminUserService())->getAdminIdByUserName($createName);
$adminId = (new AdminUserService())->getAdminIdByEmail($email);
$contacts = SupplierContactModel::where('admin_id', $adminId)->get()->toArray();
$csvData = [];
foreach ($contacts as $contact) {
......
......@@ -62,5 +62,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->exportSupplierChannelUser('admin');
(new \App\Http\Services\DataService())->exportSupplierChannelUser('P2assistant@ichunt.com');
});
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