| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Services\Common;
- use App\Services\BaseService;
- use Illuminate\Support\Facades\File;
- /**
- * 会员管理-服务类
- * @author laravel开发员
- * @since 2020/11/11
- * Class MemberService
- * @package App\Services\Common
- */
- class UploadService extends BaseService
- {
- /**
- * 构造函数
- * @author laravel开发员
- * @since 2020/11/11
- * MemberService constructor.
- */
- public function __construct()
- {
- // $this->model = new UploadModel();
- }
- public function save($file_path, $ext, $channel)
- {
- $data = [
- 'group_id' => 0,
- 'channel' => $channel,
- 'storage' => 0,
- 'domain' => 0,
- 'file_type' => 0,
- 'file_name' => 0,
- 'file_path' => $file_path,
- 'file_size' => File::size(public_path() . "/uploads/" . $file_path),
- 'file_ext' => $ext,
- 'cover' => $file_path,
- 'uploader_id' => session('userId') ?? 0,
- 'is_recycle' => 0,
- 'status' => 1,
- ];
- $error = '';
- $rowId = $this->model->edit($data, $error, false);
- }
- }
|