public function getUserData($vkId) { $bind = ['vkId' => $vkId, 'partnerId' => Config::getInstance()->partnerId]; $data = []; $res = $this->db->select('users', 'partnerId = :partnerId AND vkId = :vkId', $bind); if (count($res) == 1) { $data = $res[0]; } return $data; }
public function getTasksFromOwner($type) { $bind = ['partnerId' => App::getPartnerId(), 'ownerId' => App::getUserId()]; $where = "partnerId = :partnerId AND ownerId = :ownerId"; if ($type != 'all') { $where .= ' AND `type` = :type'; $bind['type'] = $type; } return $this->db->select('tasks', $where, $bind); }