* [bug#50477,done,0.2h] fixed an issue record effort when data is not changed.

This commit is contained in:
tianshujie
2024-06-03 08:35:46 +08:00
committed by caoyanyi
parent 4b3a171520
commit bff471ee08
3 changed files with 11 additions and 9 deletions
+3 -3
View File
@@ -126,10 +126,11 @@ class taskModel extends model
* other data process after task batch edit.
*
* @param object[] $tasks
* @param object[] $oldTasks
* @access public
* @return bool
*/
public function afterBatchUpdate(array $tasks): bool
public function afterBatchUpdate(array $tasks, array $oldTasks = array()): bool
{
$this->loadModel('story');
$this->loadModel('kanban');
@@ -137,13 +138,12 @@ class taskModel extends model
$today = helper::today();
$currentAccount = $this->app->user->account;
$oldTasks = $tasks ? $this->getByIdList(array_keys($tasks)) : array();
foreach($tasks as $taskID => $task)
{
$oldTask = zget($oldTasks, $taskID);
/* Record effort. */
if(!empty($task->consumed))
if(!empty($task->consumed) && $task->consumed != $oldTask->consumed)
{
$record = new stdclass();
$record->account = $currentAccount;