__('Order_status 0'), '1' => __('Order_status 1')]; } public function getNotifytimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['notifytime']) ? $data['notifytime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getOrderStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['order_status']) ? $data['order_status'] : ''); $list = $this->getOrderStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setNotifytimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }