spu) return ''; if($this->spu->product_type == 1){ $day = date('Y-m-d',time()); $_day = strtotime($day); $end_day = strtotime($this->spu->seckillActive['end_day']); if($end_day >= $_day) return strtotime($day.$this->spu->seckillActive['end_time'].':00:00'); if($end_day < strtotime($day)) return strtotime(date('Y-m-d',$end_day).$this->spu->seckillActive['end_time'].':00:00'); } } public function spu() { return $this->hasOne(Spu::class,'spu_id','res_id'); } public function searchUidAttr($query,$value) { $query->where('uid',$value); } public function searchHistoryIdAttr($query,$value) { $query->where('history_id',$value); } public function searchHistoryIdsAttr($query,$value) { $query->where('history_id','in',$value); } }