__('Order_status 0'), '1' => __('Order_status 1')]; } public function getTableNameList() { return ['package_order' => __('Table_name package_order'), 'lesson_order' => __('Table_name lesson_order'), 'trylesson_order' => __('Table_name trylesson_order')]; } 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] : ''; } public function getTableNameTextAttr($value, $data) { $value = $value ? $value : (isset($data['table_name']) ? $data['table_name'] : ''); $list = $this->getTableNameList(); 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); } }