'待审核',1=>'审核通过',2=>'审核不通过']; //活动状态 const STATUS = [0=>'禁用',1=>'启用']; protected $name = 'group_buy_activity'; protected $append = ['goods_info','fmt_end_time']; public function getFmtEndTimeAttr($value){ $t = strtotime($this->end_time) -time(); if($t>0){ return $t; } return 0; } /** * 优惠券详情 * @param int $couponId * @return null|static */ public static function detail(int $couponId,$with =[]) { return self::get($couponId,$with); } //行为操作关联 public function goodsExcept(){ return $this->hasOne(GroupBuyGoodsModel::class,'group_buy_activity_id','id'); } }