12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\model;
- use support\Model;
- class ClientPoints extends Model
- {
- protected $table = 'client_points';
- protected $primaryKey = 'client_points_id';
- protected $dateFormat = 'U';
- const CREATED_AT = 'client_points_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_points_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_points_goods_id');
- }
- public function orders()
- {
- return $this->hasOne(Order::class, 'order_id', 'join_client_points_order_id');
- }
- }
|