123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\model;
- use DateTimeInterface;
- use support\Model;
- class ClientFavorite extends Model
- {
- protected $table = 'client_favorite';
- protected $primaryKey = 'client_favorite_id';
- protected $dateFormat = 'U';
- const CREATED_AT = 'client_favorite_addtimes';
- const UPDATED_AT = null;
- public function serializeDate(DateTimeInterface $date)
- {
- return $date->format('Y-m-d H:i:s');
- }
- /**
- * @Desc 关联会员
- * @Author Gorden
- * @Date 2024/3/30 13:08
- *
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function member()
- {
- return $this->hasOne(Member::class, 'member_id', 'join_client_favorite_member_id');
- }
- /**
- * @Desc 关联商品
- * @Author Gorden
- * @Date 2024/3/30 13:08
- *
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function goods()
- {
- return $this->hasOne(Goods::class, 'goods_id', 'join_client_favorite_goods_id');
- }
- }
|