35 lines
775 B
PHP
35 lines
775 B
PHP
<?php
|
|
/**
|
|
* @Created by PhpStorm.
|
|
* @Author:Soar
|
|
* @Time:2024/1/2 14:03
|
|
*/
|
|
|
|
namespace app\api\controller;
|
|
|
|
use addons\cms\model\Archives;
|
|
use app\common\controller\Api;
|
|
|
|
class News extends Api
|
|
{
|
|
protected $noNeedLogin = ['*'];
|
|
protected $noNeedRight = ['*'];
|
|
|
|
public function getNews()
|
|
{
|
|
$news_id = $this->request->param("news_id");
|
|
$archives = new Archives();
|
|
|
|
@$news = $archives->alias("archives")
|
|
->join("peewee_cms_addonnews" . ' addon', 'addon.id=archives.id', 'LEFT')
|
|
->where("archives.id", "eq", $news_id)
|
|
->find()
|
|
->toArray();
|
|
|
|
if (@empty($news)) {
|
|
$this->error("新闻信息不存在");
|
|
}
|
|
|
|
$this->result("获取成功", $news, 1);
|
|
}
|
|
} |