* Fix bug when call API due to actor of action is System.

This commit is contained in:
dingguodong
2021-09-09 17:58:57 +08:00
parent f2b7e270d3
commit 4c8a29b414
+5 -2
View File
@@ -192,10 +192,13 @@ class productIssueEntry extends entry
/* Format user detail and date. */
$accountList = array_unique($accountList);
$profileList = $this->loadModel('user')->getUserDetailsForAPI($accountList);
foreach($actions as $action)
foreach($actions as $key => $action)
{
$action->actor = $profileList[$action->actor];
$action->actor = isset($profileList[$action->actor]) ? $profileList[$action->actor] : array();
$action->date = gmdate("Y-m-d\TH:i:s\Z", strtotime($action->date));
/* Unset this action when actor is System. */
if(empty($action->actor)) unset($actions[$key]);
}
return $actions;