| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Services\Common;
- use App\Models\NoticeModel;
- use App\Services\BaseService;
- /**
- * 通知公告-服务类
- * @author laravel开发员
- * @since 2020/11/11
- * Class NoticeService
- * @package App\Services\Common
- */
- class NoticeService extends BaseService
- {
- /**
- * 构造函数
- * @author laravel开发员
- * @since 2020/11/11
- * NoticeService constructor.
- */
- public function __construct()
- {
- $this->model = new NoticeModel();
- }
- /**
- * 设置置顶
- * @return array
- * @since 2020/11/21
- * @author laravel开发员
- */
- public function setIsTop()
- {
- $data = request()->all();
- if (!$data['id']) {
- return message('记录ID不能为空', false);
- }
- if (!$data['is_top']) {
- return message('设置置顶不能为空', false);
- }
- $error = '';
- $item = [
- 'id' => $data['id'],
- 'is_top' => $data['is_top']
- ];
- $rowId = $this->model->edit($item, $error);
- if (!$rowId) {
- return message($error, false);
- }
- return message();
- }
- }
|