['name', 'follow_user'], ]; } /** * @notes 获取列表 */ public function lists(): array { $lists = QywxExternalContact::where($this->searchWhere) ->whereNull('delete_time') ->order('id', 'desc') ->limit($this->limitOffset, $this->limitLength) ->select() ->toArray(); foreach ($lists as &$item) { // 解析跟进人JSON $followUsers = json_decode($item['follow_users'] ?? '[]', true); $item['follow_users'] = is_array($followUsers) ? $followUsers : []; } return $lists; } /** * @notes 获取数量 */ public function count(): int { return QywxExternalContact::where($this->searchWhere) ->whereNull('delete_time') ->count(); } }