__('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; } public function getAuthStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); $list = $this->getAuthStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStatusList() { return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; } public function getStartTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEndTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getReservationTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getFinishTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['finish_time']) ? $data['finish_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCancelTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['cancel_time']) ? $data['cancel_time'] : ''); 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); } protected function setReservationTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setFinishTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCancelTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function schoolclassesorder() { return $this->belongsTo('app\manystore\model\SchoolClassesOrder', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function schoolclasseslibspec() { return $this->belongsTo('app\manystore\model\SchoolClassesLibSpec', 'classes_lib_spec_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function user() { return $this->belongsTo('app\manystore\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function schoolclassesorderdetail() { return $this->belongsTo('app\manystore\model\SchoolClassesOrderDetail', 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function schoolclasseslib() { return $this->belongsTo('app\manystore\model\SchoolClassesLib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); } }