/** * 通过分组ID删除分组 * @param int $user_id 用户ID * @param int $id 分组ID * @return bool */ public function delete($user_id, $id) { $ids = $this->contact_mapper->get_category_contact($user_id, $id); if ($ids and $this->contact_model->save_snapshot($user_id) and $this->contact_mapper->delete_category($user_id, $id)) { //调用删除联系人分组接口,分组缓存在联系人处理后更新 $this->contact_model->update_contact_modified($user_id, $ids); $this->clear_cache($user_id, array('type' => 'delete', 'id' => $id, 'name' => '')); return TRUE; } elseif ($this->contact_mapper->delete_category($user_id, $id)) { $this->clear_cache($user_id, array('type' => 'delete', 'id' => $id, 'name' => '')); return TRUE; } return FALSE; }