初始化仓库

This commit is contained in:
2024-09-19 11:32:39 +08:00
commit 8f5315e936
921 changed files with 76455 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace admin\controllers\base;
use admin\components\BaseAdminController;
use admin\controllers\AuthController;
use common\models\SystemNotice;
/**
* @doc-module 公告
*/
class NoticeController extends BaseAdminController
{
/**
* @doc-name 公告列表
*/
public function actionList()
{
$get = \Yii::$app->request->get();
$query = SystemNotice::find()->where(['base_type'=>99]);
$this->field = [
SystemNotice::class => [
'id', 'scene_type', 'content','base_type'
]
];
return $this->create($query,$get);
}
/**
* @doc-name 发送公告
* @doc-param string content 发送公告
* @doc-param int type 3全部4所有医生5所有用户 发送公告
*/
public function actionAddNotice()
{
$get = \Yii::$app->request->get();
$this->requestValidate($get, [
[['type', 'content'], 'required']
]);
$SystemNotice = new SystemNotice();
$SystemNotice->content = $get['content'];
$SystemNotice->scene_type = $get['type'];
$SystemNotice->base_type = 99;
$SystemNotice->saveOrFail();
}
}