| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- // +----------------------------------------------------------------------
- // | Laravel框架 [ Laravel ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 南京Laravel研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: wesmiler <12345678@qq.com>
- // +----------------------------------------------------------------------
- namespace App\Services;
- use App\Models\AdModel;
- use App\Models\GongdengFoxiangModel;
- /**
- * 供灯佛像管理-服务类
- * @author wesmiler
- * @since 2020/11/11
- * Class GongdengFoxiangService
- * @package App\Services
- */
- class GongdengFoxiangService extends BaseService
- {
- /**
- * 构造函数
- * @author wesmiler
- * @since 2020/11/11
- * GongdengFoxiangService constructor.
- */
- public function __construct()
- {
- $this->model = new GongdengFoxiangModel();
- }
- /**
- * 添加或编辑
- * @return array
- * @since 2020/11/11
- * @author wesmiler
- */
- public function edit()
- {
- $data = request()->all();
- // 图片处理
- $thumb = trim($data['thumb']);
- if (strpos($thumb, "temp")) {
- $data['thumb'] = save_image($thumb, 'ad');
- } else {
- $data['thumb'] = str_replace(IMG_URL, "", $data['thumb']);
- }
- $data['update_time'] = time();
- return parent::edit($data); // TODO: Change the autogenerated stub
- }
- }
|