| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\common\model;
- class Goods extends BaseModel
- {
- /**
- * @var string
- */
- protected $name = 'goods';
- /**
- * @var array
- */
- protected $auto = [];
- /**
- * @var array
- */
- protected $insert = ['created_at','updated_at'];
- /**
- * @var array
- */
- protected $update = ['updated_at'];
- /**
- * @var array
- */
- protected $hidden = ['updated_at'];
- /**
- * 关联分类
- * @return \think\model\relation\BelongsTo
- */
- public function category()
- {
- return $this->belongsTo('GoodsCategory','category_id','id');
- }
- /**
- * 关联获取Seller表
- * @return \think\model\relation\BelongsTo
- */
- public function seller()
- {
- return $this->belongsTo('Seller', 'seller_id', 'id');
- }
- }
|