* [refac] if there is no periodic to-do, do not call the related functions.

This commit is contained in:
liugang
2025-04-15 14:36:51 +08:00
committed by 刘刚
parent 3ccce70833
commit 6459a36613
3 changed files with 5 additions and 1 deletions
+2
View File
@@ -332,6 +332,8 @@ class todoModel extends model
*/
public function createByCycle(array $todoList): void
{
if(empty($todoList)) return;
$this->loadModel('action');
$today = helper::today();
$now = helper::now();
+2
View File
@@ -159,6 +159,8 @@ class todoTao extends todoModel
*/
protected function getCycleList(array $todoList, string $orderBy = 'date_asc'): array
{
if(empty($todoList)) return [];
return $this->dao->select('*')->from(TABLE_TODO)
->where('type')->eq('custom')
->andWhere('deleted')->eq('0')
+1 -1
View File
@@ -899,7 +899,7 @@ class userModel extends model
/* 登录后创建周期性待办。*/
/* Create cycle todo after login. */
$todoList = $this->dao->select('*')->from(TABLE_TODO)->where('cycle')->eq(1)->andWhere('deleted')->eq('0')->andWhere('account')->eq($user->account)->fetchAll('id');
$this->loadModel('todo')->createByCycle($todoList);
if($todoList) $this->loadModel('todo')->createByCycle($todoList);
}
if($user->avatar)