'0', 'name' => '', 'uniacid' => '0', 'uid' => '0', 'type' => '0', ); public function searchWithUniacidOrUid($uniacid, $uid, $attachment_by_uid = '') { if (empty($uniacid)) { $this->query->where('uniacid', 0)->where('uid', $uid); } else { if (empty($attachment_by_uid)) { $this->query->where('uniacid', $uniacid); } else { $this->query->where('uniacid', $uniacid)->where('uid', $uid); } } return $this; } }