1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace app\model;
- use DateTimeInterface;
- use support\Model;
- class CouponPacketSequence extends Model
- {
- protected $table = 'coupon_packet_sequence';
- protected $primaryKey = 'coupon_packet_sequence_id';
- protected $keyType = 'string';
- protected $dateFormat = 'U';
- const CREATED_AT = 'coupon_packet_sequence_addtimes';
- const UPDATED_AT = null;
- public function serializeDate(DateTimeInterface $date)
- {
- return $date->format('Y-m-d H:i:s');
- }
- /**
- * @Desc 关联券包
- * @Author Gorden
- * @Date 2024/9/12 14:33
- *
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function packet()
- {
- return $this->hasOne(CouponPacket::class,'coupon_packet_id','join_sequence_coupon_packet_id');
- }
- /**
- * @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_coupon_packet_sequence_member_id');
- }
- /**
- * @Desc 关联实名
- * @Author Gorden
- * @Date 2024/8/21 13:50
- *
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function cert()
- {
- return $this->hasOne(MemberCert::class, 'join_cert_member_id', 'join_coupon_packet_sequence_member_id');
- }
- /**
- * @Desc 关联详情
- * @Author Gorden
- * @Date 2024/8/21 13:51
- *
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function info()
- {
- return $this->hasOne(MemberInfo::class, 'join_info_member_id', 'join_coupon_packet_sequence_member_id');
- }
- }
|