| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Models;
- /**
- * 商品分类管理-模型
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Models
- */
- class GoodsCategoryModel extends BaseModel
- {
- // 设置数据表
- protected $table = 'goods_categorys';
- protected $appends = ['type_name'];
- // 封面图
- public function getIconAttribute($value)
- {
- $thumb = $value ? get_image_url($value) : '';
- return $thumb;
- }
- public function setIconAttribute($value)
- {
- return $value ? get_image_path($value) : '';
- }
- public function getTypeNameAttribute()
- {
- $types = config('platform.goodsTypes');
- return isset($types[$this->type]) ? $types[$this->type] : '';
- }
- }
|