Esempio n. 1
0
 /**
  * 获取系统分组联系人数
  * @param int $user_id 用户ID
  * @return array
  */
 public function get_count($user_id)
 {
     $count = array('all_count' => $this->contact_mapper->get_count($user_id), 'category_count' => $this->contact_mapper->get_category_count($user_id), 'recycled_count' => $this->contact_mapper->get_count($user_id, 'recycled'), 'no_category_count' => 0);
     //@todo 待数据迁移后去除判断
     if (Kohana::config('contact.from_category_table')) {
         $count['no_category_count'] = $count['all_count'] - $this->contact_mapper->get_all_category_contact_count($user_id);
     } else {
         $count['no_category_count'] = $this->contact_mapper->get_count($user_id, 'no_category');
     }
     return $count;
 }