__('Un_use'), 2 => __('Used'), 3 => __('Expired')]; } public function getExpireTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['expire_time']) ? $data['expire_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } /** * 关联品牌商 */ public function brand(){ return $this->belongsTo('\\app\\admin\\model\\xilufitness\\brand\\Index','brand_id','id',[],'LEFT')->setEagerlyType(0); } /** * 关联用户 */ public function user(){ return $this->belongsTo('\\app\\admin\\model\\xilufitness\\user\\Index','user_id','id',[],'LEFT')->setEagerlyType(0); } }