__('Live_status 101'), '102' => __('Live_status 102'), '103' => __('Live_status 103'), '104' => __('Live_status 104'), '105' => __('Live_status 105'), '106' => __('Live_status 106'), '107' => __('Live_status 107')]; } public function getLiveStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['live_status']) ? $data['live_status'] : ''); $list = $this->getLiveStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStarttimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['starttime']) ? $data['starttime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEndtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['endtime']) ? $data['endtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setStarttimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setEndtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function goods() { return $this->hasMany(\addons\shopro\model\LiveGoods::class, 'live_id', 'id'); } public function links() { return $this->hasMany(\addons\shopro\model\LiveLink::class, 'live_id', 'id'); } }