__('Person'), 'company' => __('Company')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$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 getConfirmtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setConfirmtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function user() { return $this->belongsTo('\app\admin\model\shopro\user\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function order() { return $this->belongsTo('\app\admin\model\shopro\order\Order', 'order_id', 'id', [], 'LEFT')->setEagerlyType(0); } }