Skip to content

Commit

Permalink
[Bug修复](1.1.5): 修复流失提醒缺少昵称及头像问题
Browse files Browse the repository at this point in the history
  • Loading branch information
maxincai committed Oct 21, 2021
1 parent a9d27cc commit 85fb3b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ public function getWorkContactById(int $id, array $columns = ['*']): array;
* 查询多条 - 根据ID.
* @param array $ids ID
* @param array|string[] $columns 查询字段
* @param bool $withTrashed 是否包含软删除
* @return array 数组
*/
public function getWorkContactsById(array $ids, array $columns = ['*']): array;
public function getWorkContactsById(array $ids, array $columns = ['*'], bool $withTrashed = false): array;

/**
* 多条分页.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private function getEmployee($employeeIds)
*/
private function getContact($contactIds)
{
$contact = $this->contact->getWorkContactsById($contactIds, ['id', 'name', 'avatar']);
$contact = $this->contact->getWorkContactsById($contactIds, ['id', 'name', 'avatar'], true);
if (empty($contact)) {
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ public function getWorkContactById(int $id, array $columns = ['*']): array
* 查询多条 - 根据ID.
* @param array $ids ID
* @param array|string[] $columns 查询字段
* @param bool $withTrashed 是否包含软删除
* @return array 数组
*/
public function getWorkContactsById(array $ids, array $columns = ['*']): array
public function getWorkContactsById(array $ids, array $columns = ['*'], bool $withTrashed = false): array
{
return $this->model->getAllById($ids, $columns);
$query = $this->model::newModel();
if ($withTrashed) {
$query = $query->withTrashed();
}

$data = $query->find($ids, $columns);
$data || $data = collect([]);
return $data->toArray();
}

/**
Expand Down

0 comments on commit 85fb3b1

Please sign in to comment.