| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- // +----------------------------------------------------------------------
- // | Laravel框架 [ Laravel ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 南京Laravel研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: wesmiler <12345678@qq.com>
- // +----------------------------------------------------------------------
- namespace App\Services;
- use App\Models\ActivityModel;
- /**
- * 寺院活动管理-服务类
- * @author wesmiler
- * @since 2020/11/11
- * Class ActivityService
- * @package App\Services
- */
- class ActivityService extends BaseService
- {
- /**
- * 构造函数
- * @author wesmiler
- * @since 2020/11/11
- * ActivityService constructor.
- */
- public function __construct()
- {
- $this->model = new ActivityModel();
- }
- /**
- * 获取友链列表
- * @return array
- * @since 2020/11/11
- * @author wesmiler
- */
- public function getList()
- {
- $params = request()->all();
- return parent::getList();
- }
- /**
- * 添加或编辑
- * @return array
- * @since 2020/11/11
- * @author wesmiler
- */
- public function edit()
- {
- $data = request()->all();
- // 图片处理
- $image = trim($data['thumb']);
- $id = isset($data['id']) ? $data['id'] : 0;
- if (!$id && !$image) {
- return message('请上传活动图片', false);
- }
- if (strpos($image, "temp")) {
- $data['thumb'] = save_image($image, 'item');
- } else {
- $data['thumb'] = str_replace(IMG_URL, "", $data['thumb']);
- }
- $data['update_time'] = time();
- return parent::edit($data); // TODO: Change the autogenerated stub
- }
- }
|