Browse Source

init following storage

main
ghost 3 years ago
parent
commit
5e99236cdf
  1. BIN
      database/cloud-server.mwb
  2. 27
      src/application/model/follow.php

BIN
database/cloud-server.mwb

Binary file not shown.

27
src/application/model/follow.php

@ -0,0 +1,27 @@
<?php
class ModelFollow extends Model {
public function getFollow($userId) {
try {
$query = $this->_db->execute("SELECT `followUser`.`userId` FROM `followUser`
JOIN `follow` ON (`follow`.`followId` = `followUser`.`followId`)
WHERE `follow`.`userId` = ?
GROUP BY `followUser`.`userId`
ORDER BY `follow`.`seq` DESC");
$query->execute([$userId]);
return $query->rowCount() ? $query->fetch() : [];
} catch (PDOException $e) {
trigger_error($e->getMessage());
return false;
}
}
}
Loading…
Cancel
Save