['t.wechat_id', 't.friend_id'], ]; } /** * @notes 获取列表 * @return array */ public function lists(): array { $this->searchWhere[] = ['w.user_id', '=', $this->userId]; return AiWechatTodo::alias('t') ->join('ai_wechat w', 'w.wechat_id = t.wechat_id') ->field('t.id,t.wechat_id,t.friend_id,t.todo_type,t.todo_content,t.todo_time,t.create_time,t.todo_status,t.fail_reason') ->where($this->searchWhere) ->order('t.id', 'desc') ->limit($this->limitOffset, $this->limitLength) ->select() ->toArray(); } /** * @notes 获取数量 * @return int */ public function count(): int { $this->searchWhere[] = ['w.user_id', '=', $this->userId]; return AiWechatTodo::alias('t') ->join('ai_wechat w', 'w.wechat_id = t.wechat_id') ->field('t.id,t.wechat_id,t.friend_id,t.todo_type,t.todo_content,t.todo_time,t.create_time,t.status,t.fail_reason') ->where($this->searchWhere) ->count(); } }