...
|
...
|
@@ -75,7 +75,6 @@ class Article extends Api |
|
|
public function getArticleList()
|
|
|
{
|
|
|
$myId = $this->auth->id;
|
|
|
$myId = 1;
|
|
|
|
|
|
$universityId = $this->request->param('university_id', 0, 'int');
|
|
|
|
...
|
...
|
@@ -98,29 +97,23 @@ class Article extends Api |
|
|
$this->error('您的提交有误');
|
|
|
}
|
|
|
|
|
|
$type = 1;
|
|
|
if($type) { // 学校限制
|
|
|
if(!in_array($type, [1, 2, 3])) {
|
|
|
$this->error('您的提交有误');
|
|
|
}
|
|
|
|
|
|
$schoolIds = [];
|
|
|
// 获取学长
|
|
|
if($type = 1) {
|
|
|
$schoolIds = [$studentInfo['school_id']];
|
|
|
} elseif ($type = 2) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
|
|
|
} elseif ($type = 3) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
|
|
|
}
|
|
|
$type = bcadd($studentInfo['vip_level'], 1, 0);
|
|
|
$schoolIds = [];
|
|
|
// 获取学长
|
|
|
if($type = 1) {
|
|
|
$schoolIds = [$studentInfo['school_id']];
|
|
|
} elseif ($type = 2) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
|
|
|
} elseif ($type = 3) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
|
|
|
}
|
|
|
|
|
|
if($schoolIds) {
|
|
|
$where['b.school_id'] = ['in', $schoolIds];
|
|
|
}
|
|
|
if($schoolIds) {
|
|
|
$where['b.school_id'] = ['in', $schoolIds];
|
|
|
}
|
|
|
|
|
|
if($universityId) {
|
...
|
...
|
@@ -227,7 +220,6 @@ class Article extends Api |
|
|
public function getArticleInfo()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 1;
|
|
|
|
|
|
$articleId = $this->request->param('article_id', 0, 'int');
|
|
|
if(!$articleId) {
|
...
|
...
|
@@ -299,7 +291,6 @@ class Article extends Api |
|
|
public function likeArticle()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 1;
|
|
|
|
|
|
$articleId = $this->request->param('article_id', 0, 'int');
|
|
|
if(!$articleId) {
|
...
|
...
|
@@ -344,7 +335,6 @@ class Article extends Api |
|
|
public function delLookArticle()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 1;
|
|
|
|
|
|
$lookArticle = new LookArticle();
|
|
|
$res = $lookArticle->updateSomeByUserId($userId, ['deletetime' => time()]);
|
...
|
...
|
@@ -413,7 +403,6 @@ class Article extends Api |
|
|
public function getMyLikeArticle()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 2;
|
|
|
|
|
|
$page = $this->request->param('page', 0, 'int');
|
|
|
$size = $this->request->param('size', 0, 'int');
|
...
|
...
|
@@ -493,7 +482,6 @@ class Article extends Api |
|
|
public function addArticle()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 1;
|
|
|
|
|
|
$title = $this->request->param('title', '', 'string');
|
|
|
if(!$title) {
|
...
|
...
|
@@ -600,7 +588,6 @@ class Article extends Api |
|
|
public function getMyArticle()
|
|
|
{
|
|
|
$userId = $this->auth->id;
|
|
|
$userId = 1;
|
|
|
|
|
|
$page = $this->request->param('page', 1, 'int');
|
|
|
$size = $this->request->param('size', 10, 'int');
|
...
|
...
|
|