* [refac] if there is no periodic to-do, do not call the related functions.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user