| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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 OrderFreightModel extends BaseModel
- {
- // 设置数据表
- protected $table = 'orders_freights';
- /**
- * 货物类型
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function category()
- {
- return $this->hasOne(FreightCategoryModel::class, 'id','freight_cate_id')
- ->select(['id','name','pid','type','status']);
- }
- /**
- * 包装
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function package()
- {
- return $this->hasOne(FreightPackageModel::class, 'id','package_id')
- ->select(['id','name','status']);
- }
- /**
- * 规格
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function spec()
- {
- return $this->hasOne(FreightSpecModel::class, 'id','spec_id')
- ->select(['id','name','sub_name','status']);
- }
- }
|