cxfoot/modules/api/controllers/ReportController.php
2023-11-22 20:10:26 +08:00

93 lines
3.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @author Any
* @description KISS
* @date 2021年6月30日
* @version 1.0.0
*
* _____LOG_____
*
*/
namespace app\modules\api\controllers;
use app\modules\api\behaviors\LoginBehavior;
use app\components\SiteHelper;
use app\components\SysConst;
use app\models\common\cms\CommonNoticeActionForm;
use app\models\common\cms\CommonNoticeListForm;
use app\models\cms\Notice;
use app\components\SysErrCode;
use app\modules\api\models\RecordForm;
use app\modules\api\models\ReportForm;
use yii\web\NotFoundHttpException;
class ReportController extends Controller
{
public function behaviors()
{
return array_merge(parent::behaviors(), [
'login' => [
'class' => LoginBehavior::className(),
'ignore' => [
'api/report/get-info'
]
]
]);
}
/**
* showdoc
* @catalog 用户绑定
* @title 公告列表
* @description 本接口提供公告列表
* @method get
* @url /api/report/index
* @param keywords 非必选 string 关键词
* @param page 必选 int 页码
* @param limit 非必选 int 每页记录数
* @param is_top 非必选 int 是否置顶1=是0=否
* @param is_index 非必选 int 首页展示1=是0=否
* @return {"code":0,"msg":"ok","data":[{"author":"","title":"公告公告公告公告1","summary":"","content":"<p>公告公告公告公告公告公告公告公告公告公告公告公告公告额</p>","cover_url":"","id":"1","rich_text_id":"1","sort":"103","is_top":"0","is_index":"1","status":"1","created_at":"1625216065","published_at":"1625216065","viewed_num":"0","created_at_cn":"2021-07-02 16:54:25","published_at_cn":"2021-07-02 16:54:25","status_cn":"已发布"}],"count":"1","page_size":20,"page_count":1,"page_no":1,"end_flag":false}
* @return_param count int 记录条数
* @return_param page_size int 每页记录数
* @return_param page_count int 总页数
* @return_param page_no int 当前页码
* @return_param end_flag bool 是否加载结束
* @remark
*/
public function actionIndex()
{
$form = new ReportForm();
$form->attributes = \Yii::$app->request->get();
$form->cx_mch_id = $this->cx_mch_id;
$form->status = \Yii::$app->request->get('status');
$form->user_id = \Yii::$app->user->identity->id;
$data = $form->search();
return $this->responseHandler($data);
}
/**
* showdoc
* @catalog 数据列表
* @title 获取详情
* @description 数据列表-获取详情
* @method get
* @url /api/report/get-info
* @param /id 数据id
* @remark
*/
public function actionGetInfo(){
$recordForm = new ReportForm();
$recordForm->cx_mch_id = $this->cx_mch_id;
$recordForm->id = \Yii::$app->request->get('id');
$data = $recordForm->actionGetInfo();
return $this->responseHandler($data);
}
}